<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-28209705</id><updated>2012-02-02T01:05:48.761-08:00</updated><category term='Project Euler'/><category term='PowerShell'/><category term='Ruby'/><title type='text'>Mack the # Implement</title><subtitle type='html'>"It's still too early to tell, but I may not be stupid."</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>90</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-28209705.post-8678346416905708433</id><published>2009-02-06T03:37:00.000-08:00</published><updated>2009-02-20T06:16:46.107-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='Project Euler'/><title type='text'>Project Euler - Problem 3</title><content type='html'>Problem 3 reads as follows: &lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;br /&gt;"The prime factors of 13195 are 5, 7, 13 and 29.&lt;br /&gt;&lt;br /&gt;What is the largest prime factor of the number 600851475143 ?"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This one is easy, thanks to Ruby's mathn library and the prime_division method.  You can read more about it and even see the source code for the method at the documentation site.&lt;br /&gt;&lt;br /&gt;All we have to do is require the mathn library, which comes with Ruby by default.  I checked on my Windows and Mac OSX machines.  Then call the prime_division method on the integer.  That creates a multidimensional array.  &lt;br /&gt;&lt;br /&gt;For each item in the array, there are 2 numbers.  The first is the actual prime number and the second relates how many times that prime number can be factored out.  So, for the number 9, you would end up with [3,2].  &lt;br /&gt;&lt;br /&gt;Lastly, we grab the last prime number in the array for the answer.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;require 'mathn'&lt;br /&gt;primeArray = 600851475143.prime_division&lt;br /&gt;puts primeArray[primeArray.length - 1][0]&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-8678346416905708433?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/8678346416905708433/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=8678346416905708433' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/8678346416905708433'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/8678346416905708433'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2009/02/project-euler-problem-3.html' title='Project Euler - Problem 3'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-1572170094540810989</id><published>2009-02-02T05:42:00.000-08:00</published><updated>2009-02-02T09:13:17.394-08:00</updated><title type='text'>Calling XSLT templates with predicates..</title><content type='html'>This is just a mental note for me, so hopefully I won't forget it in the future.&lt;br /&gt;&lt;br /&gt;If you have an XSLT template that limits the result set with a predicate, you must call that template with the predicate intact.  Here's an example:&lt;br /&gt;&lt;br /&gt;Wrong:&lt;br /&gt;&lt;code&gt;&amp;lt;xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" &gt;&lt;br /&gt;&amp;lt;xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;xsl:template match="Items"&gt;&lt;br /&gt; &amp;lt;xsl:apply-templates &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;select="Item"&lt;/span&gt; /&gt;&lt;br /&gt;&amp;lt;/xsl:template&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;xsl:template &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;match="Item[status='archived']"&lt;/span&gt;&gt;&lt;br /&gt; &amp;lt;xsl:element name="title"&gt;&lt;br /&gt;  &amp;lt;xsl:value-of select="title" /&gt;&lt;br /&gt; &amp;lt;/xsl:element&gt;&lt;br /&gt;&amp;lt;/xsl:template&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/xsl:stylesheet&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Right:&lt;br /&gt;&lt;code&gt;&amp;lt;xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" &gt;&lt;br /&gt;&amp;lt;xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;xsl:template match="Items"&gt;&lt;br /&gt; &amp;lt;xsl:apply-templates &lt;span style="font-weight: bold; color: rgb(51, 204, 0);"&gt;select="Item[status='archived']"&lt;/span&gt; /&gt;&lt;br /&gt;&amp;lt;/xsl:template&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;xsl:template &lt;span style="color: rgb(51, 204, 0); font-weight: bold;"&gt;match="Item[status='archived']"&lt;/span&gt;&gt;&lt;br /&gt; &amp;lt;xsl:element name="title"&gt;&lt;br /&gt;  &amp;lt;xsl:value-of select="title" /&gt;&lt;br /&gt; &amp;lt;/xsl:element&gt;&lt;br /&gt;&amp;lt;/xsl:template&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/xsl:stylesheet&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;I am ashamed at how long it took me to figure out what I was doing wrong. ;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-1572170094540810989?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/1572170094540810989/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=1572170094540810989' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/1572170094540810989'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/1572170094540810989'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2009/02/calling-xslt-templates-with-predicates.html' title='Calling XSLT templates with predicates..'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-5517366805623644635</id><published>2009-01-30T01:11:00.000-08:00</published><updated>2009-01-30T01:24:49.787-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='Project Euler'/><title type='text'>Project Euler - Problem 2</title><content type='html'>Alright,  on to problem 2.  "Find the sum of all the even-valued terms in the [Fibonacci] sequence which do not exceed four million."  This one is pretty easy.  Just loop through all the numbers in the Fibonacci sequence up to four million.  The largest actual number in the sequence that does not exceed 4 million is 3,524,578. Here's is my humble attempt at a solution:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;x1,x2 = 0, 1&lt;br /&gt;ans = 0&lt;br /&gt;&lt;br /&gt;# While x1 is less than or equal to 4 million&lt;br /&gt;while(x1 &lt;= 4000000)     &lt;br /&gt; &lt;br /&gt;  # Find the next number in the Fibonacci sequence&lt;br /&gt;  x1+=x2   &lt;br /&gt;  x1,x2= x2,x1     &lt;br /&gt;&lt;br /&gt;  # If that number is even, then add it to the running sum.  &lt;br /&gt;  if(x1%2 == 0) then ans += x1 end&lt;br /&gt;end &lt;br /&gt;&lt;br /&gt;puts ans&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-5517366805623644635?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/5517366805623644635/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=5517366805623644635' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/5517366805623644635'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/5517366805623644635'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2009/01/project-euler-problem-2.html' title='Project Euler - Problem 2'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-7844718468255273071</id><published>2009-01-27T06:37:00.000-08:00</published><updated>2009-01-27T06:50:37.596-08:00</updated><title type='text'>Ruby FTP Scanner</title><content type='html'>I was recently given the task to recursively scan an ftp directory and generate a list of all the files in all the folders in that directory.  Here's a little ruby script that I wrote to accomplish the scan.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;require 'net/ftp'&lt;br /&gt;&lt;br /&gt;# The scanDir function searches through the directory that is passed in as an argument.  If that directory has any sub directories,&lt;br /&gt;# then the function calls itself to handle them.&lt;br /&gt;def scanDir(ftp, dir)&lt;br /&gt;&lt;br /&gt;ftp.chdir(dir)&lt;br /&gt;puts ftp.pwd + "/."&lt;br /&gt;&lt;br /&gt;entries = ftp.list('*')&lt;br /&gt;&lt;br /&gt;entries.each do |entry|&lt;br /&gt;&lt;br /&gt;  if entry.split[2] == "&amp;lt;dir&amp;gt;" then&lt;br /&gt;    # If this is a directory then call scanDir to scan it.&lt;br /&gt;    scanDir(ftp, entry.split.last)&lt;br /&gt;  else&lt;br /&gt;    # else, print out the name of the file.&lt;br /&gt;    puts ftp.pwd + "/" + entry.split.last&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;# Since we dipped down a level to scan this directory, lets go back to the parent so we can scan the next directory.&lt;br /&gt;ftp.chdir('..')&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;# Determine if the user is asking for help.&lt;br /&gt;helpArgs = ["h", "-h", "/h", "?", "-?", "/?"]&lt;br /&gt;if helpArgs.index(ARGV[0]) != nil || ARGV.length == 0 then&lt;br /&gt;&lt;br /&gt;puts "FTPSCAN:"&lt;br /&gt;puts "  The ftpscan script recursively scans an ftp directory and returns a list of all the files and directories contained therein."&lt;br /&gt;puts&lt;br /&gt;puts "  USAGE:"&lt;br /&gt;puts "    ruby ftpscan.rb [ftpserver] [username] [password]"&lt;br /&gt;puts&lt;br /&gt;puts "  EXAMPLE:"&lt;br /&gt;puts "    ruby ftpscan.rb tsftp.turner.com steveo stevepass"&lt;br /&gt;puts&lt;br /&gt;&lt;br /&gt;else&lt;br /&gt;&lt;br /&gt;# Get the command line arguments&lt;br /&gt;server, user, pass = ARGV&lt;br /&gt;&lt;br /&gt;# Connect to the FTP Server&lt;br /&gt;ftp = Net::FTP.new(server)&lt;br /&gt;&lt;br /&gt;# Login to the FTP account&lt;br /&gt;ftp.login(user, pass)&lt;br /&gt;&lt;br /&gt;# Recursively scan the directories.&lt;br /&gt;scanDir(ftp, '')&lt;br /&gt;&lt;br /&gt;# Close the FTP connection.&lt;br /&gt;ftp.close&lt;br /&gt;&lt;br /&gt;end&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-7844718468255273071?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/7844718468255273071/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=7844718468255273071' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/7844718468255273071'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/7844718468255273071'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2009/01/ruby-ftp-scanner.html' title='Ruby FTP Scanner'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-7543517746083618162</id><published>2009-01-23T05:28:00.000-08:00</published><updated>2009-01-23T06:42:06.480-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='Project Euler'/><title type='text'>Project Euler - Problem 1</title><content type='html'>I found a great site called Project Euler.  The site explains it best:&lt;br /&gt;&lt;br /&gt;"Project Euler is a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve. Although mathematics will help you arrive at elegant and efficient methods, the use of a computer and programming skills will be required to solve most problems.&lt;br /&gt;&lt;br /&gt;The motivation for starting Project Euler, and its continuation, is to provide a platform for the inquiring mind to delve into unfamiliar areas and learn new concepts in a fun and recreational context."&lt;br /&gt;&lt;br /&gt;I've been using Ruby as an alternative to PowerShell, since it runs on the miriad of systems that I am exposed to in my current position.  I figured that this would be a good way to increase my Ruby coding skills and have a little fun solving some puzzles at the same time.  From time to time, I'll post my solution to a problem.  I'm still learning, so if you have suggestions, I would love to hear your constructive criticism.&lt;br /&gt;&lt;br /&gt;Problem 1:&lt;br /&gt;Find the sum of all the multiples of 3 or 5 below 1000.&lt;br /&gt;&lt;br /&gt;Solution:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;ans=0&lt;br /&gt;&lt;br /&gt;(1...1000).each{ |i|&lt;br /&gt;&amp;nbsp;&amp;nbsp;if( i%3 == 0 || i%5 == 0 ) then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ans += i&lt;br /&gt;&amp;nbsp;&amp;nbsp;end&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;puts ans&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;I doesn't seem very "Ruby-ish" but it works.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-7543517746083618162?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/7543517746083618162/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=7543517746083618162' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/7543517746083618162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/7543517746083618162'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2009/01/project-euler-problem-1.html' title='Project Euler - Problem 1'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-3324626056843583496</id><published>2008-07-28T12:59:00.001-07:00</published><updated>2008-07-28T13:02:30.207-07:00</updated><title type='text'>Ruby cp_r caveat</title><content type='html'>&lt;p&gt;The ruby fileutil function cp_r, copies a directory, all of its files and subdirectories to a target location.&amp;#160; This is very useful when you are trying to sync 2 directories.&amp;#160; However, by default it will copy the directory as a subdirectory of the supplied target directory.&amp;#160; So:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;cp_r &amp;quot;c:\\fly&amp;quot;, &amp;quot;c:\\soup&amp;quot;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;would give you:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&amp;quot;c:\\soup\\fly&amp;quot;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Now you have a fly in your soup.&amp;#160; This is a serious problem.&amp;#160; What if you were trying to sync your stick and donkey folders?&lt;/p&gt;  &lt;p&gt;To get around this, just stick a period at the end of the the original directory path.&amp;#160; Like so:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;cr_r &amp;quot;c:\\fly\\.&amp;quot;, &amp;quot;c:\\soup&amp;quot;&lt;/strong&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-3324626056843583496?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/3324626056843583496/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=3324626056843583496' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/3324626056843583496'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/3324626056843583496'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2008/07/ruby-cpr-caveat.html' title='Ruby cp_r caveat'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-8263652903409892789</id><published>2008-07-18T04:09:00.001-07:00</published><updated>2008-07-18T04:12:18.693-07:00</updated><title type='text'>A tale of two documentations</title><content type='html'>&lt;p&gt;From time to time I find myself needing to integrate our system with some external vendor, and that usually means writing an XSL transform.&amp;#160; Last week I had 2 completely different experiences dealing with documentation from a couple of vendors.&amp;#160; Let's compare, shall we?&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Company #1:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Company #1 is a large internet video distribution company, which &amp;quot;empowers content owners... to reach their audiences directly through the internet.&amp;quot;&amp;#160; And they are very good at what they do.&amp;#160; They have probably fed you a video through some web site and you don't even know it.&amp;#160; So when it came time to generate an xslt to integrate with their system, I sat down and read the 4 separate documents that describe how to generate the xml manifest.&amp;#160; For the next few days, I played email tag with their support team as I fixed one issue only to unveil another.&amp;#160; It turned out that their documentation had a few errors.&amp;#160; You know, little things like incorrect tag names, required fields that weren't specified as required, and the fact that their xml parser is case sensitive.&amp;#160;&amp;#160; That last one really steamed me.&amp;#160; I have since used the documentation as firewood to fend off the chill that came over me after excluding a distribution region by using a tag named &amp;quot;allow&amp;quot; (no attributes on this tag).&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Company #2:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;On the opposite end of the spectrum is company #2.&amp;#160; Its a small, very specialized, service provider with a single developer currently dedicated to this particular project.&amp;#160; Instead of getting a word or pdf document describing the xml creation process, I was given a highly commented DTD document.&amp;#160; And, surprise, this integration worked the first time without errors.&amp;#160; &lt;/p&gt;  &lt;p&gt;I've conversed with several of my colleagues about this and most of them fail to see the awesomeness of this approach.&amp;#160; So, for those of you who missed it, here's why it is so awesome.&amp;#160; Not only was the documentation completely correct, it couldn't have been incorrect.&amp;#160; By passing me their DTD, they were saying &amp;quot;Here is the code that we use to validate your response.&amp;#160; If it validates for you, it will validate for us as well.&amp;quot;&amp;#160; In this instance the code itself was enough.&amp;#160; They didn't even have to send an example xml file.&amp;#160; XmlSpy generated one in less than a second.&amp;#160; &lt;/p&gt;  &lt;p&gt;I also feel that the comments left directly in the code, in this case the DTD, are a much clearer reflection of the author's intent.&amp;#160; This is the author spilling out his thought process, not just some dud that's been told to document a process by Friday.&amp;#160; &lt;/p&gt;  &lt;p&gt;This experience just validates my belief that large external documents are slowly going the way of the dodo.&amp;#160; I've felt this way for a while now.&amp;#160; I'm a big fan of less documentation that is more useful.&amp;#160; Think about it.&amp;#160; End user's don't want to read a manual anymore.&amp;#160; They've come to expect inline help and most are even trained to look for tooltips.&amp;#160; &lt;/p&gt;  &lt;blockquote&gt;&lt;strong&gt;Song of the day:&lt;/strong&gt;     &lt;br /&gt;State of the Union - David Ford - I Sincerely Apologize for All the Trouble I've Caused&lt;/blockquote&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-8263652903409892789?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/8263652903409892789/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=8263652903409892789' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/8263652903409892789'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/8263652903409892789'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2008/07/tale-of-two-documentations.html' title='A tale of two documentations'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-6515562220999860514</id><published>2008-07-17T04:15:00.001-07:00</published><updated>2008-07-17T04:18:47.995-07:00</updated><title type='text'>Uppercase in XSLT</title><content type='html'>&lt;p&gt;XPATH doesn't have a built in ToUpper() or ToLower() function.&amp;#160; However, you can use the translate function to switch cases.&amp;#160; Here's an example that changes the word &amp;quot;Upper&amp;quot; to all upper case.&lt;/p&gt;  &lt;p&gt;&amp;lt;xsl:variable name=&amp;quot;text&amp;quot; select=&amp;quot;'Upper'&amp;quot; /&amp;gt;    &lt;br /&gt;&amp;lt;xsl:value-of select=&amp;quot;translate($text, 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'&amp;quot; /&amp;gt;&lt;/p&gt;  &lt;p&gt;If you want to go the other way and lowercase your string, just flip-flop the alphabet strings. &lt;/p&gt;  &lt;p&gt;&amp;lt;xsl:variable name=&amp;quot;text&amp;quot; select=&amp;quot;'Upper'&amp;quot; /&amp;gt;    &lt;br /&gt;&amp;lt;xsl:value-of select=&amp;quot;translate($text, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'&amp;quot; /&amp;gt;&lt;/p&gt;  &lt;blockquote&gt;&lt;strong&gt;Song of the day: &lt;/strong&gt;    &lt;br /&gt;Twilight Zone(Live) - Golden Earring - The Naked Truth&lt;/blockquote&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-6515562220999860514?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/6515562220999860514/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=6515562220999860514' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/6515562220999860514'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/6515562220999860514'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2008/07/uppercase-in-xslt.html' title='Uppercase in XSLT'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-7637619227703982415</id><published>2008-07-15T04:15:00.001-07:00</published><updated>2008-07-15T04:15:44.647-07:00</updated><title type='text'>Subversion Video</title><content type='html'>&lt;p&gt;I came across this getting started with subversion video by Dan Wahlin. It's pretty good and would have saved me hours if I had know about it when I got started.&amp;#160; Dan does a good job explaining some of subversion's quirks and how to get around them.&lt;/p&gt;  &lt;p&gt;&lt;a title="http://weblogs.asp.net/dwahlin/archive/2007/08/13/video-how-to-getting-started-with-subversion-and-source-control.aspx" href="http://weblogs.asp.net/dwahlin/archive/2007/08/13/video-how-to-getting-started-with-subversion-and-source-control.aspx"&gt;http://weblogs.asp.net/dwahlin/archive/2007/08/13/video-how-to-getting-started-with-subversion-and-source-control.aspx&lt;/a&gt;&lt;/p&gt;  &lt;blockquote&gt;Song of the day:    &lt;br /&gt;Africa(Toto Cover) - Pyogenesis - Mono... or Will It Ever Be The Way It Used To Be&lt;/blockquote&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-7637619227703982415?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/7637619227703982415/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=7637619227703982415' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/7637619227703982415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/7637619227703982415'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2008/07/subversion-video.html' title='Subversion Video'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-1877418048356018071</id><published>2008-07-14T05:07:00.001-07:00</published><updated>2008-07-14T05:09:12.546-07:00</updated><title type='text'>C# Succ</title><content type='html'>&lt;p&gt;I have a project which requires me to generate multiple artifacts with sequential names.&amp;#160; No sweat, right?&amp;#160; Just stick a number on the end of the name and increment it.&amp;#160; Well, what if your users prefer letters to numbers?&amp;#160; &lt;/p&gt;  &lt;p&gt;Ruby's string.succ function returns the successor to the string by incrementing characters starting from the rightmost alphanumeric character.&amp;#160; It's a shame that C# doesn't have this built in.&amp;#160; &lt;/p&gt;  &lt;p&gt;Here's my stab at recreating the Ruby succ function in C#.&amp;#160; It's not as robust as the ruby version, as it only handles letters, but it is a start and it meets my needs for now.&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Succ(&lt;span class="kwrd"&gt;string&lt;/span&gt; &lt;span class="kwrd"&gt;value&lt;/span&gt;)&lt;br /&gt;{&lt;br /&gt;    List&amp;lt;&lt;span class="kwrd"&gt;string&lt;/span&gt;&amp;gt; alphabet = &lt;span class="kwrd"&gt;new&lt;/span&gt; List&amp;lt;&lt;span class="kwrd"&gt;string&lt;/span&gt;&amp;gt;(&lt;span class="str"&gt;&amp;quot; ,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z&amp;quot;&lt;/span&gt;.Split(&lt;span class="str"&gt;&amp;quot;,&amp;quot;&lt;/span&gt;.ToCharArray()));&lt;br /&gt;    &lt;span class="kwrd"&gt;char&lt;/span&gt;[] values = (&lt;span class="str"&gt;&amp;quot; &amp;quot;&lt;/span&gt; + &lt;span class="kwrd"&gt;value&lt;/span&gt;).ToUpper().ToCharArray();&lt;br /&gt;    &lt;span class="kwrd"&gt;bool&lt;/span&gt; addone = &lt;span class="kwrd"&gt;true&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;for&lt;/span&gt;(&lt;span class="kwrd"&gt;int&lt;/span&gt; i = values.Length - 1; i &amp;gt; -1; i--)&lt;br /&gt;    {&lt;br /&gt;        &lt;span class="kwrd"&gt;if&lt;/span&gt; (addone)&lt;br /&gt;        {&lt;br /&gt;            &lt;span class="kwrd"&gt;if&lt;/span&gt; (values[i] != &lt;span class="str"&gt;'Z'&lt;/span&gt;)&lt;br /&gt;            {&lt;br /&gt;                values[i] = &lt;span class="kwrd"&gt;char&lt;/span&gt;.Parse(alphabet[alphabet.IndexOf(values[i].ToString()) + 1]);&lt;br /&gt;                addone = &lt;span class="kwrd"&gt;false&lt;/span&gt;;&lt;br /&gt;            }&lt;br /&gt;            &lt;span class="kwrd"&gt;else&lt;/span&gt;&lt;br /&gt;                values[i] = &lt;span class="str"&gt;'A'&lt;/span&gt;;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt;(values).Trim();&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Here's some sample output:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;  &lt;li&gt;Succ(&amp;quot;R&amp;quot;) =&amp;gt; &amp;quot;S&amp;quot;&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;Succ(&amp;quot;Z&amp;quot;) =&amp;gt; &amp;quot;AA&amp;quot;&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;Succ(&amp;quot;ZAZ&amp;quot;) =&amp;gt; &amp;quot;ZBA&amp;quot;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;  &lt;p&gt;Song of the day:&lt;br /&gt;    &lt;br /&gt;A Moment of Clarity - Therapy? - Infernal Love&lt;/p&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-1877418048356018071?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/1877418048356018071/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=1877418048356018071' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/1877418048356018071'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/1877418048356018071'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2008/07/c-succ.html' title='C# Succ'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-6484841274001796237</id><published>2008-05-30T07:45:00.001-07:00</published><updated>2008-05-30T07:45:41.180-07:00</updated><title type='text'>A Million Lines of Code</title><content type='html'>&lt;p&gt;I went to a product demo the other day for a CMS that is being developed in house.&amp;#160; I guess they want everybody to start using it.&amp;#160; The presenter went on an on about how flexible it was and how it could do anything.&amp;#160; It can scramble your eggs as long as you can pass in the eggs in a parseable format.&amp;#160; Apparently, they started development in back in 2000 and now it's ready for prime time.&amp;#160; That's right pasters, 8 years ago.&amp;#160; &lt;/p&gt;  &lt;p&gt;Anyway, things were going along great, when something the presenter said hit me like a ton of bricks.&amp;#160; &amp;quot;This [application] has over a million lines of code.&amp;quot;&amp;#160; &lt;strong&gt;Now, what would your reaction be if someone told you that their application had a million lines of code?&lt;/strong&gt;&amp;#160; I had two.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;1.&amp;#160; What does that even mean?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;It seems silly to even mention this type of metric.&amp;#160; Are they still getting paid by the number of lines they produce?&amp;#160; I assume he was trying to impress the more non-technical folks in the room who now think that this thing is approaching the same level as the space shuttle.&amp;#160; (The avionics system, the code that flies the shuttle, has roughly 2 million lines of code.)&amp;#160; But to me it sounds like bloat, which lead me to my next reaction.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;2. I bet I could write that in 999,999 lines of code.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;You would think that in a million lines of code, there'd be a good refactor somewhere.&amp;#160; I would have expected them to find it by at least the sixth year.&lt;/p&gt;  &lt;p&gt;The million lines of code also scream, &amp;quot;This is really complex and when it breaks, boy is it going to break.&amp;quot;&amp;#160; Simplicity, that gets the job done, beats complexity any day.&amp;#160; Simplicity breeds confidence and attracts users.&amp;#160; I've added it to my developer's ethos.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-6484841274001796237?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/6484841274001796237/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=6484841274001796237' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/6484841274001796237'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/6484841274001796237'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2008/05/million-lines-of-code.html' title='A Million Lines of Code'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-7690281517183496730</id><published>2008-03-06T07:00:00.001-08:00</published><updated>2008-03-06T07:00:15.541-08:00</updated><title type='text'>Replace Visual Studio Command Prompt with Powershell</title><content type='html'>&lt;p&gt;I've been using &lt;a href="http://msdn2.microsoft.com/en-us/library/bb386987.aspx"&gt;sqlmetal&lt;/a&gt; a lot lately.&amp;#160; The easiest way to use it is through the Visual Studio Command Prompt.&amp;#160; In my case, I'm using the Visual Studio 2008(9.0) command prompt.&amp;#160; The PowerShell lover in me hated the fact that I had to go to another shell to do this.&amp;#160; After a brief inquiry, the all great Google led me to this excellent &lt;a href="http://et.cairene.net/2006/05/02/vs2005-powershell-prompt/"&gt;post by Robert Anderson&lt;/a&gt; which explains how to edit your PowerShell profile to correctly set all the environment variables used by the Visual Studio 2005 command prompt.&amp;#160; I've made a few tweaks for Visual Studio 2008 and am re-posting it for your enjoyment.&lt;/p&gt;  &lt;p&gt;Just add the code below to your profile.&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;#Set environment variables for Visual Studio Command Prompt&lt;/span&gt;&lt;br /&gt;pushd &lt;span class="str"&gt;'C:\Program Files\Microsoft Visual Studio 9.0\vc'&lt;/span&gt;&lt;br /&gt;cmd /c &amp;#8220;vcvarsall.bat&amp;amp;set&amp;#8221; |&lt;br /&gt;&lt;span class="kwrd"&gt;foreach&lt;/span&gt; {&lt;br /&gt;  &lt;span class="kwrd"&gt;if&lt;/span&gt; ($_ &lt;span class="preproc"&gt;-match&lt;/span&gt; &amp;#8220;=&amp;#8221;) {&lt;br /&gt;    $v = $_.split(&amp;#8220;=&amp;#8221;); set-item -force -path &lt;span class="str"&gt;&amp;quot;ENV:\$($v[0])&amp;quot;&lt;/span&gt;  -value &lt;span class="str"&gt;&amp;quot;$($v[1])&amp;quot;&lt;/span&gt;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;popd&lt;br /&gt;write-host &lt;span class="str"&gt;&amp;quot;`nVisual Studio 2008 Command Prompt variables set.&amp;quot;&lt;/span&gt; -ForegroundColor Yellow&lt;/pre&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-7690281517183496730?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/7690281517183496730/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=7690281517183496730' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/7690281517183496730'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/7690281517183496730'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2008/03/replace-visual-studio-command-prompt.html' title='Replace Visual Studio Command Prompt with Powershell'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-3665608327594831586</id><published>2008-03-06T05:11:00.001-08:00</published><updated>2008-03-06T05:11:22.002-08:00</updated><title type='text'>Tweak Vista's Search Index</title><content type='html'>&lt;p&gt;I'm not sure how I did anything on XP before I started using app launchers.&amp;#160; My first was &lt;a href="http://colibri.leetspeak.org/"&gt;Colibri&lt;/a&gt;, but then I found my true love, &lt;a href="http://launchy.net/"&gt;Launchy&lt;/a&gt;.&amp;#160; It's so liberating not to have to click the start menu(press ctrl+esc or win key), then find programs(press p) and then search through a gigantic list of stuff for what you want.&amp;#160; With Launchy, you just hit your short cut key and start typing in what you want.&amp;#160; &lt;/p&gt;  &lt;p&gt;Vista's start menu comes with a similar search box that let's you type in what you want.&amp;#160; I think that they threw this in because actually going to Programs and looking for what you want is a hideous experience in Vista.&amp;#160; I keep all my applications that don't require an installation in a separate folder named &amp;quot;Programs&amp;quot;.&amp;#160; Vista doesn't search this folder by default, so I had to modify the settings for the start menu... no, no... that's not it.&amp;#160; Maybe it's the user preferences... no, that's not it either.&amp;#160; Oh there it is, in the indexing service.&lt;/p&gt;  &lt;p&gt;In the Vista search box type &amp;quot;index&amp;quot; and it should find &amp;quot;Indexing Options&amp;quot;.&amp;#160; Inside Indexing Options click the Modify button to specify which folders to index.&amp;#160; I actually turned off a few that I didn't care about.&amp;#160; Things like other user's folders, and Outlook.&amp;#160; You can actually disable the service all together if you want to get a slight performance boost, but I like the search bar too much to kill it.&amp;#160; &lt;/p&gt;  &lt;p&gt;For those of you who are keyboard bound like me, might I also suggest using &lt;a href="http://www.slimcode.com/slimKEYS/"&gt;SlimKeys&lt;/a&gt; in conjunction with the Vista search.&amp;#160; SlimKeys comes with an app launcher, but I disabled it.&amp;#160; I am using it's hotkey manager, window positioner/sizer, volume controller, screen grabber and it's format removing paster.&amp;#160; I highly recommend checking it out just for the window positioner/sizer.&amp;#160; It's great to be able to move a window to any corner, or center it or maximize it and even move it to my other monitor with a single keystroke.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-3665608327594831586?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/3665608327594831586/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=3665608327594831586' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/3665608327594831586'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/3665608327594831586'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2008/03/tweak-vista-search-index.html' title='Tweak Vista&amp;#39;s Search Index'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-6353060688622847472</id><published>2008-03-04T12:32:00.001-08:00</published><updated>2008-03-04T12:32:47.539-08:00</updated><title type='text'>Isilon Training: Day Two</title><content type='html'>&lt;p&gt;Today we went through a lot of demos and labs.&amp;#160; The most impressive was the &amp;quot;Upgrade&amp;quot; demo.&amp;#160; We had a test cluster that was a version behind.&amp;#160; The instructor dropped a tar file on one of the nodes, ran an upgrade command from the command line and a couple of minutes later... BAM!&amp;#160; All three nodes in the cluster were updated with no down time.&amp;#160; The only instance where the nodes would have to be rebooted is when there is a change to the kernel.&amp;#160; They have a service that migrates the change to the other nodes so you don't have to.&amp;#160; &lt;/p&gt;  &lt;p&gt;All in all it was really cool and I can't wait to get to play with ours.&amp;#160; If they give me access. :)&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-6353060688622847472?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/6353060688622847472/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=6353060688622847472' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/6353060688622847472'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/6353060688622847472'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2008/03/isilon-training-day-two.html' title='Isilon Training: Day Two'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-526995823718625916</id><published>2008-03-04T04:42:00.001-08:00</published><updated>2008-03-04T04:42:17.853-08:00</updated><title type='text'>Isilon Training: Day One</title><content type='html'>&lt;p&gt;I spent yesterday in a training class for the &lt;a href="http://www.isilon.com/"&gt;Isilon&lt;/a&gt; system that we use at work.&amp;#160; Isilon offers a clustered storage solution that is quite impressive both in its performance and its implementation.&amp;#160; I know that you can go the &lt;a href="http://www.isilon.com/"&gt;web site&lt;/a&gt; and look at all the specs, but I thought I would take some time and share the things that jumped out at me during the first day of training.&lt;/p&gt;  &lt;p&gt;First off, I experienced a slight culture shock when they started talking about capacities.&amp;#160; Speaking from a developer's perspective, I'm used to talking Megabytes when referring to my applications and possibly Gigabytes when talking about data storage.&amp;#160; These guys talk Terabytes and &lt;a href="http://www.techterms.com/definition/petabyte"&gt;Petabytes&lt;/a&gt;.&amp;#160; Imagine what you could do with a petabyte of code.&amp;#160; I think &lt;a href="http://en.wikipedia.org/wiki/Skynet_(fictional)"&gt;Skynet&lt;/a&gt; became self aware right around 1.3 petabytes.&lt;/p&gt;  &lt;p&gt;Now as you can imagine its pretty hard to manage that much data.&amp;#160; The mainstream file systems just won't cut it, so they wrote their own.&amp;#160; They based their OneFS file system and OS on &lt;a href="http://www.freebsd.org/"&gt;FreeBSD&lt;/a&gt;.&amp;#160; Each node in the cluster runs the OS and communicates with the other nodes so that each node knows what the other nodes have and are doing.&amp;#160; This way, there isn't a single controller unit.&amp;#160; Any node could go down completely and the system will continue to run without a hiccup.&amp;#160; It also makes it easier to add expansion nodes.&amp;#160; You can easily add several terabytes of new storage to the system in approximately 60 seconds.&lt;/p&gt;  &lt;p&gt;One of the coolest decisions that they made was to stripe files across nodes and not across disks(most nodes have 12 disks).&amp;#160; This provides the highest level of data protection in the event of a failure.&amp;#160; &lt;/p&gt;  &lt;p&gt;In today's class, we'll be looking at some troubleshooting exercises and hands on labs.&amp;#160; Should be fun.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-526995823718625916?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/526995823718625916/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=526995823718625916' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/526995823718625916'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/526995823718625916'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2008/03/isilon-training-day-one.html' title='Isilon Training: Day One'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-3047244717314669963</id><published>2008-02-29T07:38:00.001-08:00</published><updated>2008-03-02T20:44:01.702-08:00</updated><title type='text'>Tweaking the SiteMap Navigation Menu</title><content type='html'>&lt;p&gt;I have a site that uses a SiteMap provider and a Menu control for the site's navigation controls. Using the SiteMap provider is a simple and quick way to get dynamic menu for your site. Everything was going along smoothly until I was asked to have one of the menu items open it's link in a new window. &lt;/p&gt;  &lt;p&gt;If this was just a link, I'd add a "target='_blank'" attribute and be done. However, a quick romp in the web.sitemap file showed that Visual Studio didn't have anything in the intellisence that resembled the target attribute. So what are we to do? Well, I'm glad you asked. &lt;/p&gt;  &lt;p&gt;A little digging showed that the System.Web.UI.WebControls.MenuItem object actually had a target property. So all I had to do was set it. In the Web.Sitemap, I added a target attribute to the sitemap node.&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;siteMapNode&lt;/span&gt; &lt;span class="attr"&gt;url&lt;/span&gt;&lt;span class="kwrd"&gt;="http://ewo/"&lt;/span&gt; &lt;span class="attr"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;="EWO"&lt;/span&gt; &lt;span style="color:#008000;"&gt;&lt;strong&gt;&lt;span class="attr"&gt;target&lt;/span&gt;&lt;span class="kwrd"&gt;="_blank"&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Then I mapped the OnMenuItemDataBound event to a custom handler.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:SiteMapDataSource&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="SiteMapDataSource1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="attr"&gt;ShowStartingNode&lt;/span&gt;&lt;span class="kwrd"&gt;="false"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:Menu&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="Menu1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="attr"&gt;DataSourceID&lt;/span&gt;&lt;span class="kwrd"&gt;="SiteMapDataSource1"&lt;/span&gt; &lt;span class="attr"&gt;Orientation&lt;/span&gt;&lt;span class="kwrd"&gt;="Horizontal"&lt;/span&gt;&lt;br /&gt;   &lt;strong&gt;&lt;span style="color:#008000;"&gt;&lt;span class="attr"&gt;OnMenuItemDataBound&lt;/span&gt;&lt;span class="kwrd"&gt;="Menu1_MenuItemDataBound"&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The target attribute that I set in the SiteMapNode is translated into the dataobject and can easily be retrieved and used to set the MenuItem's target property.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Menu1_MenuItemDataBound(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, MenuEventArgs e)&lt;br /&gt;{&lt;br /&gt;   SiteMapNode node = (SiteMapNode)e.Item.DataItem;&lt;br /&gt;&lt;br /&gt;   &lt;span class="kwrd"&gt;if&lt;/span&gt; (node[&lt;span class="str"&gt;"target"&lt;/span&gt;] != &lt;span class="kwrd"&gt;null&lt;/span&gt;)&lt;br /&gt;       e.Item.Target = node[&lt;span class="str"&gt;"target"&lt;/span&gt;];       &lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;There are other great attributes that can be set this way, including the image url, text and tooltip properties.  Have fun!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-3047244717314669963?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/3047244717314669963/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=3047244717314669963' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/3047244717314669963'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/3047244717314669963'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2008/02/tweaking-sitemap-navigation-menu.html' title='Tweaking the SiteMap Navigation Menu'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-5859265566336152645</id><published>2008-02-28T06:50:00.001-08:00</published><updated>2008-02-28T06:50:50.187-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PowerShell'/><title type='text'>PowerShell Convert CSV to SQL Insert Script</title><content type='html'>&lt;p&gt;Recently, I've been handed a lot of Excel spreadsheets (and various other formats) and told to move the data into a SQL table.&amp;#160; You could do this with DTS if you have that kind of access to the server, but suppose you didn't.&amp;#160; Here's a little PowerShell script that crunches through the rows in a CSV file and generates insert statements in a SQL script.&amp;#160; The script requires that you pass a path to the CSV file and also accepts an optional parameter for the name of the table to insert into.&amp;#160; If you don't pass this in, the filename is used as the table name.&amp;#160; The script is intentionally lengthy and properly commented to make it easier to read and understand. Here you go...&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;&lt;font color="#008000"&gt;# Verify that a file argument was passed in.&lt;/font&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;if&lt;/span&gt; ($args[0]) { $file = $args[0] }&lt;br /&gt;&lt;span class="kwrd"&gt;else&lt;/span&gt; { write-warning &lt;span class="str"&gt;&amp;quot;You must supply a path to the csv.&amp;quot;&lt;/span&gt;; &lt;span class="kwrd"&gt;break&lt;/span&gt; }&lt;br /&gt;&lt;br /&gt;&lt;span class="rem"&gt;&lt;font color="#008000"&gt;# Verify that the file exists.&lt;/font&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;if&lt;/span&gt;(![System.IO.File]::Exists($file)) { write-warning &lt;span class="str"&gt;&amp;quot;Can not find '$file'.&amp;quot;&lt;/span&gt;; &lt;span class="kwrd"&gt;break&lt;/span&gt; }&lt;br /&gt;&lt;br /&gt;&lt;span class="rem"&gt;&lt;font color="#008000"&gt;# Verify that the file is a csv file.&lt;/font&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;if&lt;/span&gt;(!$file.ToLower().EndsWith(&lt;span class="str"&gt;&amp;quot;csv&amp;quot;&lt;/span&gt;)) { write-warning &lt;span class="str"&gt;&amp;quot;The file specified is not a CSV file.&amp;quot;&lt;/span&gt;; &lt;span class="kwrd"&gt;break&lt;/span&gt; }&lt;br /&gt;&lt;br /&gt;&lt;span class="rem"&gt;&lt;font color="#008000"&gt;# If no table name was provided, we'll use the file name instead.&lt;/font&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;if&lt;/span&gt;($args[1]) { $tableName = $args[1] }&lt;br /&gt;&lt;span class="kwrd"&gt;else&lt;/span&gt; { ls $file | % { $tableName = $_.Name.ToLower().TrimEnd(&lt;span class="str"&gt;&amp;quot;.csv&amp;quot;&lt;/span&gt;) } }&lt;br /&gt;&lt;br /&gt;&lt;font color="#008000"&gt;&lt;span class="rem"&gt;# Generate an informative header for the sql file.&lt;/span&gt;&lt;br /&gt;&lt;span class="rem"&gt;# Note that the out-file command will overwrite any existing file.&lt;/span&gt;&lt;/font&gt;&lt;br /&gt;$output = $file.ToLower().TrimEnd(&lt;span class="str"&gt;&amp;quot;.csv&amp;quot;&lt;/span&gt;) + &lt;span class="str"&gt;&amp;quot;.sql&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;span class="str"&gt;&amp;quot;/************************************************************`n&amp;quot;&lt;/span&gt; +&lt;br /&gt;&lt;span class="str"&gt;&amp;quot;** Script generated by CsvToBatchInsert.ps1 `n&amp;quot;&lt;/span&gt; + &lt;br /&gt;&lt;span class="str"&gt;&amp;quot;** Date: &amp;quot;&lt;/span&gt; + [System.DateTime]::Now.ToString(&lt;span class="str"&gt;&amp;quot;MM/dd/yyyy hh:mm:ss&amp;quot;&lt;/span&gt;) + &lt;span class="str"&gt;&amp;quot; `n&amp;quot;&lt;/span&gt; + &lt;br /&gt;&lt;span class="str"&gt;&amp;quot;** From file: $file `n&amp;quot;&lt;/span&gt; + &lt;br /&gt;&lt;span class="str"&gt;&amp;quot;************************************************************/`n&amp;quot;&lt;/span&gt; | out-file -filepath $output &lt;br /&gt;&lt;br /&gt;&lt;span class="rem"&gt;&lt;font color="#008000"&gt;# Loop through the rows in the csv file.&lt;/font&gt;&lt;/span&gt;&lt;br /&gt;Import-Csv $file | % {&lt;br /&gt;    &lt;span class="rem"&gt;&lt;font color="#008000"&gt;# The insert variable is used to build a single insert statement.&lt;/font&gt;&lt;/span&gt;&lt;br /&gt;    $insert = &lt;span class="str"&gt;&amp;quot;INSERT INTO $tableName (&amp;quot;&lt;/span&gt;&lt;br /&gt;    &lt;br /&gt;    &lt;span class="rem"&gt;&lt;font color="#008000"&gt;# We only care about the noteproperties, no use dealing with methods and the such.&lt;/font&gt;&lt;/span&gt;&lt;br /&gt;    $properties = $_ | Get-Member | where { $_.MemberType &lt;span class="preproc"&gt;-eq&lt;/span&gt; &lt;span class="str"&gt;&amp;quot;NoteProperty&amp;quot;&lt;/span&gt; }&lt;br /&gt;&lt;br /&gt;    &lt;font color="#008000"&gt;&lt;span class="rem"&gt;# Create a comma delimited string of all the property names to use in the insert statement. &lt;/span&gt;&lt;br /&gt;    &lt;span class="rem"&gt;# You should make sure that the column headings in the CSV file match the field names in &lt;/span&gt;&lt;br /&gt;    &lt;span class="rem"&gt;# your table before you run the script.&lt;/span&gt;&lt;/font&gt;&lt;br /&gt;    $properties | % { $insert += $_.Name + &lt;span class="str"&gt;&amp;quot;, &amp;quot;&lt;/span&gt; }&lt;br /&gt;    &lt;br /&gt;    $insert = $insert.TrimEnd(&lt;span class="str"&gt;&amp;quot;, &amp;quot;&lt;/span&gt;) + &lt;span class="str"&gt;&amp;quot;) VALUES (&amp;quot;&lt;/span&gt;&lt;br /&gt;    &lt;br /&gt;    &lt;font color="#008000"&gt;&lt;span class="rem"&gt;# Couldn't figure out how to access the value directly.  So here I'm forced to use &lt;/span&gt;&lt;br /&gt;    &lt;span class="rem"&gt;# substring to get it.  The Definition looks like &amp;quot;System.String PropertyName=PropertyValue&amp;quot;.&lt;/span&gt;&lt;br /&gt;    &lt;span class="rem"&gt;# Since the value will be enclosed in single quotes, you will run into trouble if the value  &lt;/span&gt;&lt;br /&gt;    &lt;span class="rem"&gt;# contains a single quote.  To escape the single quote in T-SQL, just put another single quote&lt;/span&gt;&lt;br /&gt;    &lt;span class="rem"&gt;# directly in front of it.&lt;/span&gt;&lt;/font&gt;&lt;br /&gt;    $properties | % { &lt;br /&gt;        $value = $_.Definition.SubString($_.Definition.IndexOf(&lt;span class="str"&gt;&amp;quot;=&amp;quot;&lt;/span&gt;) + 1)&lt;br /&gt;        $insert += &lt;span class="str"&gt;&amp;quot;'&amp;quot;&lt;/span&gt; + $value.Replace(&lt;span class="str"&gt;&amp;quot;'&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;''&amp;quot;&lt;/span&gt;) + &lt;span class="str"&gt;&amp;quot;', &amp;quot;&lt;/span&gt; &lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    $insert = $insert.TrimEnd(&lt;span class="str"&gt;&amp;quot;, &amp;quot;&lt;/span&gt;) + &lt;span class="str"&gt;&amp;quot;)&amp;quot;&lt;/span&gt;&lt;br /&gt;    &lt;br /&gt;    &lt;span class="rem"&gt;&lt;font color="#008000"&gt;# Append the insert statement to the end of the output file.&lt;/font&gt;&lt;/span&gt;&lt;br /&gt;    $insert | out-file -filepath $output -append&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;You can easily tweak this script to generate update statements, or delete statements, or anything else for that matter.&amp;#160; As always, I welcome any comments, especially ones that show a better way of doing this.&amp;#160; Enjoy!!!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-5859265566336152645?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/5859265566336152645/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=5859265566336152645' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/5859265566336152645'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/5859265566336152645'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2008/02/powershell-convert-csv-to-sql-insert.html' title='PowerShell Convert CSV to SQL Insert Script'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-8765555574871514325</id><published>2008-02-26T12:54:00.001-08:00</published><updated>2008-02-26T12:54:45.462-08:00</updated><title type='text'>Dynamically create Powershell objects</title><content type='html'>&lt;p&gt;I wrote a sweet powershell script today that dynamically generated a custom object.&amp;#160; To create an object in Powershell, you basically edit an existing object by adding new methods and properties.&amp;#160; In my case, I used System.Object and added some properties.&amp;#160; &lt;/p&gt;  &lt;p&gt;Suppose you are in the middle of a powershell script and you realize that you need a cat class.&amp;#160; Cat's have claws, fur and multiple output devices, but let's limit ourselves to just one.&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;$myCat = New-Object -TypeName System.Object     &lt;br /&gt;$myCat | Add-Member -MemberType noteProperty -Name &amp;quot;Fur&amp;quot; -Value &amp;quot;Soft&amp;quot;      &lt;br /&gt;$myCat | Add-Member -MemberType noteProperty -Name &amp;quot;Claws&amp;quot; -Value &amp;quot;Sharp&amp;quot;      &lt;br /&gt;$myCat | Add-Member -MemberType ScriptMethod GenerateHairBall { $hairball = &amp;quot;Hmmph, hmmph, ack, aaaaaack! There you go!&amp;quot;; $hairball }&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;And there you go.&amp;#160; If you have more than one cat, you can store them in an array.&amp;#160; Like this:&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;$cardboardBox += $myCat     &lt;br /&gt;$cardboardBox += $SarahsCat&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;etc...&amp;#160; &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-8765555574871514325?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/8765555574871514325/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=8765555574871514325' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/8765555574871514325'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/8765555574871514325'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2008/02/dynamically-create-powershell-objects.html' title='Dynamically create Powershell objects'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-2935868482483445701</id><published>2008-02-25T09:10:00.001-08:00</published><updated>2008-02-25T09:10:36.947-08:00</updated><title type='text'>Javascript getElementByRegexId Function</title><content type='html'>&lt;p&gt;One of the most frustrating aspects of working with ASP.NET is the way it rewrites the id's for all the controls on the page.&amp;#160; When you want to access that control via javascript, you're screwed.&amp;#160; Sure you could have ASP.NET render the control's ClientID, like...&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;javascript:alert('&amp;lt;%= txtName.ClientID %&amp;gt;');&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;But, IMO, this is highly unattractive.&amp;#160; It also breaks the separation of content, design, and function by requiring javascript to be on the page. &lt;/p&gt;  &lt;p&gt;We are all pretty reliant on the getElementById function.&amp;#160; It's a shame that there isn't a 'getElementByPartialId' function.&amp;#160; I can not find a way to get javascript's default functions to return my &amp;quot;txtName&amp;quot; control when it is rendered as the &amp;quot;ctl00_GridView1_WhoApprovedThisNamingConvention?_ctl05_txtName&amp;quot; control.&amp;#160; ASP messes with the &amp;quot;name&amp;quot; attribute as well.&amp;#160; It just uses dollar signs instead of underscores.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Note to Microsoft:&lt;/strong&gt;&amp;#160; Next time you revamp ASP.NET.&amp;#160; Create a new attribute on your base web control object called &amp;quot;aspid&amp;quot; and hack away.&amp;#160; Just leave &amp;quot;id&amp;quot; alone.&lt;/p&gt;  &lt;p&gt;Knowing that Javascript is incredibly powerful and versatile, I put together a little function to help out.&amp;#160; You just pass in the id that you know and what kind of control you expect to be rendered.&amp;#160; Passing in &amp;quot;*&amp;quot; for the tag name should work as well, it just won't be quite as fast.&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;function getElementByRegexId(id, tagName)      &lt;br /&gt;{       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; var rx = new RegExp(&amp;quot;^.*&amp;quot; + id + &amp;quot;$&amp;quot;);       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; var controls = document.getElementsByTagName(tagName);       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; var result;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; for(var i = 0; i &amp;lt; controls.length; i++)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if(rx.test(controls[i].id))       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; result = controls[i];       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; break;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; return result;       &lt;br /&gt;}&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;I've gone through this exercise before, but I can't remember where.&amp;#160; Can anyone think of a cooler way to accomplish this?&amp;#160; &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-2935868482483445701?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/2935868482483445701/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=2935868482483445701' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/2935868482483445701'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/2935868482483445701'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2008/02/javascript-getelementbyregexid-function.html' title='Javascript getElementByRegexId Function'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-447595856301100476</id><published>2008-02-19T08:07:00.001-08:00</published><updated>2008-02-19T08:07:14.213-08:00</updated><title type='text'>ASP.NET Membership Password Requirements</title><content type='html'>&lt;p&gt;I've been meaning to post about this for a while.&amp;#160; I experienced an issue with the ASP.NET Membership provider and it's default password requirements.&amp;#160; By default the provider requires that a user's password contains at least one non-alphanumeric character.&amp;#160; After blindly stumbling around Google for a while I smacked my head on this &lt;a href="http://weblogs.asp.net/derekh/archive/2006/03/21/444429.aspx"&gt;post by Derek Hatchard&lt;/a&gt;.&amp;#160; Turns out that there is an attribute in the membership provider section called &amp;quot;minRequiredNonalphanumericCharacters&amp;quot;.&amp;#160; Once I set this to &amp;quot;0&amp;quot;, my issue was resolved.&lt;/p&gt;  &lt;p&gt;There are some other cool attributes as well.&amp;#160; &amp;quot;MinRequiredPasswordLength&amp;quot; sets how long the password has to be.&amp;#160; You can even validate the password against a regular expression with the &amp;quot;passwordStrengthRegularExpression&amp;quot; attibute.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-447595856301100476?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/447595856301100476/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=447595856301100476' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/447595856301100476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/447595856301100476'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2008/02/aspnet-membership-password-requirements.html' title='ASP.NET Membership Password Requirements'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-1878508562336189645</id><published>2008-02-07T07:08:00.001-08:00</published><updated>2008-02-07T07:08:56.914-08:00</updated><title type='text'>Resharper 3.1 Upgrade Issues</title><content type='html'>&lt;p&gt;I upgraded from Resharper 3.0 to 3.1 today and immediately had some issues.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Issue #1 - Intellisense was disabled.&lt;/strong&gt;&amp;#160; &lt;/p&gt;  &lt;p&gt;My intellisense was disabled on the Visual Studio level.&amp;#160; To re-enable it, I went to Tools -&amp;gt; Options -&amp;gt; Text Editor -&amp;gt; C#.&amp;#160; In the Statement Completion control grouping, I checked &amp;quot;Auto list members&amp;quot;&amp;#160; to turn it back on.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Issue #2 - Alt+Enter stopped working.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;To fix this, just go to Resharper -&amp;gt; Options -&amp;gt; General.&amp;#160; Then select the &amp;quot;Visual Studio&amp;quot; radio button under &amp;quot;Restore Resharper keyboard shortcuts&amp;quot;. Then click &amp;quot;Apply&amp;quot;&lt;/p&gt;  &lt;p&gt;Here's another handy tip.&amp;#160; Since Resharper won't play nice with the new .NET 3.0+ features until version 4.0, you can temporarily disable/enable it on any open file with the &lt;strong&gt;Ctrl+8&lt;/strong&gt; keyboard shortcut.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-1878508562336189645?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/1878508562336189645/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=1878508562336189645' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/1878508562336189645'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/1878508562336189645'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2008/02/resharper-31-upgrade-issues.html' title='Resharper 3.1 Upgrade Issues'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-2293764346015282214</id><published>2008-01-15T08:09:00.001-08:00</published><updated>2008-01-15T08:09:30.117-08:00</updated><title type='text'>CSS Lessons</title><content type='html'>&lt;p&gt;I just finished re-skinning a website and came across a couple of CSS stumbling blocks that gave me a little trouble.&amp;#160; Hopefully these my save you some time in your future projects.&lt;/p&gt;  &lt;p&gt;My first issue has to do with the position style.&amp;#160; Absolute positioning will place an element at the exact pixel location on the page.&amp;#160; However, if the parent element has a position style of &amp;quot;relative&amp;quot;, then the absolutely positioned element will use the parent element to determine position, instead of the page itself.&lt;/p&gt;  &lt;p&gt;My other issue revolved around the anchor pseudo classes.&amp;#160; If you assign them directly to the &amp;quot;a&amp;quot; element, they will be used by all the anchors on the page, whether you like it or not.&amp;#160; Consider the following CSS styles:&lt;/p&gt;  &lt;p&gt;&lt;font face="Times New Roman"&gt;a:link { color: red; }&lt;/font&gt;     &lt;br /&gt;&lt;font face="Times New Roman"&gt;a:active { color: red; }&lt;/font&gt;     &lt;br /&gt;&lt;font face="Times New Roman"&gt;a:visited { color: red; }&lt;/font&gt;    &lt;br /&gt;&lt;font face="Times New Roman"&gt;a:hover { color: green; }&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Times New Roman"&gt;#mydiv a:link { color: blue; }&lt;/font&gt;     &lt;br /&gt;&lt;font face="Times New Roman"&gt;#mydiv a:active { color: blue; }&lt;/font&gt;     &lt;br /&gt;&lt;font face="Times New Roman"&gt;#mydiv a:visited { color: blue; }&lt;/font&gt;     &lt;br /&gt;&lt;font face="Times New Roman"&gt;#mydiv a:hover { color: yellow; }&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;In this scenario, all the links in mydiv will be red.&amp;#160; To get around this, you need to put identifiers in front of all the &amp;quot;a&amp;quot; styles.&lt;/p&gt;  &lt;p&gt;I experienced this behavior in both IE and Firefox.&amp;#160; &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-2293764346015282214?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/2293764346015282214/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=2293764346015282214' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/2293764346015282214'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/2293764346015282214'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2008/01/css-lessons.html' title='CSS Lessons'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-1952447445078272305</id><published>2008-01-10T12:51:00.001-08:00</published><updated>2008-01-10T12:51:06.904-08:00</updated><title type='text'>Microsoft AJAX UpdateProgress Control</title><content type='html'>&lt;p&gt;Today, I learned that the &lt;a href="http://en.wikipedia.org/wiki/Coconut_crab"&gt;coconut crab&lt;/a&gt; is the largest land-living arhropod in the world, &lt;a href="http://dictionary.reference.com/browse/Clinophobia"&gt;Clinophobia&lt;/a&gt; is a fear of going to bed, and you can easily cause an animated gif to display while your ASP.NET AJAX Update panel is busy doing a call back.&amp;#160; &lt;/p&gt;  &lt;p&gt;It's easy, just use the UpdateProgress Control.&amp;#160; Point it at the update panel and give it something to display and voila!&amp;#160; Here's a code example:&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:UpdateProgress&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;updateProgress1&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;AssociatedUpdatePanelID&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;UpdatePanel1&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;DisplayAfter&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;100&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;DynamicLayout&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ProgressTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Update&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;img&lt;/span&gt; &lt;span class="attr"&gt;src&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;MyAnimated.gif&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ProgressTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:UpdateProgress&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-1952447445078272305?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/1952447445078272305/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=1952447445078272305' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/1952447445078272305'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/1952447445078272305'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2008/01/microsoft-ajax-updateprogress-control.html' title='Microsoft AJAX UpdateProgress Control'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-2013820431394979260</id><published>2008-01-09T12:34:00.001-08:00</published><updated>2008-01-09T12:34:16.062-08:00</updated><title type='text'>Use .NET 3.5 in ASP.NET 2.0</title><content type='html'>&lt;p&gt;Today, I was able to get an ASP.NET 2.0 application to successfully reference and use a .NET 3.5 dll.&amp;#160; I don't know why this surprised me, but it did.&amp;#160; The dll uses Linq to do some XML parsing among other things.&amp;#160; All I had to do was install the framework on the server.&amp;#160; Sweet!&amp;#160; I may have to rename my site to something like &amp;quot;Frankenstein&amp;quot;.&amp;#160; :)&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-2013820431394979260?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/2013820431394979260/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=2013820431394979260' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/2013820431394979260'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/2013820431394979260'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2008/01/use-net-35-in-aspnet-20.html' title='Use .NET 3.5 in ASP.NET 2.0'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-4803619500475441182</id><published>2008-01-07T12:33:00.001-08:00</published><updated>2008-01-07T12:33:26.013-08:00</updated><title type='text'>Count things with Linq</title><content type='html'>&lt;p&gt;I had a situation where I needed to determine how many objects in a generic list were missing a value in a property.&amp;#160; That count was very important to the user.&amp;#160; Basically, I was looking for all the objects in the list that didn't have a value in the path property.&amp;#160; Normally, I would have created a count integer and a loop of some sort and just counted.&amp;#160; &lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;int&lt;/span&gt; count = 0;&lt;br /&gt;&lt;span class="kwrd"&gt;foreach&lt;/span&gt;(Profile p &lt;span class="kwrd"&gt;in&lt;/span&gt; Profiles)&lt;br /&gt;{&lt;br /&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt;(String.IsNullOrEmpty(p.Path))&lt;br /&gt;    {&lt;br /&gt;        count++;&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;I could have also used an anonymous delegate, but I was playing with Linq and found this little short cut.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;int&lt;/span&gt; count = (from p &lt;span class="kwrd"&gt;in&lt;/span&gt; profiles &lt;span class="kwrd"&gt;where&lt;/span&gt; String.IsNullOrEmpty(p.Path) select p).Count();&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;I think that this is much cleaner and easier to read.&amp;#160;&amp;#160; Happy Linq'n!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-4803619500475441182?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/4803619500475441182/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=4803619500475441182' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/4803619500475441182'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/4803619500475441182'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2008/01/count-things-with-linq.html' title='Count things with Linq'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-1631853049786954292</id><published>2008-01-04T07:31:00.001-08:00</published><updated>2008-01-04T07:31:41.946-08:00</updated><title type='text'>Multiple Using Statements</title><content type='html'>&lt;p&gt;Using statements are used to define a scope on an object that implements the iDisposable interface.&amp;#160; It automatically calls the Dispose method on the object when it goes out of scope.&lt;/p&gt;  &lt;p&gt;Here's a neat little trick to deal with nested using statements.&amp;#160; Consider the following code snippet that has a couple of them:&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; (FileStream fs = File.Create(&lt;span class="str"&gt;&amp;quot;File.txt&amp;quot;&lt;/span&gt;))&lt;br /&gt;{&lt;br /&gt;    &lt;span class="kwrd"&gt;using&lt;/span&gt; (TextWriter tw = &lt;span class="kwrd"&gt;new&lt;/span&gt; StreamWriter(fs))&lt;br /&gt;    {&lt;br /&gt;        tw.WriteLine(&lt;span class="str"&gt;&amp;quot;The content of my file!&amp;quot;&lt;/span&gt;);&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Here's a cleaner, and in my opinion easier, way to write these.&amp;#160; Notice that the FileStream object is useable when creating the TextWriter object.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; (FileStream fs = File.Create(&lt;span class="str"&gt;&amp;quot;File.txt&amp;quot;&lt;/span&gt;))&lt;br /&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; (TextWriter tw = &lt;span class="kwrd"&gt;new&lt;/span&gt; StreamWriter(fs))&lt;br /&gt;{&lt;br /&gt;    tw.WriteLine(&lt;span class="str"&gt;&amp;quot;The content of my file!&amp;quot;&lt;/span&gt;);&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;If you are instantiating multiple objects of the same type, you could put them all on one line.&amp;#160; It is harder to read this way, but maybe that's just me. ;)&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; (StreamWriter tw1 = File.CreateText(&lt;span class="str"&gt;&amp;quot;W1&amp;quot;&lt;/span&gt;), tw2 = File.CreateText(&lt;span class="str"&gt;&amp;quot;W2&amp;quot;&lt;/span&gt;))&lt;br /&gt;{&lt;br /&gt;        tw1.WriteLine(&lt;span class="str"&gt;&amp;quot;The content of my first file!&amp;quot;&lt;/span&gt;);&lt;br /&gt;        tw2.WriteLine(&lt;span class="str"&gt;&amp;quot;The content of my second file!&amp;quot;&lt;/span&gt;);&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-1631853049786954292?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/1631853049786954292/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=1631853049786954292' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/1631853049786954292'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/1631853049786954292'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2008/01/multiple-using-statements.html' title='Multiple Using Statements'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-606183192513073628</id><published>2008-01-03T11:13:00.001-08:00</published><updated>2008-01-03T11:13:55.482-08:00</updated><title type='text'>Databinding a Generic List to a WPF ListView</title><content type='html'>&lt;p&gt;Inevitably there will come a time when you will want to start using the WPF framework for your business apps, and that means that you'll need a grid.&amp;#160; The WPF grid of choice is the ListView control.&amp;#160; &lt;/p&gt;  &lt;p&gt;The ListView control is extremely powerful, flexible and customizable.&amp;#160; It's also way complicated!&amp;#160; On the Microsoft campus, in the basement, past the closet where they hide the Steve Balmer bobble-heads and the unused copies of Microsoft BOB, from a darkened cubicle, a developer is laughing at us.&lt;/p&gt;  &lt;p&gt;Anyway, there are not a lot of examples of how to programmatically bind a generic list to a ListView control.&amp;#160; So, here's mine.&lt;/p&gt;  &lt;p&gt;First let's take a look at the class that we want to add to the collection:&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; MyNameSpace&lt;br /&gt;{&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Item&lt;br /&gt;    {&lt;br /&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Description { get; set; }&lt;br /&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Name { get; set; }&lt;br /&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; Item(&lt;span class="kwrd"&gt;string&lt;/span&gt; name, &lt;span class="kwrd"&gt;string&lt;/span&gt; description)&lt;br /&gt;        {&lt;br /&gt;            Name = name;&lt;br /&gt;            Description = description;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;It's just a simple class with a couple of public accessors.&amp;#160; Now lets turn our attention to the xaml file:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="csharpcode"&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Window&lt;/span&gt; &lt;span class="attr"&gt;x:Class&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;DMG.AnyStream.ProfileEditor.Main&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;    &lt;span class="attr"&gt;xmlns&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    &lt;span class="attr"&gt;xmlns:x&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    &lt;span class="attr"&gt;xmlns:tools&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;clr-namespace:MyNamespace;assembly=MyAssemblyName&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;    &lt;span class="attr"&gt;Title&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Sample Application&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Height&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;600&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Width&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;800&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Window.Resources&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;DataTemplate&lt;/span&gt; &lt;span class="attr"&gt;x:Key&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;NameHeader&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;StackPanel&lt;/span&gt; &lt;span class="attr"&gt;Orientation&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Horizontal&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;TextBlock&lt;/span&gt; &lt;span class="attr"&gt;Margin&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;10,0,0,0&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Name&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;VerticalAlignment&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Center&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;            &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;StackPanel&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;DataTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;DataTemplate&lt;/span&gt; &lt;span class="attr"&gt;x:Key&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;NameCell&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;DataType&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Profile&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;StackPanel&lt;/span&gt; &lt;span class="attr"&gt;Orientation&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Horizontal&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;TextBlock&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;                    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;TextBlock.Text&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;                        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Binding&lt;/span&gt; &lt;span class="attr"&gt;Path&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Name&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;                    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;TextBlock.Text&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;                &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;TextBlock&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;            &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;StackPanel&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;DataTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;DataTemplate&lt;/span&gt; &lt;span class="attr"&gt;x:Key&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;DescriptionHeader&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;StackPanel&lt;/span&gt; &lt;span class="attr"&gt;Orientation&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Horizontal&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;TextBlock&lt;/span&gt; &lt;span class="attr"&gt;Margin&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;10,0,0,0&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Description&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;VerticalAlignment&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Center&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;            &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;StackPanel&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;DataTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;DataTemplate&lt;/span&gt; &lt;span class="attr"&gt;x:Key&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;DescriptionCell&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;DataType&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Profile&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;StackPanel&lt;/span&gt; &lt;span class="attr"&gt;Orientation&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Horizontal&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;TextBlock&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;                    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;TextBlock.Text&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;                        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Binding&lt;/span&gt; &lt;span class="attr"&gt;Path&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Description&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  31:  &lt;/span&gt;                    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;TextBlock.Text&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  32:  &lt;/span&gt;                &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;TextBlock&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  33:  &lt;/span&gt;            &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;StackPanel&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  34:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;DataTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  35:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Window.Resources&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  36:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Grid&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  37:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ListView&lt;/span&gt; &lt;span class="attr"&gt;Margin&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;0,22,0,0&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;lvItems&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;ItemsSource&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;{Binding}&amp;quot;&lt;/span&gt; &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  38:  &lt;/span&gt;                  &lt;span class="attr"&gt;IsSynchronizedWithCurrentItem&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;True&amp;quot;&lt;/span&gt; &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  39:  &lt;/span&gt;                  &lt;span class="attr"&gt;SelectionMode&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Single&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  40:  &lt;/span&gt;            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ListView.View&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  41:  &lt;/span&gt;                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;GridView&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  42:  &lt;/span&gt;                    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;GridViewColumn&lt;/span&gt; &lt;span class="attr"&gt;Header&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Name&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;HeaderTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;{StaticResource NameHeader}&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;CellTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;{DynamicResource NameCell}&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Width&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;200px&amp;quot;&lt;/span&gt;  &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  43:  &lt;/span&gt;                    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;GridViewColumn&lt;/span&gt; &lt;span class="attr"&gt;Header&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;WatchFolderPath&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;HeaderTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;{StaticResource DescriptionHeader}&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;CellTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;{DynamicResource DescriptionCell}&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Width&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;400px&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  44:  &lt;/span&gt;                &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;GridView&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  45:  &lt;/span&gt;            &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ListView.View&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  46:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ListView&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  47:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Grid&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="lnum"&gt;  48:  &lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Window&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;p&gt;Take a look at line 4. If your class lives in an assembly outside of your WPF project, like mine, then you will need to add this line to declare it to the xaml. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;  &lt;p&gt;The Windows resources section starts at line six. Here, I'm just defining some templates that will tell the ListView how to present my information.&amp;#160; Without these, the control will show the results from typeof() for each item.&amp;#160; Not good.&amp;#160; Inside the &amp;quot;NameCell&amp;quot; template, I'm just creating a TextBlock control.&amp;#160; There's nothing to stop you from inserting images, checkboxes, radio buttons, etc. Inside the TextBlock, I create a new binding object and give it the name of the public accessor that I want to bind to this column.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;  &lt;p&gt;The actual ListView control starts down on line 37. Notice the GridView section starting at line 41.&amp;#160; Here is where we define our columns. All we have to do is point to the templates that we created in the Resources section.&amp;#160; You could define them here, but I think that this is cleaner.&amp;gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;  &lt;p&gt;Finally, we need to bind a list to control.&amp;#160; I do that in the code behind for the form:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Main : Window&lt;br /&gt;{&lt;br /&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; Main()&lt;br /&gt;    {&lt;br /&gt;        List&amp;lt;Item&amp;gt; items = &lt;span class="kwrd"&gt;new&lt;/span&gt; List&amp;lt;Items&amp;gt;();&lt;br /&gt;        items.add(&lt;span class="kwrd"&gt;new&lt;/span&gt; Item(&lt;span class="str"&gt;&amp;quot;Item1&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;Item1 Description&amp;quot;&lt;/span&gt;));&lt;br /&gt;        items.add(&lt;span class="kwrd"&gt;new&lt;/span&gt; Item(&lt;span class="str"&gt;&amp;quot;Item2&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;Item2 Description&amp;quot;&lt;/span&gt;));&lt;br /&gt;        items.add(&lt;span class="kwrd"&gt;new&lt;/span&gt; Item(&lt;span class="str"&gt;&amp;quot;Item3&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;Item3 Description&amp;quot;&lt;/span&gt;));&lt;br /&gt;&lt;br /&gt;        lvItems.ItemsSource = profiles;&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;  &lt;style type="text/css"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;  &lt;p&gt;It took me forever to figure this out, so I hope that it saves someone some headache and/or chest pains. I know what you are saying, &amp;quot;I only work on web apps.&amp;quot;&amp;#160; I understand that this doesn't seem that important right now, but in a recent &lt;a href="http://http://reddevnews.com/qandas/article.aspx?editorialsid=120"&gt;interview with Redmond Developer News&lt;/a&gt;, Scott Guthrie is quoted with:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;  &lt;p&gt;&amp;quot;When you look at the next public preview of Silverlight that we're doing, all of those features that are core to WPF are built-in, and there's more than just the XAML in common. You can actually take your core UI code, working with controls and databinding and things like that, and use that seamlessly in the Windows app and in the Office app and in the RIA [rich Internet application] app.&amp;quot;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;  &lt;p&gt;How's that for cool?&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;  &lt;p&gt;&lt;span class="kwrd"&gt;&lt;font color="#000000"&gt;&lt;/font&gt;&lt;/span&gt;&lt;style type="text/css"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;style type="text/css"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;/p&gt;&lt;br /&gt;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-606183192513073628?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/606183192513073628/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=606183192513073628' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/606183192513073628'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/606183192513073628'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2008/01/databinding-generic-list-to-wpf.html' title='Databinding a Generic List to a WPF ListView'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-7240135251995781914</id><published>2008-01-02T12:18:00.001-08:00</published><updated>2008-01-02T12:18:23.645-08:00</updated><title type='text'>New Year's Resolutions</title><content type='html'>&lt;p&gt;Happy New Year Kiddies!&amp;#160; Its that time again.&amp;#160; Its time to make a bunch of promises to ourselves in an attempt to justify our shortcomings from the previous year.&amp;#160; That's right, its time to lay down some New Year's Resolutions.&amp;#160; Here are some of mine.&amp;#160; Enjoy!&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Gain weight - At least I'm realistic.&lt;/li&gt;    &lt;li&gt;Eat at least 2 new animals that I haven't eaten before.&lt;/li&gt;    &lt;li&gt;Watch more TV - That one's actually a job requirement.&lt;/li&gt;    &lt;li&gt;Learn 2 new programming languages.&amp;#160; Does Linq count?&lt;/li&gt;    &lt;li&gt;Build 2 pieces of furniture from scratch.&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.photojojo.com/content/tutorials/project-365-take-a-photo-a-day/"&gt;Project 365&lt;/a&gt; - Take a picture a day for the next year. I set up a &lt;a href="http://www.flickr.com/photos/22368019@N03/sets/72157603599594406/"&gt;Flickr account just for this&lt;/a&gt;.&lt;/li&gt;    &lt;li&gt;Blog more - &lt;a href="http://www.codinghorror.com/blog/archives/000983.html"&gt;Thanks Jeff Atwood&lt;/a&gt;.&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;What &lt;strike&gt;empty&lt;/strike&gt; promises are you making yourself this year?&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-7240135251995781914?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/7240135251995781914/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=7240135251995781914' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/7240135251995781914'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/7240135251995781914'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2008/01/new-year-resolutions.html' title='New Year&amp;#39;s Resolutions'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-3878101494758055522</id><published>2007-12-06T11:00:00.001-08:00</published><updated>2007-12-06T11:00:34.977-08:00</updated><title type='text'>XslCompiledTransform - Possible Memory Leak?</title><content type='html'>&lt;p&gt;I just ran across an issue where the XslCompiledTransform object refused to die.&amp;#160; The code basically had a loop, inside of which a new XslCompiledTransform object was created and &amp;quot;applied&amp;quot; to an xml node.&amp;#160; This meant that for each iteration, I was reading the XSLT into memory.&amp;#160; &lt;/p&gt;  &lt;p&gt;You would suspect that the object would go out of scope on the next iteration, or after the completion of the loop, or even after the method returned.&amp;#160; But no!&amp;#160; This wasn't a trivial XSLT file, either, so for every 100 iterations, my application would take on another 300MB of memory.&amp;#160; I was able to crash the app on my 4GB (debatable) machine in a few minutes.&amp;#160; &lt;/p&gt;  &lt;p&gt;I know that doing things this way is a definite code smell, and I have learned from my mistake.&amp;#160; The code is now loading the transform in the constructor and using that inside the loop.&amp;#160; Since I'm not having to read in the XSLT all the time, the performance of the app has increased by at least an order of magnitude.&amp;#160; &lt;/p&gt;  &lt;p&gt;Maybe Microsoft meant for this to happen, so I wouldn't write crappy code.&amp;#160; Just thought that I would share.&amp;#160; Has anyone else experienced this?&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-3878101494758055522?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/3878101494758055522/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=3878101494758055522' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/3878101494758055522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/3878101494758055522'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2007/12/xslcompiledtransform-possible-memory.html' title='XslCompiledTransform - Possible Memory Leak?'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-8619820389464986179</id><published>2007-11-28T11:41:00.001-08:00</published><updated>2007-11-28T11:41:59.718-08:00</updated><title type='text'>DSN Query Analyzer</title><content type='html'>&lt;p&gt;The new office likes FileMaker...&amp;#160; No, seriously, they actually like it.&amp;#160; And for what they use it for, I don't really blame them.&amp;#160; &lt;/p&gt;  &lt;p&gt;It didn't take long before I needed to query some data from one of the FileMaker databases.&amp;#160; Now, there are ways to do this from inside FileMaker, but I just wanted to run a simple query.&amp;#160; &lt;/p&gt;  &lt;p&gt;Enter the &lt;a href="http://www.tucows.com/preview/501574"&gt;DSN Query Analyzer&lt;/a&gt;.&amp;#160; It is a lightweight query analyzer clone that connects to the DSN connections set up on your machine.&amp;#160; It was written by a guy in the Netherlands.&amp;#160; You can check out his &lt;a href="http://Kerschkamp.nl"&gt;website&lt;/a&gt;, if you can speak the language.&lt;/p&gt;  &lt;p&gt;One note of importance...&amp;#160; System DSN's do not save login information.&amp;#160; That would be a gigantic security hole.&amp;#160; So when you give the analyzer the name of the DSN to point to, you have to also pass in the login information.&amp;#160; Here is the syntax:&lt;/p&gt;  &lt;p&gt;MyDSNName;UIS=username;Pwd=password&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-8619820389464986179?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/8619820389464986179/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=8619820389464986179' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/8619820389464986179'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/8619820389464986179'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2007/11/dsn-query-analyzer.html' title='DSN Query Analyzer'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-1793093575249827019</id><published>2007-11-14T07:24:00.001-08:00</published><updated>2007-11-14T07:24:58.251-08:00</updated><title type='text'>Sustainable Pace</title><content type='html'>&lt;p&gt;One of the tenants of Agile development is the concept of &amp;quot;Sustainable Pace&amp;quot;.&amp;#xA0; Let me quote the &lt;a href="http://agilemanifesto.org/" target="_blank"&gt;Agile Manifesto&lt;/a&gt;:&lt;/p&gt;  &lt;p&gt;&amp;quot;Agile processes promote sustainable development. The sponsors, developers, and users should be able to maintain a constant pace indefinitely.&amp;quot;&lt;/p&gt;  &lt;p&gt;It turns out that this is just vague enough to leave it open to a wide array of interpretations.&amp;#xA0; &lt;/p&gt;  &lt;p&gt;Many, believe that this means instituting the &amp;quot;40 Hour Work Week&amp;quot;, where the team limits the amount of work that it will take on so that no one works more than forty hours per week.&amp;#xA0; Personally, I think that this is an ideal that is worth working toward, but is usually unachievable in the real world.&amp;#xA0; Part of &amp;quot;Sustainable Pace&amp;quot; isn't about how much you work, its about the ability to deliver functionality on a regular basis.&amp;#xA0; Forty hours may not be enough time to pull that off.&lt;/p&gt;  &lt;p&gt;I have seen several presenters talk about sprinting and resting.&amp;#xA0; I like this approach.&amp;#xA0; Your team would work hard for a few weeks, usually working more than 40 hours in a week, and then have an &amp;quot;off&amp;quot; week.&amp;#xA0; This doesn't mean that they get a vacation once a month.&amp;#xA0; It means that they get a week where they aren't 100% committed to the iteration and can spend time on side projects to break the monotony of it all.&amp;#xA0; Apparently, this works for many teams.&amp;#xA0; I'd think that you would need a lot of management support for this kind of thing, not to mention the personal discipline to come off the iteration.&amp;#xA0;&amp;#xA0; It is important that all employees have the time and backing for personal development.&amp;#xA0; That's the best way for a company to grow in its abilities and increase the value of its employees.&lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-1793093575249827019?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/1793093575249827019/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=1793093575249827019' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/1793093575249827019'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/1793093575249827019'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2007/11/sustainable-pace.html' title='Sustainable Pace'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-7378969168908740678</id><published>2007-11-13T06:58:00.001-08:00</published><updated>2007-11-13T06:58:01.831-08:00</updated><title type='text'>Agile Practices That are Usually Valuable</title><content type='html'>&lt;p&gt;Our team is starting to look at the principles of Agile development and it won't be long before we get into the practices.&amp;#xA0; So I thought that I would share some of the knowledge that Steve McConnell bestowed upon me in his keynote address at the Microsoft Patterns and Practices Summit last week.&lt;/p&gt;  &lt;p&gt;Steve McConnell's company &lt;a href="http://www.construx.com" target="_blank"&gt;Construx&lt;/a&gt;, has generated a report that relays their experiences with Agile practices.&amp;#xA0; The results not only come from their experience consulting and training clients (&amp;quot;approximately 1000 companies in the past 5 years&amp;quot;), but also from other published industry reports.&amp;#xA0; Steve presented the report by breaking down the practices into 3 categories:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Agile practices that are usually valuable&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Short Release Cycles&lt;/li&gt;    &lt;li&gt;Highly Interactive Release Planning&lt;/li&gt;    &lt;li&gt;Timebox Development&lt;/li&gt;    &lt;li&gt;Empowered, Small, Cross-Functional Teams'&lt;/li&gt;    &lt;li&gt;Involvement of Active Management&lt;/li&gt;    &lt;li&gt;Coding Standards&lt;/li&gt;    &lt;li&gt;Frequent Integration and Test&lt;/li&gt;    &lt;li&gt;Automated Regression Tests&lt;/li&gt;    &lt;li&gt;Retrospectives at End of Each Release&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Agile practices that have been hit or miss&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Customer-Provided Acceptance Tests&lt;/li&gt;    &lt;li&gt;Daily Stand-up Meetings&lt;/li&gt;    &lt;li&gt;Simple Design&lt;/li&gt;    &lt;li&gt;Test-First Development&lt;/li&gt;    &lt;li&gt;40-Hour Work Week&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Agile practices that tend to be problematic&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;System Metaphor&lt;/li&gt;    &lt;li&gt;On-Site Customer&lt;/li&gt;    &lt;li&gt;Collective Code Ownership&lt;/li&gt;    &lt;li&gt;Pair Programming&lt;/li&gt;    &lt;li&gt;Refactoring&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;I can see at least one practice that my department is trending toward in the &amp;quot;Problematic&amp;quot; list.&amp;#xA0; This could be &amp;quot;problematic&amp;quot; going forward. :) &lt;/p&gt;  &lt;p&gt;Anyway, I encourage you to post your reactions to this list via the comments.&amp;#xA0; I'd like to know what experiences you guys have had with these practices. Also, if you would like more information about their reasoning for placing a certain practice into a certain category, I'd be happy to oblige.&lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-7378969168908740678?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/7378969168908740678/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=7378969168908740678' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/7378969168908740678'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/7378969168908740678'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2007/11/agile-practices-that-are-usually.html' title='Agile Practices That are Usually Valuable'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-8152660184289382498</id><published>2007-11-12T05:55:00.001-08:00</published><updated>2007-11-12T05:55:02.159-08:00</updated><title type='text'>Microsoft Patterns and Practices Conference - Day Five</title><content type='html'>&lt;p&gt;The last day of the conference was labeled &amp;quot;Applications&amp;quot;.&amp;#xA0; This, of course, was a pretty loose title.&amp;#xA0; However, I think that this was one of my favorite days.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Keynote - Scott Hanselman&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Hanselman delivers once again.&amp;#xA0; This wasn't a technology related keynote.&amp;#xA0; Instead Scott discussed how he came to be employed by Microsoft.&amp;#xA0; There must have been a lot of money involved.&amp;#xA0; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Future of patterns &amp;amp; practices - Rick Maguire&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Rick is &amp;quot;the man&amp;quot; when it comes to the Pattern's and Practices Group, &amp;quot;the trusted source of application development guidance for the Microsoft platform&amp;quot;.&amp;#xA0; Rick gave a high level overview of where the group was heading in the future.&amp;#xA0; Here are their goals for the future:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Simplify the Microsoft Application Platform&lt;/li&gt;    &lt;li&gt;Provide solutions/guidance to your problems&lt;/li&gt;    &lt;li&gt;Help you learn and grow&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Evolving Client Architecture - Billy Hollis&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Billy Hollis gave an interesting talk on how the types of things that we are developing is changing.&amp;#xA0; He showed that the move to SOA will force us to become better UI designers.&amp;#xA0; Right now, if our UI sucks, the users don't have a lot of choice except to use it.&amp;#xA0; In the future, some one else could build a better one on top of an exposed service.&amp;#xA0; This was a good set up for his later talk about software complexity.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Fresh Cracked CAB - Ward Bell&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Ward reminds me of someone that I used to work with.&amp;#xA0; It was a good presentation on Microsoft's Composite UI Application Block (CAB), which is a windows smart client technology.&amp;#xA0; A lot of the of patterns could be converted to ASP.NET with a little work.&amp;#xA0; Ward basically showed how to use one of Microsoft's application blocks to quickly build and extend a window smart client.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Software Complexity - Billy Hollis&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Billy Hollis is my new hero.&amp;#xA0; He shared some of his &amp;quot;outside the box&amp;quot; thoughts on software complexity and the need for simplicity in an increasingly complex technological landscape.&amp;#xA0; He boldly asserted that instead of making our lives simpler, Microsoft is killing us with complexity as it releases more and more technologies at a pace that no one can keep up with.&amp;#xA0; Kudos to the Microsoft employees, who had several chances to tackle him and drag him off the stage, yet some how kept their composure.&amp;#xA0; The talk can really be summed up by Billy's &amp;quot;Simplicity Manifesto V1.0&amp;quot;:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Stop adding features&lt;/li&gt;    &lt;li&gt;Make help helpful&lt;/li&gt;    &lt;li&gt;Fix the bugs&lt;/li&gt;    &lt;li&gt;CRUD for free&lt;/li&gt;    &lt;li&gt;Hide the plumbing&lt;/li&gt;    &lt;li&gt;Get better names&lt;/li&gt; &lt;/ul&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-8152660184289382498?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/8152660184289382498/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=8152660184289382498' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/8152660184289382498'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/8152660184289382498'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2007/11/microsoft-patterns-and-practices_12.html' title='Microsoft Patterns and Practices Conference - Day Five'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-5964764211099827135</id><published>2007-11-08T22:53:00.001-08:00</published><updated>2007-11-08T22:53:17.543-08:00</updated><title type='text'>Microsoft Patterns and Practices Conference - Day Four</title><content type='html'>&lt;p&gt;Today's topic was &amp;quot;Software Factories&amp;quot;, but it should have been titled &amp;quot;A bunch of stuff that you'll need VSTS to use&amp;quot;. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Keynote - Scott Hanselman&lt;/strong&gt; &lt;/p&gt;  &lt;p&gt;Scott delivered a great presentation on the MVC framework that Microsoft is currently working on.&amp;#xA0; He went over the plusses of using the framework, like how it provides for clean separation of concerns and how it is extensible and pluggable. We even got a chance to see it in action in Visual Studio.&amp;#xA0; The framework won't require VSTS and will probably become a very handy development tool.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Domain-Specific Development with VS DSL Tools - Gareth Jones &lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;This talk was about how to build a domain specific language using the graphical modeler in Visual Studio.&amp;#xA0; What it really boils down to is &amp;quot;How to generate a Modeling Language, using the graphical modeling language in VSTS.&amp;quot;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Patterns of Software Factories - Wojtek Kozaczynski &lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Wojtek went through the Software Factories that the Patterns &amp;amp; Practices group has released and reported some of the common patterns that he found.&amp;#xA0; Kind of dry stuff that I won't be using anytime soon.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Building Services...Service Factory: Modeling Edition - Bob Brumfield, Ade Miller &lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Here, we were shown how to use a software factory to generate a modeler that will then generate some code.&amp;#xA0; Once again, this is a VSTS thing.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Web Client Guidance: Web Client Software Factory - Michael Puleio, Chris Tavares &amp;amp; Blaine Wastell &lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;This was a good discussion of the P&amp;amp;P group's Web Client Guidance.&amp;#xA0; I've not before seen a simpler and easier to understand diagram that showed the difference between the Model View Presenter pattern and the Model View Controller pattern.&amp;#xA0; You don't need VSTS to use the guidance bits.&amp;#xA0; Expect more blog posts about this one.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Using Team Factories - David Trowbridge &lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Yet another Team System oriented talk.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Build your own Software Factory - Wojtek Kozaczynski, Bob Brumfield, Ade Miller&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;I've got to admit that this talk was way over my head.&amp;#xA0; From what I gathered, basically went through what it took to generate the software factories that they have released.&amp;#xA0; I guess there's a reason that they make the big bucks.&lt;/p&gt;  &lt;p&gt;Tomorrow is the last day of the conference and will be dedicated to &amp;quot;Applications&amp;quot;.&amp;#xA0; Scott Hanselman will give another keynote. &lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-5964764211099827135?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/5964764211099827135/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=5964764211099827135' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/5964764211099827135'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/5964764211099827135'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2007/11/microsoft-patterns-and-practices_08.html' title='Microsoft Patterns and Practices Conference - Day Four'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-674551860507249604</id><published>2007-11-07T21:31:00.001-08:00</published><updated>2007-11-07T21:31:46.313-08:00</updated><title type='text'>Microsoft Patterns and Practices Conference - Day Three</title><content type='html'>&lt;p&gt;Today's theme was &amp;quot;Development&amp;quot;, but I'm not really sure that was what we talked about for most of the day.&amp;#xA0; There were some good talks, here's more about them:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Keynote - John Lam&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;John Lam's presentation, for the most part, centered around IronRuby.&amp;#xA0; He ran a good code demo inside the ironruby version of irb, on mono, in a linux vm on his mac.&amp;#xA0; I know, its weird to see a Microsoft employee working off a Mac. But John was not the only presenter doing so.&amp;#xA0; There was an especially exciting demo of using Ruby to dynamically generate Silverlight objects.&amp;#xA0; Currently, this is hard to do in C#.&amp;#xA0; I think that it is really great that IronRuby is a fully open source project that accepts contributions from outside developers.&amp;#xA0; The team uses Subversion for the code repository and hosts the bits on &lt;a href="http://rubyforge.org/projects/ironruby/" target="_blank"&gt;RubyForge&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The Right Tools for the Right Job - Rocky Lhotka&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Rocky started off by reminding us that Object-Oriented Design isn't dead.&amp;#xA0; He gave a in depth comparison of the strengths and weaknesses of OO, SOA, and Workflow design.&amp;#xA0; It was really enlightening to see his take that your can see aspects of OOP in all of these design architectures.&amp;#xA0; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Model Based Design - David Trowbridge&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;This turned out to be a demonstration of how to use the class builder, and some new modeling interfaces, to generate code.&amp;#xA0; It's a shame that we will need Team System Architecure edition to actualize any of the examples.&amp;#xA0; Maybe our team can win the lottery one day.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Dependency Injection Frameworks - Peter Provost, Scott Densmore&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Have you ever wanted to know how to roll your own Dependency Injection into your application?&amp;#xA0; I thought I did.&amp;#xA0; Sure, it was very interesting.&amp;#xA0; However, if they were pitching it for my application, I'd have gone out and bought a license for typemock by the second example.&amp;#xA0; Let's just say there is a lot of work that Typemock(or other mocking frameworks) do for you automatically.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Designing for Workflow - Ted Neward&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Once again, Ted delivers a great presentation, full of poignant wit.&amp;#xA0; Ted makes the argument that Workflow, as we know it in the realm of recent Microsoft tools, hasn't really been around long enough for us to declare any best practices.&amp;#xA0; Of course he offers his point of view, which left no time for the audience to chime in.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Panel: The Future of Design Patterns - Dragos Manolescu, Wojtek Kozaczynski, Ade Miller, Jason Hogg&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;This was strange.&amp;#xA0; They gave the guys on the panel toy guns that shot little foam discs so they could shoot each other when they were in disagreement.&amp;#xA0; They then discussed the failure of a patterns web site and debated whether we should be generating more documentation and collaboration around patterns or whether we should just build them into development tools.&amp;#xA0; I like the gun idea, no pattern or practice would truly be complete without firearms.&amp;#xA0; I think I'll try it out at our next team meeting.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;EntLib Devolved - Scott Densmore&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;EntLib is short for Enterprise Library. Entlib is a collection of general purpose application blocks addressing enterprise scenarios. For example, there is an application block for logging.&amp;#xA0; Scott Densmore, one of the developers, gave a quick overview of the blocks and elicited feedback from those that had used it.&amp;#xA0; I have never used it, but it looks cool.&lt;/p&gt;  &lt;p&gt;So, tomorrow's theme is &amp;quot;Software Factories&amp;quot; and the keynote is by Scott Hanselman.&amp;#xA0; It should be a very interesting day!&amp;#xA0; &lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-674551860507249604?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/674551860507249604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=674551860507249604' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/674551860507249604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/674551860507249604'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2007/11/microsoft-patterns-and-practices_07.html' title='Microsoft Patterns and Practices Conference - Day Three'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-7048153397741639148</id><published>2007-11-06T21:46:00.001-08:00</published><updated>2007-11-06T21:46:55.404-08:00</updated><title type='text'>Microsoft Patterns and Practices Conference - Day Two</title><content type='html'>&lt;p&gt;Today was dedicated to Agile practices and Methodologies.&amp;#xA0; Here's a rundown of the talks.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Keynote - Steve McConnell&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Steve provided a wonderful overview of the Agile methodology.&amp;#xA0; He went into a lot of detail about the agile practices and relied on his companies experiences to rate them based on how they work in the real world.&amp;#xA0; For example, short release cycle tend to work very well, while pair programming tends to be problematic. The jet lag hit me pretty hard this morning and Steve is a soft speaker, but it was really interesting.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Agile is more than monkey-see-monkey-do - Peter Provost&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;First off, Peter Provost is very engaging speaker that highly encourages audience participation.&amp;#xA0; I highly recommend watching one of his presentations.&amp;#xA0; This one started as a comparison of two fictitious companies and how they implemented Agile methodology. One with great success and one with terrible tragedy. It then moved onto how teams can figure out how to implement agile practices.&amp;#xA0; He also spent a good amount of time discussing how to get a team that has strayed back to the agile path.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Empirical Evidence of Agile Methods - Grigori Melnick&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Grigori tried to show that there are actually people out there using agile methods.&amp;#xA0; Apparently, there isn't must documented evidence.&amp;#xA0; The topic by its very definition is pretty dry.&amp;#xA0; That's all I have to say about that.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;What's new in Rosario process templates? - Alan Riddlhoover&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Alan gave an informative, but extremely slow paced presentation on the new features found in the next version of Visual Studio Team System.    &lt;br /&gt;It looks like they have a replacement for Caliber that integrates with MS Project.&amp;#xA0; Our team doesn't have VSTS, so a lot of the stuff that was demo'd won't really matter.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Lessons Learned in Unit Testing - Jim Newkirk&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Now this was a good talk.&amp;#xA0; Jim is one of the original authors of NUnit and has now moved on to run &lt;a href="http://www.codeplex.com/"&gt;Codeplex&lt;/a&gt;. In his talk, Jim relays 7 lessons that he has learned over his 8+ years of doing unit testing.&amp;#xA0; The lessons are listed below.&amp;#xA0; &lt;/p&gt;  &lt;p&gt;Lesson #1 - Just Do It    &lt;br /&gt;Lesson #2 - Write Tests using the 3A Pattern(Arrange, Act, Assert)     &lt;br /&gt;Lesson #3 - Keep your tests close     &lt;br /&gt;Lesson #4 - Use Alternatives to ExpectedException     &lt;br /&gt;Lesson #5 - Small Fixtures     &lt;br /&gt;Lesson #6 - Don't use Setup and TearDown     &lt;br /&gt;Lesson #7 - Improve Testability with Inversion of Control&lt;/p&gt;  &lt;p&gt;Some of the stuff he was talking about seems to go against what I've been learning from the internet and architecture.&amp;#xA0; I'm hoping to talk with Jim tomorrow to get some more insight.&amp;#xA0; Expect more in the future.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The Agile Security Development Lifecycle - David LeBlanc&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;David stressed the importance of considering security from the beginning of a project's SDLC.&amp;#xA0; He stressed that developers on an agile team need to be educated about security. &amp;quot;If they understand what a security mistake looks like, they are less likely to put it into the code.&amp;quot;&amp;#xA0; He also pointed out how some of the agile practices enhance security.&amp;#xA0; For example, Peer Programming is not only effective for finding bugs but also for finding security issues.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&amp;quot;Yet Another Agile Talk on Agility&amp;quot; - Peter Provost&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Peter ran this talk like an agile project.&amp;#xA0; There were 4, fifteen minute iterations where the first five minutes where used to gather issues about Agile that the audience was interested in and prioritize them.&amp;#xA0; The next ten minutes where dedicated to tackling the issues/questions based on their priority.&amp;#xA0; When the next iteration came around, we were given the ability to add new questions and re-prioritize them with the rest of the open questions.&amp;#xA0; Peter kept a count down timer running on the big screen to make sure that we stuck to the schedule.&amp;#xA0; It really drew you into the conversation and was a lot of fun.&lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;Tomorrow looks like a good day.&amp;#xA0; It will be dedicated to development and the keynote speaker will be John Lam of IronPython fame.&amp;#xA0; Night, night for now kiddies.&lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-7048153397741639148?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/7048153397741639148/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=7048153397741639148' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/7048153397741639148'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/7048153397741639148'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2007/11/microsoft-patterns-and-practices_06.html' title='Microsoft Patterns and Practices Conference - Day Two'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-1950508510364009146</id><published>2007-11-05T23:11:00.001-08:00</published><updated>2007-11-05T23:12:29.056-08:00</updated><title type='text'>Microsoft Patterns and Practices Conference - Day One</title><content type='html'>&lt;p&gt;All this week, I and a few of my cohorts are attending a Patterns &amp;amp; Practices summit in Redmond.&amp;#xA0; I'll be giving a breakdown of the sessions this week and will go into more detail in future posts about the topics that I find most interesting.&lt;/p&gt;  &lt;p&gt;Here is a quick breakdown of the topics and speakers, each followed by a brief description.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Keynote - Anders Hejlsberg&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;This wasn't as much a keynote address as it was a LINQ demo.&amp;#xA0; Anders is awesome and gave a great and detailed demonstration.&amp;#xA0; You can expect a lot more about this one in future posts.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;A Software Patterns Study - Dragos Manolescu&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;This wasn't what I expected.&amp;#xA0; Apparently this guy did a survey about Patterns and how much they were used in current enterprises.&amp;#xA0; It turned out to be a plea for help from the community to help build a modern platform for collaboration on patterns.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Architecture of the Microsoft ESB Guidance - Marty Masznicky&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;I didn't get a lot from this talk because it was all about extensions for BizTalk, which I have zero experience with.&amp;#xA0; However, I will give the speaker credit for giving an hour long presentation with gauze stuffed into one of his cheeks.&amp;#xA0; Don't ask.&amp;#xA0; Sadly, I couldn't conjecture what ESB stood for until halfway through the presentation when the guy in front of me Googled it.&amp;#xA0; ESB stands for Enterprise Service Bus and provides a way to do a lot of stuff that should have been integrated into Biztalk by default. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Pragmatic Architecture - Ted Neward&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Ted is a excellent speaker with a great sense of humor.&amp;#xA0; He spoke about our need to be able to determine the best architecture for our solutions.&amp;#xA0; Apparently, not every architecture solution is right for all applications.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Architecting a Scalable Platform - Chris Brown&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;This was an interesting look at building globally scalable applications.&amp;#xA0; We're talking things like Amazon.com.&amp;#xA0; Global level scalability relies on horizontal scaling.&amp;#xA0; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Grid Security - Jason Hogg&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Jason gave a great talk about the Security Policy Assertion Language (SecPAL).&amp;#xA0; SecPAL was designed to address security for large scale applications, such as computing grids.&amp;#xA0; The security rules are easily read as English sentences with a restricted grammar.&amp;#xA0; You can &lt;a href="http://research.microsoft.com/projects/secpal/"&gt;find out more here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Moving Beyond Industrial Software - Harry Pierson&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Harry talked about the Industrial age's influence on modern programming.&amp;#xA0; Just as the Industrial age has given way to a new information age, so our programming methodologies must give way to something more practical.&amp;#xA0; The main point of his talk was that things that are simple and empower the users will be the applications of the future.&lt;/p&gt;  &lt;p&gt;Well kids, that's all for now.&amp;#xA0; See you tomorrow.&lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-1950508510364009146?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/1950508510364009146/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=1950508510364009146' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/1950508510364009146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/1950508510364009146'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2007/11/microsoft-patterns-and-practices.html' title='Microsoft Patterns and Practices Conference - Day One'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-9058237302227484574</id><published>2007-09-07T09:59:00.003-07:00</published><updated>2007-09-07T09:59:36.728-07:00</updated><title type='text'>Being a better developer</title><content type='html'>&lt;p&gt;I know what you're saying, "Yo Mack!, why you no post?"&amp;nbsp; Well, that's a tough one to answer.&amp;nbsp; Let's just say that I'm lazy.&amp;nbsp; &lt;/p&gt; &lt;p&gt;Today I'll be responding to the uber blog meme on what I will do over the next 6 months to become a better programmer.&amp;nbsp; I know a lot of folks don't like "list" posts.&amp;nbsp; To them I say, just be glad I'm not numbering them.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Pick up a new OS&lt;/strong&gt; - I feel that this is very important as more and more of our user base is moving from Windows to something else.&amp;nbsp; I have chosen Linux, &lt;a href="http://www.ubuntu.com/"&gt;Ubuntu&lt;/a&gt; specifically.&amp;nbsp; I chose this over a&amp;nbsp;Mac for several reasons.&amp;nbsp; It's more accessible to me, it appeals more to&amp;nbsp;my techy/nerdy&amp;nbsp;side, and we all know what happened to Mac at the end of &lt;a href="http://www.imdb.com/gallery/ss/0263488/Ss/0263488/J-97.jpg.html?path=gallery&amp;amp;path_key=0263488"&gt;Jeepers Creepers&lt;/a&gt;.&amp;nbsp; &lt;/p&gt; &lt;p&gt;&lt;strong&gt;Learn a cross platform language&lt;/strong&gt; - Once again with the cross platform thing. Here I'm going with &lt;a href="http://www.ruby-lang.org/en/"&gt;Ruby&lt;/a&gt;. It is elegant and has a lot of great features.&amp;nbsp; Microsoft if also writing a .Net version, &lt;a href="http://blogs.msdn.com/pandrew/archive/2007/07/23/microsoft-releases-pre-alpha-ironruby-including-source.aspx"&gt;IronRuby&lt;/a&gt;,&amp;nbsp;that will be useful in Silverlight development.&amp;nbsp; I'm hoping to create a few cross platform applications, not web apps, that will actually be useful.&amp;nbsp; I'll let you know how it goes.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Linq, Linq, Linq&lt;/strong&gt; - Seriously folks, this is where its at.&amp;nbsp; I've been taking the &lt;a href="http://www.albahari.com/linqpad.html"&gt;LinqPad Challenge&lt;/a&gt; for the last couple of weeks and plan to continue for the next few months. It's great, I'm actually getting a handle on Linq to SQL queries.&amp;nbsp; Let's take the challenge together, shall we?&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Presentations&lt;/strong&gt; - I am admittedly the worst presenter/public speaker that I can imagine.&amp;nbsp; &lt;a href="http://www.youtube.com/watch?v=WALIARHHLII"&gt;Miss South Carolina&lt;/a&gt; has me beat, hands down.&amp;nbsp; However, I find a way to do it anyway.&amp;nbsp; Presenting increases your communication skills, boosts your confidence and is a great way to trick your peers into thinking that you actually know what you're doing.&amp;nbsp; I'm planning on doing some research on presenting skills and applying them more often.&amp;nbsp;I'm even looking into doing a screencast or two.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;GTD&lt;/strong&gt; - I'm a big proponent of Life Hacking.&amp;nbsp; So I'm going to continue finding great ways to save time.&amp;nbsp; I can tell you from personal experience that hacks like Merlin Mann's &lt;a href="http://www.43folders.com/izero/"&gt;Inbox Zero&lt;/a&gt;&amp;nbsp;can really save you time and peace of mind.&lt;/p&gt; &lt;p&gt;This isn't a comprehensive list, but it is stuff that I think is important.&amp;nbsp; What things will you be doing to become a better developer over the next few months?&amp;nbsp; I'll check in with you next year.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-9058237302227484574?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/9058237302227484574/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=9058237302227484574' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/9058237302227484574'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/9058237302227484574'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2007/09/being-better-developer.html' title='Being a better developer'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-3475006637527416741</id><published>2007-06-01T06:05:00.001-07:00</published><updated>2007-06-01T06:17:04.189-07:00</updated><title type='text'>Spell Check in PowerShell</title><content type='html'>&lt;p&gt;If you are like me, you do a lot of work in simple text editors.  I'd take a sleek, versatile and fast Notepad2 over a bulky Word instance any day.   So have you ever typed in a word and it looked funny?  Did you spell that correctly?  Well, you could open up Word and wait for it to come up and then use it's spell checker.  Or, you could bring up a browser and use one of many sites that will check.  My machine runs at a speed somewhere between sloth and slug.  So if I don't already have one of those apps open, I'll use up my squirrel sized attention span and forget why I opened them in the first place.  &lt;/p&gt;&lt;p&gt;I always have a PowerShell instance running.  Wouldn't it be cool to test my funny looking word with a script.  I'd used the &lt;a href="www.loresoft.com/NetSpell/"&gt;NETSpell&lt;/a&gt; library on one of my previous projects and thought that it would be easier to access than Google's api.  So what I ended up with was a good example of how to wrap a PowerShell script around an existing class library.&lt;/p&gt;&lt;p&gt;Here's the script:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;###############################################################&lt;/span&gt;&lt;br /&gt;&lt;span class="rem"&gt;###  &lt;/span&gt;&lt;br /&gt;&lt;span class="rem"&gt;###  Spell.ps1 - Allen Mack 6/1/2007&lt;/span&gt;&lt;br /&gt;&lt;span class="rem"&gt;###&lt;/span&gt;&lt;br /&gt;&lt;span class="rem"&gt;###  This script takes the first argument passed to it and &lt;/span&gt;&lt;br /&gt;&lt;span class="rem"&gt;###  runs it through the NETSpell spell checker.&lt;/span&gt;&lt;br /&gt;&lt;span class="rem"&gt;###&lt;/span&gt;&lt;br /&gt;&lt;span class="rem"&gt;###############################################################&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;[System.Reflection.Assembly]::loadfrom(&lt;span class="str"&gt;"c:\Program Files\NetSpell\bin\NetSpell.SpellChecker.DLL"&lt;/span&gt;)  Out-Null&lt;br /&gt;&lt;br /&gt;$checker = New-Object NetSpell.SpellChecker.Spelling&lt;br /&gt;$checker.Dictionary.DictionaryFolder = "c:\PowershellScripts"&lt;br /&gt;&lt;br /&gt;$word = $args[0]&lt;br /&gt;&lt;br /&gt;$result = $checker.TestWord($word)&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;if&lt;/span&gt;($result &lt;span class="preproc"&gt;-eq&lt;/span&gt; $true)&lt;br /&gt;{  &lt;br /&gt;    Write-Output(&lt;span class="str"&gt;"`"&lt;/span&gt;&lt;span class="str"&gt;" + $word + "&lt;/span&gt;`&lt;span class="str"&gt;" is spelled correctly."&lt;/span&gt;)&lt;br /&gt;}&lt;br /&gt;&lt;span class="kwrd"&gt;else&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;    Write-Output(&lt;span class="str"&gt;"`"&lt;/span&gt;&lt;span class="str"&gt;" + $word + "&lt;/span&gt;`&lt;span class="str"&gt;" is spelled incorrectly."&lt;/span&gt;)&lt;br /&gt;    Write-Output(&lt;span class="str"&gt;"Maybe you meant:"&lt;/span&gt;)&lt;br /&gt;    $checker.Suggest($word)&lt;br /&gt;    $checker.Suggestions&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt; font-size: small;&lt;br /&gt; color: black;&lt;br /&gt; font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt; background-color: #ffffff;&lt;br /&gt; /*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt&lt;br /&gt;{&lt;br /&gt; background-color: #f4f4f4;&lt;br /&gt; width: 100%;&lt;br /&gt; margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The first thing to do is load the dll into memory. Next we create a Spelling object and point it to the directory where our dictionary lives. I copied the dictionary file to the same directory as the script.  You could point it to the NETSpell installation directory.  If the word is spelled correctly, I print out a message saying so.  If the word is spelled incorrectly, I display the array of suggestions generated by the Spelling object.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-3475006637527416741?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/3475006637527416741/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=3475006637527416741' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/3475006637527416741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/3475006637527416741'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2007/06/spell-check-in-powershell.html' title='Spell Check in PowerShell'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-117286161488487475</id><published>2007-03-02T10:53:00.000-08:00</published><updated>2007-03-08T04:52:59.580-08:00</updated><title type='text'>Powershell FizzBuzz One-liner</title><content type='html'>&lt;p&gt;I know, I know, the FizzBuzz problem isn't about the implementation.  However, I've seen implementations in C#, Java, Python, Perl, Ruby, yada, yada, yada.  Well, I haven't seen one in Powershell, so I'm posting it here.  Not for implementation's sake, because I'm sure that there is a better way to implement it.  I'm putting it here for the sake of fairness. &lt;/p&gt;&lt;p&gt;1..100  ForEach-Object { $str = ""; if($_ % 3 -eq 0) { $str += "Fizz" }; if($_ % 5 -eq 0) { $str += "Buzz" }; if(($_ % 3 -ne 0) -and ($_ % 5 -ne 0)) { $str += $_ }; Write-Output $str }&lt;/p&gt;&lt;p&gt;3/8/2008 - Thanks to Scott for pointing out a typo in the script.  It's fixed now.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-117286161488487475?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/117286161488487475/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=117286161488487475' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/117286161488487475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/117286161488487475'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2007/03/powershell-fizzbuzz-one-liner.html' title='Powershell FizzBuzz One-liner'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-117260032822711529</id><published>2007-02-27T10:18:00.000-08:00</published><updated>2007-02-27T10:20:53.490-08:00</updated><title type='text'>I could have died...</title><content type='html'>&lt;p&gt;That's right, I could have died last weekend.&amp;nbsp; I had a high blood pressure attack on Friday night which caused tingling in my extremeties and pain in my left arm.&amp;nbsp; Now, when&amp;nbsp;many people&amp;nbsp;experience these kinds of symptoms, their life flashes before their eyes.&amp;nbsp; I, on the other hand, began to worry about my current level of term life insurance and how I can increase my coverage.&amp;nbsp;&amp;nbsp; I'm lucky to have a brother that works in a doctor's office and he had me check my blood pressure.&lt;/p&gt; &lt;p&gt;I also suffer from white-coat syndrome.&amp;nbsp; Its a pre-existing condition.&amp;nbsp; That means that if I see someone in a white lab coat coming at me, my blood pressure skyrockets.&amp;nbsp; So you can only imagine what it did when I felt under-insured.&amp;nbsp; When I got to the doctor the next day, I told her what my bp was the night before and she stuck her pen in her pocket and took three steps back.&amp;nbsp; Apparently, I was lucky.&amp;nbsp; The slightest knick could have caused an explosion so violent that we would never be able to sell the house.&amp;nbsp; &lt;/p&gt; &lt;p&gt;On a side note, I think that I have passed the white coat syndrome to my son.&amp;nbsp; He freaks out when he sees the pharmacist at Publix, not to mention his pediatrician.&lt;/p&gt; &lt;p&gt;So here's the really funny part.&amp;nbsp; I had to have a Venus Dopplar scan on my arm.&amp;nbsp; Sounds impressive, doesn't it.&amp;nbsp; Well actually... no.&amp;nbsp; Its the same machine that they use to perform ultrasounds on pregnant women, goop and all.&amp;nbsp; Ask any woman whose been pregnant in the last 20 years and she'll tell you about the goop.&amp;nbsp;&lt;/p&gt; &lt;p&gt;I was&amp;nbsp;escorted back to this little&amp;nbsp;room in the back of radiology by a seemingly pleasant woman named Maria.&amp;nbsp; The name took&amp;nbsp;me by surprise as I&amp;nbsp;tend to think of it as having a mostly latin descent.&amp;nbsp;&amp;nbsp;Maria,&amp;nbsp;however, looked&amp;nbsp;like she came from Khazakhstan and her dialect seemed to match.&amp;nbsp; I had to lay down and get gooped from my next down to my wrist.&amp;nbsp; My wife found this very amusing and considered it some sort of karmic payback for all the ultrasounds that she had to go through. &lt;/p&gt; &lt;p&gt;So then&amp;nbsp;Maria says, "I poke you now,&amp;nbsp; okaaay.", in her Khazakhstanny idiom.&amp;nbsp;&amp;nbsp;At the time I couldn't&amp;nbsp;fathom a response.&amp;nbsp; Seriously,&amp;nbsp;what are you supposed to say in these situations?&amp;nbsp; "Oh, a poking?&amp;nbsp; That sounds nice.&amp;nbsp; Thanks Maria!"&amp;nbsp; And so the poking commensed.&amp;nbsp; After about the third poke, I got up enough courage to ask, "Why are you poking me?"&amp;nbsp; Maria came back with a "I collapse your veins."&amp;nbsp; My first thought was, "What!?!", but then I thought "What?!?"&amp;nbsp; Maria went on to explain that her seemingly desctructive poking was merely a test to verify that my veins would pop back.&amp;nbsp; Of course they did, and it filled me with a sense of resiliency.&amp;nbsp; On the other hand, if they had not popped back, I could have died.&amp;nbsp; Good thing I was already in a hospital.&amp;nbsp; Of all the places to have a near death experience, I think that the hospital is at least in my top 5.&lt;/p&gt; &lt;p&gt;And so I made it through ok with no obvious issues and without having to use the "wand".&amp;nbsp; Once again, ask a pregnant woman. :)&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-117260032822711529?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/117260032822711529/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=117260032822711529' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/117260032822711529'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/117260032822711529'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2007/02/i-could-have-died.html' title='I could have died...'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-117224513532003288</id><published>2007-02-23T07:38:00.000-08:00</published><updated>2007-02-23T07:38:56.266-08:00</updated><title type='text'>IEEE defined Code of Ethics for Software Engineers</title><content type='html'>&lt;p&gt;After listening to &lt;a title="Steve McConnell's talk on the last dotNetRocks" href="http://www.dotnetrocks.com/default.aspx?showNum=215"&gt;Steve McConnell's talk on the last dotNetRocks&lt;/a&gt;, I decided to quickly look into the &lt;a title="IEEE Software Engineer Certification Program" href="http://www.computer.org/portal/site/ieeecs/menuitem.c5efb9b8ade9096b8a9ca0108bcd45f3/index.jsp?&amp;amp;pName=ieeecs_level1&amp;amp;path=ieeecs/education/certification&amp;amp;file=index.xml&amp;amp;xsl=generic.xsl&amp;amp;"&gt;IEEE Software Engineer Certification Program&lt;/a&gt;.&amp;nbsp; Its&amp;nbsp;a little more indepth than I have time for right now and I'm not sure that I meet all the requirements for application.&amp;nbsp; However, I did stumble their &lt;a title="Software Engineering Code of Ethics and Professional Practice" href="http://www.computer.org/portal/site/ieeecs/menuitem.c5efb9b8ade9096b8a9ca0108bcd45f3/index.jsp?&amp;amp;pName=ieeecs_level1&amp;amp;path=ieeecs/education/certification&amp;amp;file=ethics.xml&amp;amp;xsl=generic.xsl&amp;amp;"&gt;Software Engineering Code of Ethics and Professional Practice&lt;/a&gt;.&amp;nbsp; It is aimed at making the software develop a respected profession.&amp;nbsp; I, of course, am lacking in several areas.&amp;nbsp; Here is the short version:&lt;/p&gt; &lt;p&gt;&lt;em&gt;Software engineers shall commit themselves to making the analysis, specification, design, development, testing and maintenance of software a beneficial and respected profession. In accordance with their commitment to the health, safety and welfare of the public, software engineers shall adhere to the following Eight Principles:&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;em&gt;1. PUBLIC - Software engineers shall act consistently with the public interest.&lt;/em&gt; &lt;p&gt;&lt;em&gt;2. CLIENT AND EMPLOYER - Software engineers shall act in a manner that is in the best interests of their client and employer consistent with the public interest.&lt;/em&gt; &lt;p&gt;&lt;em&gt;3. PRODUCT - Software engineers shall ensure that their products and related modifications meet the highest professional standards possible.&lt;/em&gt; &lt;p&gt;&lt;em&gt;4. JUDGMENT - Software engineers shall maintain integrity and independence in their professional judgment.&lt;/em&gt; &lt;p&gt;&lt;em&gt;5. MANAGEMENT - Software engineering managers and leaders shall subscribe to and promote an ethical approach to the management of software development and maintenance.&lt;/em&gt; &lt;p&gt;&lt;em&gt;6. PROFESSION - Software engineers shall advance the integrity and reputation of the profession consistent with the public interest.&lt;/em&gt; &lt;p&gt;&lt;em&gt;7. COLLEAGUES - Software engineers shall be fair to and supportive of their colleagues.&lt;/em&gt; &lt;p&gt;&lt;em&gt;8. SELF - Software engineers shall participate in lifelong learning regarding the practice of their profession and shall promote an ethical approach to the practice of the profession.&lt;/em&gt; &lt;p&gt;I think that this is a great document that a lot of software development teams could adopt and reap some benefits.&amp;nbsp; I'm lucky to be on a team that already embraces most of these principals.&amp;nbsp; We are fair to and supportive of each other.&amp;nbsp; We all participate in lifelong learning and are constantly challenging ourselves.&amp;nbsp; Some of us even care about the safety and welfare of the general public.&amp;nbsp;&amp;nbsp; However, like most us, I've also worked in groups where it seemed no one seemed to embody these principles.&amp;nbsp; All it generated was crappy code, shouting matches and the general weeping and gnashing of teeth.&amp;nbsp; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-117224513532003288?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/117224513532003288/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=117224513532003288' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/117224513532003288'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/117224513532003288'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2007/02/ieee-defined-code-of-ethics-for.html' title='IEEE defined Code of Ethics for Software Engineers'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-117104663594924932</id><published>2007-02-09T10:43:00.000-08:00</published><updated>2007-02-09T10:43:58.896-08:00</updated><title type='text'>Interesting Text Parsing</title><content type='html'>&lt;p&gt;At work this week we were getting a lot of&amp;nbsp;SQL timeout errors.&amp;nbsp; We went to the DBA and he sends us a log file and explains that many of our sprocs are blocking resources.&amp;nbsp; He gave us this monster log file and left it up to us to get what we needed out of it.&lt;/p&gt; &lt;p&gt;Here is the basic syntax of the log file.&lt;/p&gt; &lt;div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; width: 95%; padding-top: 3px; background-color: silver"&gt;2006-11-17 19:03:20,733 WARNING BLOCKER --&amp;nbsp;MYDBSERVER SPID: 120, hostname MYWEBSERVER, prg .Net SqlClient Data Provider, ntlogin &lt;br&gt;2006-11-17 19:03:20,733 WARNING Blocking Buffer info: sp_executesql;1&lt;br&gt;-- &lt;/div&gt; &lt;p&gt;This pattern was repeated ~600 times.&amp;nbsp; The log file reported on all the databases on the server, not just ours.&amp;nbsp; So, I came up with this PowerShell script to give me a list of unique stored procedures that caused a block on the SQL server. &lt;/p&gt; &lt;div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; width: 95%; padding-top: 3px; background-color: silver"&gt;$a = gc "blocks.txt"; 0..$a.count | % { if($a[[int]$_] -match "MYWEBSERVER") { ([regex]"ap\w*").match($a[([int]$_ + 1)]) } } | % { $_.Value } | sort -uniq &lt;/div&gt; &lt;p&gt;Yes, that is one line.&amp;nbsp; Thank you, PowerShell team, for giving us the ";" character.&amp;nbsp; ;-)&amp;nbsp; &lt;p&gt;The first line loads all the lines in the file into an array. &lt;/p&gt; &lt;div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; width: 95%; padding-top: 3px; background-color: silver"&gt;$a = gc "blocks.txt";&lt;/div&gt; &lt;p&gt;Then we loop through all the rows and pick out the&amp;nbsp;lines&amp;nbsp;that reference MYWEBSERVER.&amp;nbsp;&amp;nbsp;&amp;nbsp; NOTE: calling $a[$_] didn't work for me.&amp;nbsp; I had to cast $_ to an int, like so $a[[int]$_].&lt;/p&gt; &lt;p&gt;If the line contains the name of MYWEBSERVER, then I look at the next line and return everything that matches my regex expression, "ap\w*".&amp;nbsp; All of our sprocs have been prefixed with "ap" so this was pretty easy.&amp;nbsp;&lt;/p&gt; &lt;div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; width: 95%; padding-top: 3px; background-color: silver"&gt;0..$a.count | % { if($a[[int]$_] -match "MYWEBSERVER") { ([regex]"ap\w*").match($a[([int]$_ + 1)]) } } &lt;/div&gt; &lt;p&gt;The last step is to filter our result set to only pass through unique values. &lt;/p&gt; &lt;div style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; width: 95%; padding-top: 3px; background-color: silver"&gt;sort -uniq &lt;/div&gt; &lt;p&gt;It took me about 15 minutes to write and test this.&amp;nbsp; However, next time we get a log like this, I'll be ready! &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-117104663594924932?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/117104663594924932/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=117104663594924932' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/117104663594924932'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/117104663594924932'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2007/02/interesting-text-parsing.html' title='Interesting Text Parsing'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-117085302241255760</id><published>2007-02-07T04:57:00.000-08:00</published><updated>2007-02-07T05:02:21.560-08:00</updated><title type='text'>The death of a television giant</title><content type='html'>&lt;p&gt;It has been a rough week for me, technology wise. I've had a lot of frustrating issues with my laptop. But even worse, my beloved televsion died. That's right, my 62" Panasonic CinemaView 1080i projection televsion left me to go to the great sports bar in the sky. And right in the middle of Seinfeld too. First the image flickered, then the image went away, then came the most horrible stench of burning electronics that I have ever smelled. Even now, a week later, you can still smell the subtle aroma of fried wire. Of course, this made watching the Superbowl fun. I had to bring down my kid's 20" tv/vcr combo to watch it on. &lt;/p&gt;&lt;p&gt;I have a demonstration image to convey the seriousness of the situation.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://photos1.blogger.com/x/blogger/7994/2984/1600/768067/TV.png"&gt;&lt;img style="MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://photos1.blogger.com/x/blogger/7994/2984/320/453426/TV.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;&lt;a title="Clark Howard" href="http://clarkhoward.com/"&gt;Clark Howard&lt;/a&gt; says to wait until March to buy a new tv. The prices will go down by then. So, I'm unofficially declaring the month of February as a month of mourning. On the bright side, I no longer have the warm, engulfing glow of my large screen tv to lull me into a semi-vegetative state. So I'll have more time to blog. ;)&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-117085302241255760?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/117085302241255760/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=117085302241255760' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/117085302241255760'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/117085302241255760'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2007/02/death-of-television-giant.html' title='The death of a television giant'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-117071023230663343</id><published>2007-02-05T13:17:00.000-08:00</published><updated>2007-02-05T13:18:44.456-08:00</updated><title type='text'>Expand/Collapse PowerShell Commands</title><content type='html'>&lt;p&gt;I was listening the Bruce Payette interview on Hanselminutes and my interest really piqued when they were discussing aliases and being able to write really terse scripts.&amp;nbsp; It got me to thinking.&amp;nbsp; Wouldn't it be cool to be able to expand all the aliased command names in a script long enough for you to work on the script.&amp;nbsp; Then, when you are ready to put it back out there, you could collapse all the command names to short aliases.&lt;/p&gt; &lt;p&gt;Here is my first attempt:&lt;/p&gt; &lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;function Expand-Command($Text)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    $a = (alias $Text).Definition&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt;( $a.length -gt 0)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;        &lt;span class="kwrd"&gt;return&lt;/span&gt; $a&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;    &lt;span class="kwrd"&gt;else&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;        &lt;span class="kwrd"&gt;return&lt;/span&gt; $Text&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;}&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;function Collapse-Command($Text)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;    $a = [&lt;span class="kwrd"&gt;string&lt;/span&gt;](alias | Where-Object { $_.Definition -eq $Text } | Sort-Object { Name.length })&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt;( $a.length -gt 0)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;        &lt;span class="kwrd"&gt;return&lt;/span&gt; $a.split(&lt;span class="str"&gt;" "&lt;/span&gt;)[0]&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;    &lt;span class="kwrd"&gt;else&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;        &lt;span class="kwrd"&gt;return&lt;/span&gt; $Text&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;}&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;function Expand-Script($script)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;{    &lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;    $s = &lt;span class="str"&gt;""&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;    Get-Content $script | ForEach-Object { ([&lt;span class="kwrd"&gt;string&lt;/span&gt;]$_).Split(&lt;span class="str"&gt;" "&lt;/span&gt;) | ForEach-Object { $s += (Expand-Command($_) + &lt;span class="str"&gt;" "&lt;/span&gt;) } }&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  31:  &lt;/span&gt;    &lt;span class="kwrd"&gt;return&lt;/span&gt; $s&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  32:  &lt;/span&gt;}&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  33:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  34:  &lt;/span&gt;function Collapse-Script($script)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  35:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  36:  &lt;/span&gt;    [&lt;span class="kwrd"&gt;string&lt;/span&gt;]$s = Get-Content $script&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  37:&lt;/span&gt;&lt;span class="lnum"&gt;  &lt;/span&gt;    &lt;span class="lnum"&gt;  &lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  38:  &lt;/span&gt;    Get-Command | ForEach-Object { $s = ($s -replace $_.Name, [&lt;span class="kwrd"&gt;string&lt;/span&gt;](Collapse-Command($_.Name))) }&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  39:  &lt;/span&gt;    &lt;span class="kwrd"&gt;return&lt;/span&gt; $s&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  40:  &lt;/span&gt;}&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  41:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  42:  &lt;/span&gt;Collapse-Script(&lt;span class="str"&gt;"c:\\Dummy.ps1"&lt;/span&gt;)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  43:  &lt;/span&gt;Expand-Script(&lt;span class="str"&gt;"c:\\Dummy.ps1"&lt;/span&gt;)&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;So, what's going on? Let's start with the Collapse functions. The Collapse-Command function(lines 14-25) basically goes through all the aliases looking for the ones that match the command name that was passed in. Then it sorts them by their length and splits out the first available.&amp;nbsp; This way it will always pass back the shortest&amp;nbsp; command name.&amp;nbsp; In the Collapse-Script function(line 34-40), we loop through all the commands and then replace their names with the collapsed names.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The Expand-Command function(lines 1-12)&amp;nbsp;acts pretty much the same as the Collapse-Command function.&amp;nbsp; The only difference is instead of searching on the alias definition, we search on the alias name.&amp;nbsp; The Expand-Script function(lines 27-32)&amp;nbsp;acts a little differently than its counterpart.&amp;nbsp; It loops through all the individual lines and then through all the words, calling the Expand-Command function as it goes.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;I tried to think like a&amp;nbsp;PowerShell developer, not a&amp;nbsp;C# developer for this one.&amp;nbsp; However, I&amp;nbsp;don't think that it turned out very PowerShelly.&amp;nbsp; It is also ungodly slow.&amp;nbsp; I welcome any constructive ideas to make&amp;nbsp;it better.&amp;nbsp; &amp;nbsp; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-117071023230663343?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/117071023230663343/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=117071023230663343' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/117071023230663343'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/117071023230663343'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2007/02/expandcollapse-powershell-commands.html' title='Expand/Collapse PowerShell Commands'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-116966800038537069</id><published>2007-01-24T11:46:00.000-08:00</published><updated>2007-01-24T11:46:40.616-08:00</updated><title type='text'>View Office 2007 documents in Office 2003</title><content type='html'>&lt;p&gt;It's only been three weeks and I have already run into compatibility issues with my version of Office and some document that I would like to open from the web.&amp;nbsp; Office 2007 uses a new file format labeled the "Open XML Format".&amp;nbsp; &lt;/p&gt; &lt;p&gt;According to Microsoft:&lt;/p&gt; &lt;p&gt;&lt;em&gt;"The Open XML Formats usher in a new era of openness and transparency for Word, Excel and PowerPoint. Solution developers can take advantage of a host of new integration opportunities to connect documents to important sources of information."&lt;/em&gt;&lt;/p&gt; &lt;p&gt;If you are still using Office 2003, however, you will find that the new format isn't very open or transparent to you.&amp;nbsp; Luckily, Microsoft has published a patch for Office 2003 to make it compatable with Office 2007.&amp;nbsp; You can download it here: &lt;a title="Microsoft Office Compatibility Pack" href="http://www.microsoft.com/downloads/details.aspx?FamilyId=941B3470-3AE9-4AEE-8F43-C6BB74CD1466&amp;amp;displaylang=en" rel="nofollow"&gt;Microsoft Office Compatibility Pack&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;My only question,&amp;nbsp; if Microsoft is so gung-ho on their new format, why didn't I get this pack&amp;nbsp;via Microsoft Update?&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-116966800038537069?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/116966800038537069/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=116966800038537069' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/116966800038537069'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/116966800038537069'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2007/01/view-office-2007-documents-in-office.html' title='View Office 2007 documents in Office 2003'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-116895205371091288</id><published>2007-01-16T04:54:00.000-08:00</published><updated>2007-01-16T04:54:13.846-08:00</updated><title type='text'>Fix Visio 2003 VML code for IE7 with Powershell</title><content type='html'>&lt;p&gt;I have recently been tasked with providing a lot of documentation around the applications that I am working on.&amp;nbsp; I naturally turned to Visio to help me with my dataflow and physical network diagrams.&amp;nbsp; I'm using Visio 2003 and have found that this version will export your Visio file and all of its pages as a web site.&amp;nbsp; By default all of your pages will be converted into VML.&amp;nbsp; You can also insert hyperlinks into the objects on your diagram that link to other pages.&lt;/p&gt; &lt;p&gt;This produces a really neat web site with built in navigation and search capabilities.&amp;nbsp; It even works in FireFox, sort of.&amp;nbsp; FireFox users see a dumbed down version without the search.&amp;nbsp; I discovered my issue when I tried to use the site in IE7.&amp;nbsp; Apparently IE7 doesn't like the way the links are built.&amp;nbsp; I found more information &lt;a title="http://blogs.msdn.com/visio" href="http://blogs.msdn.com/visio/archive/2006/11/03/hyperlink-problem-in-internet-explorer-7.aspx"&gt;here&lt;/a&gt;.&amp;nbsp; It looks like Office 2007 will fix this.&amp;nbsp;&lt;/p&gt; &lt;p&gt;There is a short term fix.&amp;nbsp; You just have to replace the&amp;nbsp;'href="#"' in all the vml objects to 'style="cursor:pointer;"' for each file that was generated.&amp;nbsp; In my case, I have over a dozen files.&lt;/p&gt; &lt;p&gt;At the bottom of the article in the comments someone mentions that there is a utility that you can down load and install to perform the fix.&amp;nbsp; But my machine is still pissed off about the last dinky utility that I installed and only use once in a blue moon.&amp;nbsp; Powershell can do this, no sweat.&amp;nbsp; Here's the line that I used.&lt;/p&gt;&lt;pre class="csharpcode"&gt;ls vml_*.htm | % { echo $_.Name; (gc $_.FullName) -replace(&lt;span class="str"&gt;"href=`"&lt;/span&gt;#`&lt;span class="str"&gt;""&lt;/span&gt;, &lt;span class="str"&gt;"style=`"&lt;/span&gt;cursor:pointer;`&lt;span class="str"&gt;""&lt;/span&gt;) | out-File $_.FullName }&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;First off, I'm getting all the htm files with vml code in them.&amp;nbsp; Visio conviently labels them as vml.&amp;nbsp; Then, for each file I write out the name to the console.&amp;nbsp; You don't have to have this, but I like seeing what files were processed.&amp;nbsp; The gc command reads the file into a string and the -replace command does the replacing work.&amp;nbsp; Notice that the escape character in Powershell is "`" not "\".&amp;nbsp; Finally, the original file is overwritten with the corrected string.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-116895205371091288?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/116895205371091288/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=116895205371091288' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/116895205371091288'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/116895205371091288'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2007/01/fix-visio-2003-vml-code-for-ie7-with.html' title='Fix Visio 2003 VML code for IE7 with Powershell'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-116558990457966282</id><published>2006-12-08T06:58:00.000-08:00</published><updated>2006-12-08T06:58:24.670-08:00</updated><title type='text'>Checking Error table with Powershell</title><content type='html'>&lt;p&gt;One of our main web applications writes audit and error messages to the SQL database.&amp;nbsp; I was looking for a faster way to get a quick overview of the last few messages written to the table.&amp;nbsp; I could save a sql script, but seriously, where's the fun in that?&amp;nbsp; And besides, it would require me opening up SQL Query Analyzer.&amp;nbsp;However, I do keep a Powershell window open at all times.&amp;nbsp; &lt;/p&gt; &lt;p&gt;Speaking of Query Analyzer, I had a significant breakthrough to a new level of keyboard zen with it last week.&amp;nbsp; More on that later.&amp;nbsp; &lt;/p&gt; &lt;p&gt;Onto the script:&lt;/p&gt; &lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;$count = 50&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&lt;span class="kwrd"&gt;if&lt;/span&gt; ($args.length &lt;span class="preproc"&gt;-gt&lt;/span&gt; 0) { $count = $args[0] }&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;$conn = new-Object System.Data.SqlClient.SqlConnection&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;$conn.ConnectionString = &lt;span class="str"&gt;"Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=MyDatabase;Data Source=MySqlServer"&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;$conn.Open()&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;$cmd = new-Object System.Data.SqlClient.SqlCommand&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;$cmd.CommandText = &lt;span class="str"&gt;"SELECT TOP $count * FROM tblError ORDER BY ErrorID DESC"&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;$cmd.Connection = $conn&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;$da = new-Object System.Data.SqlClient.SqlDataAdapter($cmd)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;$ds = new-Object System.Data.DataSet &lt;span class="str"&gt;"Errors"&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;$da.Fill($ds) | out-Null&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;$conn.Close()&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;$ds.Tables[0].Rows | Format-Table -property ErrorID, errorTime, ErrorMessage -wrap -autosize&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;rv count, conn, cmd, da&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;The first thing to do is to create a count variable that will be used to determine how many records to pull from the db.&amp;nbsp; It defaults to 50, but that can be overwritten in line 2 if you pass in a parameter to the script.&amp;nbsp; Lines 4-15, should look familiar.&amp;nbsp; They basically use ADO.NET objects to get the records from the db and place them in a DataSet.&amp;nbsp; Line 17 is responsible for displaying the results in the console.&amp;nbsp; I use the Format-Table cmdlet to filter out some of the fields and to make them look pretty by autsizing them and causing the cells to wrap their text.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;In line 19, a bunch of variables are removed.&amp;nbsp; Normally, you wouldn't have to worry with this step as the variables will go out of scope as soon as the script finishes.&amp;nbsp; I did this, incase I ran the script in global scope.&amp;nbsp; You can accomplish this by inserting a ". " at the beginning of the command line.&amp;nbsp; In which case all of the variables would remain even after the script is complete.&amp;nbsp; In my case, I'm removing all the variables except the dataset.&amp;nbsp; That way, I can continue to manipulate the object and if I want to refresh it, I just re-run the script.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-116558990457966282?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/116558990457966282/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=116558990457966282' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/116558990457966282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/116558990457966282'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/12/checking-error-table-with-powershell.html' title='Checking Error table with Powershell'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-116499055302882889</id><published>2006-12-01T08:29:00.000-08:00</published><updated>2006-12-01T08:29:13.133-08:00</updated><title type='text'>Wargames Influenced Powershell Hack</title><content type='html'>&lt;p&gt;As a child, I love the movie WarGames.&amp;nbsp; Looking back though, it does&amp;nbsp;seem kind of corny and&amp;nbsp;maybe even&amp;nbsp;improbable.&amp;nbsp; No matter, I still think its a great movie.&amp;nbsp;&amp;nbsp;The movie introduces concepts that we still&amp;nbsp;deal with today.&amp;nbsp; Things like system security, artificial intelligence and the concept of futility.&amp;nbsp; You prabably know that I love lists, so here are my favorite things about the movie.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;The five greatest things about WarGames the movie&lt;/strong&gt;:&lt;/p&gt; &lt;p&gt;5. That scene where Matthew Broderick phreaked a pay phone by sticking a pull tab from a soda can in the receiver.&amp;nbsp; Through the eyes of a kid, this was awesome.&lt;/p&gt; &lt;p&gt;4. The extensive use of the &lt;a href="http://en.wikipedia.org/wiki/Acoustic_coupler"&gt;acoustically coupled modem&lt;/a&gt; to hack the Government's most secure network.&lt;/p&gt; &lt;p&gt;3. The 8 inch floppy drive.&amp;nbsp; Which at it's prime could hold 1200 kb.&lt;/p&gt; &lt;p&gt;2. &lt;a href="http://www.imdb.com/name/nm0179224/"&gt;Barry Corbin&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;1.&amp;nbsp;The cool terminal that would talk to you, a.k.a. Joshua.&lt;/p&gt; &lt;p&gt;Its the terminal that inspired my personallized use of this hack.&amp;nbsp; Below is an excerpt from my Powershell profile.&amp;nbsp; You may recognize some of the code from a previous post.&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;function&lt;/span&gt; say($script)&lt;br /&gt;{&lt;br /&gt;    $v = New-Object -ComObject &lt;span class="str"&gt;"SAPI.spvoice"&lt;/span&gt;&lt;br /&gt;    $r = $v.Speak($&lt;span class="kwrd"&gt;script&lt;/span&gt;)&lt;br /&gt;    rv v&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span class="rem"&gt;#Say Hello&lt;/span&gt;&lt;br /&gt;$Greeting = &lt;span class="str"&gt;"Hello "&lt;/span&gt; + $env:Username + &lt;span class="str"&gt;". Shall we play a game?"&lt;/span&gt;&lt;br /&gt;write $Greeting&lt;br /&gt;say $Greeting&lt;br /&gt;rv Greeting&lt;br /&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;The first thing I do is create a function named "say".&amp;nbsp; Inside the function I create a instance of the SAPI.spvoice COM object.&amp;nbsp; SAPI is the Text to Speech API that is installed with Windows XP by default.&amp;nbsp; You can administer it by going into your control panel and opening the Speech option.&amp;nbsp; The spvoice object allows you to pass in some text and it will convert it into audible speech and send it out to your speakers.&amp;nbsp; So the "say" function takes some text and speaks it.&amp;nbsp; Note that I took the time to use "rv" to remove the variable.&amp;nbsp; Don't need to hold on to that COM object longer than I need to. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Next you see where I get the user name of the person logged on and print out a greeting right before I speak it.&amp;nbsp; I've seen some articles on using this technology in ASP.NET applications.&amp;nbsp; Think of the fun you could have.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-116499055302882889?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/116499055302882889/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=116499055302882889' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/116499055302882889'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/116499055302882889'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/12/wargames-influenced-powershell-hack.html' title='Wargames Influenced Powershell Hack'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-116370289677428756</id><published>2006-11-16T10:48:00.000-08:00</published><updated>2006-11-16T10:48:17.283-08:00</updated><title type='text'>Omitting the Byte Order Mark while saving XML Document</title><content type='html'>&lt;p&gt;Have you every opened up an XML file in note pad and noticed those little gobbly gook characters preceding the XML declaration?&amp;nbsp; Well my friend you have encountered the ever elusive Byte Order Mark, or BOM for short.&amp;nbsp; I prefer Byte Order Mark because BOM sounds dirty, kind of like scrum.&amp;nbsp; Eck, dirty.&amp;nbsp; &lt;/p&gt; &lt;p&gt;The Byte Order Mark is basically three characters that are added to the beginning of xml files to denote their encoding.&amp;nbsp; I know... I know...&amp;nbsp; You can declare the encoding in the xml declaration.&amp;nbsp; That's what it is there for, right?&amp;nbsp; To declare stuff.&amp;nbsp; &lt;/p&gt; &lt;p&gt;Well, that is only partly true.&amp;nbsp; When an XML parser reads an XML file, the W3C defines the following three rules to decides how the document should be read:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;If there is a Byte Order Mark&amp;nbsp;the Byte Order Mark defines the file encoding. &lt;li&gt;If there is no Byte Order Mark, then the encoding attribute in the XML declaration is definitive. &lt;li&gt;If there are neither of these, then assume the XML document is UTF-8 encoded.&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;I think that I remember reading an article once that claimed the Byte Order Mark was born out of Windows NT, but I can't find it now.&amp;nbsp; Either way, you are bound to come across some service somewhere that doesn't like it, probably because the service thinks that it is dirty.&amp;nbsp; All strings in .NET are encoded to UTF-16 by default. If you build and XmlDocument and save it, it will be UTF-16 encoded.&amp;nbsp; And by default, there will be a silly little Byte Order Mark.&amp;nbsp; Visual Studio, like most current xml editors, won't show it to you, but its there.&amp;nbsp; &lt;/p&gt; &lt;p&gt;Here's how I prevent the Byte Order Mark from appearing in my generated xml files.&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; WriteXmlFile(XmlDocument xdoc)&lt;br /&gt;{&lt;br /&gt;  System.Text.Encoding enc = &lt;span class="kwrd"&gt;new&lt;/span&gt; UTF8Encoding(&lt;span class="kwrd"&gt;false&lt;/span&gt;);&lt;br /&gt;  XmlWriter w = &lt;span class="kwrd"&gt;new&lt;/span&gt; XmlTextWriter("NewFile.xml", enc);&lt;br /&gt;  xdoc.Save(w);&lt;br /&gt;  w.Close();&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;When I create the UTF8Encoding object, I pass in false for the encodingShouldEmitUTF8Identifier parameter.&amp;nbsp; This will omit the Byte Order Mark from the NewFile.xml file.&amp;nbsp; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-116370289677428756?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/116370289677428756/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=116370289677428756' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/116370289677428756'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/116370289677428756'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/11/omitting-byte-order-mark-while-saving.html' title='Omitting the Byte Order Mark while saving XML Document'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-116290599901273989</id><published>2006-11-07T05:26:00.000-08:00</published><updated>2006-11-07T05:26:39.380-08:00</updated><title type='text'>Parsing CSV files with PowerShell</title><content type='html'>&lt;p&gt;So there I was, looking at a Caliber requirement, basically a&amp;nbsp;Word&amp;nbsp;document,&amp;nbsp;with a table of values that needed to get into a table in our SQL database.&amp;nbsp; We were still in development and there was no entry form in the application for the requirement writers to enter the values.&amp;nbsp; Faced with the prospect of having to manually build a sql script to insert all these values, I desperately called out to Necessity.&amp;nbsp; You know that Necessity is the mother of invention.&amp;nbsp; She carries a big purse full of invention, with which she immediately hit me over the head.&amp;nbsp; She told me that I already had Powershell, mumbled something about the boy that cried wolf and stormed out.&amp;nbsp; Powershell, eh?&amp;nbsp; The following&amp;nbsp;is an abbreviated description of what I did to generate my sql script. My insert statement was much larger.&lt;/p&gt; &lt;p&gt;First, I&amp;nbsp;copied the word table into excel, including the headers, and saved the file as a CSV file. The format looked something like this:&lt;/p&gt; &lt;p&gt;&lt;em&gt;State, City, Type&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;em&gt;GA, Atlanta, AB&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;em&gt;GA, Albany, A&lt;/em&gt;&lt;/p&gt; &lt;p&gt;Now for the Powershell.&amp;nbsp; Check out this bad boy:&lt;/p&gt;&lt;pre class="csharpcode"&gt;Import-Csv Test.csv | % { &lt;span class="str"&gt;"INSERT INTO refTestTable (State, City, Type) VALUES ('$_.State', '$_.City', '$_.Type')"&lt;/span&gt;}  &amp;gt;&amp;gt; &lt;span class="str"&gt;"Test.sql"&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;&lt;span class="str"&gt;After opening up the new Test.sql file, I got this:&lt;/span&gt;&lt;/p&gt;&lt;pre class="csharpcode"&gt;INSERT &lt;span class="kwrd"&gt;INTO&lt;/span&gt; refTestTable (&lt;span class="kwrd"&gt;State&lt;/span&gt;, City, Type) &lt;span class="kwrd"&gt;VALUES&lt;/span&gt; (&lt;span class="str"&gt;'GA'&lt;/span&gt;, &lt;span class="str"&gt;'Atlanta'&lt;/span&gt;, &lt;span class="str"&gt;'AB'&lt;/span&gt;)&lt;br /&gt;INSERT &lt;span class="kwrd"&gt;INTO&lt;/span&gt; refTestTable (&lt;span class="kwrd"&gt;State&lt;/span&gt;, City, Type) &lt;span class="kwrd"&gt;VALUES&lt;/span&gt; (&lt;span class="str"&gt;'GA'&lt;/span&gt;, &lt;span class="str"&gt;'Albany'&lt;/span&gt;, &lt;span class="str"&gt;'A'&lt;/span&gt;)&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;span class="str"&gt;Not bad for one line of code.&amp;nbsp; Powershell's Import-Csv command loops through all the records in the CSV file and generates objects.&amp;nbsp; Then for each object we build a sql string and insert the object's properties.&amp;nbsp; Notice how the properties were dynamically generated so all you had to do was call them?&amp;nbsp; Finally, I outputted the resulting string to a text file.&amp;nbsp; Using this method I was able to generate and run the sql script in less than&amp;nbsp;10 minutes.&amp;nbsp; &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-116290599901273989?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/116290599901273989/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=116290599901273989' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/116290599901273989'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/116290599901273989'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/11/parsing-csv-files-with-powershell.html' title='Parsing CSV files with PowerShell'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-116281550178176727</id><published>2006-11-06T04:18:00.000-08:00</published><updated>2006-11-06T04:37:10.986-08:00</updated><title type='text'>My first blog from Live Writer</title><content type='html'>&lt;p&gt;This is my first blog post that I have generated in &lt;a href="http://windowslivewriter.spaces.live.com/blog/cns!D85741BB5E0BE8AA!174.entry"&gt;Windows Live Writer Beta&lt;/a&gt;.&amp;nbsp; Until now, I have used the online editor.&amp;nbsp; The fat client sports a&amp;nbsp;cool &lt;strong&gt;WYSIWYG &lt;/strong&gt;editor and a lot of great accelerator keys.&amp;nbsp; Publishing is a snap and seems to take less time compared with the web editor.&lt;/p&gt; &lt;p&gt;The team has provided an SDK and encourages the development of plugins.&amp;nbsp; There is a page dedicated to these &lt;a href="http://gallery.microsoft.com/default.aspx?l=8"&gt;here&lt;/a&gt;.&amp;nbsp; I found a neat one that helps insert code snippets.&amp;nbsp; &lt;a href="http://gallery.microsoft.com/liveitemdetail.aspx?li=1f57bd9b-a692-4593-9e9e-e2962d9c0eee&amp;amp;l=8"&gt;Insert Code for Windows Live Writer&lt;/a&gt; supports C#, HTML, MSH, JavaScript, Visual Basic and TSQL.&amp;nbsp; I wish that there was a way to assign accelerator keys to the plugins.&amp;nbsp; For now, I'll just have to go through the menu.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-116281550178176727?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/116281550178176727/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=116281550178176727' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/116281550178176727'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/116281550178176727'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/11/my-first-blog-from-live-writer.html' title='My first blog from Live Writer'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-116256175415868529</id><published>2006-11-03T05:40:00.000-08:00</published><updated>2006-11-03T05:49:14.170-08:00</updated><title type='text'>Portable App Week - FastStone Capture</title><content type='html'>We've come to end of Portable Apps Week and I'm a little sad. But all good things must come to an end. For my last app of the week, I'm going back to &lt;a href="http://www.faststone.org"&gt;FastStone&lt;/a&gt; and their Faststone Capture utility. Capture is a screen capture utility that lets you easily capture anything on the screen including windows, objects, full screen, rectangle regions, freehand regions, and scrolling windows. It comes with an editor that allows for cropping, adding text, highlighting and drawing. Not bad for 1.2MB. It's what I've been using to generate the images for all of this week's previous posts.&lt;br /&gt;&lt;br /&gt;I know what you're thinking. How does this compare with &lt;a href="http://www.techsmith.com/snagit.asp"&gt;Snagit&lt;/a&gt;. Well, it isn't quite as full featured as Snagit. It doesn't do text capture, menu capture or video capture. It does allow for freehand capture regions. I'm not sure if Snagit has that or not. FastStone Capture has a much smaller footprint than Snagit. Hmmm, what else? Did I mention that it was free?&lt;br /&gt;&lt;br /&gt;Here is a capture I did freehand. It is supposed to be an octogon.&lt;br /&gt;&lt;a href="http://photos1.blogger.com/blogger/7994/2984/1600/FastStoneCapture_Octogon.jpg"&gt;&lt;img style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://photos1.blogger.com/blogger/7994/2984/320/FastStoneCapture_Octogon.jpg" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-116256175415868529?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/116256175415868529/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=116256175415868529' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/116256175415868529'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/116256175415868529'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/11/portable-app-week-faststone-capture.html' title='Portable App Week - FastStone Capture'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-116247509811645620</id><published>2006-11-02T05:42:00.000-08:00</published><updated>2006-11-02T05:44:58.130-08:00</updated><title type='text'>Portable App Week - FastStone Image Viewer</title><content type='html'>When someone asks me to help them with their website, I have to remind them that I'm a developer, not a graphic artist.  As a developer I strive to make pretty things, but I have no formal artistic training.  I had a really good friend that was a professional graphic artist.  His firm did work for Coke and Six Flags.  I probably could have learned a lot from him, had my girlfriend at time not dumped me and ran off and married him.&lt;br /&gt;&lt;br /&gt;&lt;thought&gt;Happy place, go to your happy place.&lt;/thought&gt;&lt;br /&gt;&lt;br /&gt;I am a big fan of the &lt;a href="http://www.gimp.org"&gt;gimp&lt;/a&gt;.   It's open sourced, free, powerful and difficult to learn.  It's also really big and takes a long time to load.  Since I spend most of my time editing pictures of the kids, removing red-eye and cropping, I don't always need the power of the gimp.  So I was excited to find &lt;a href="http://www.faststone.org/FSViewerDetail.htm"&gt;FastStone's ImageViewer&lt;/a&gt;.&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;"FastStone Image Viewer is a fast, stable, user-friendly image browser, converter and editor. It has a nice array of features that include image viewing, management, comparison, red-eye removal, emailing, resizing, cropping and color adjustments. Its innovative but intuitive full-screen mode provides quick access to EXIF information, thumbnail browser and major functionalities via hidden toolbars that pop up when your mouse touch the four edges of the screen. Other features include a high quality magnifier and a musical slideshow with 150+ transitional effects, as well as lossless JPEG transitions, drop shadow effects, image annotation, scanner support, histogram and much more. It supports all major graphic formats (BMP, JPEG, JPEG 2000, animated GIF, PNG, PCX, TIFF, WMF, ICO and TGA) and popular digital camera RAW formats (CRW, CR2, NEF, PEF, RAF, MRW, ORF, SRF and DNG)."&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It's practically microscopic(3MB) compared to the gimp(40MB) and its fast. The full screen mode is really cool and intuitive, once you get the hang of it. There are a ton of shortcut keys that make browsing a little easier.  Red eye removal and rotation are a snap.  The cropping feature is cool because it allows for you to set the crop size to monitor resolutions.  Great for getting a picture of my daughter in her bumble-bee costume for my wallpaper.  It comes with dual monitor support, so you can do full screen on one monitor and look at the image viewer on the other.  It will even let me link to an external program, if I want to edit the image in something more powerful.&lt;br /&gt;&lt;br /&gt;And don't forget, this is a portable app.  There are no ties to the registry.  So next time you take your USB drive over to your parent's house to show them the pictures you just took of the grandkids, you'll have a great image viewer to view them in.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/7994/2984/1600/FastStoneImageViewer.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/7994/2984/320/FastStoneImageViewer.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-116247509811645620?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/116247509811645620/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=116247509811645620' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/116247509811645620'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/116247509811645620'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/11/portable-app-week-faststone-image.html' title='Portable App Week - FastStone Image Viewer'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-116238349024078955</id><published>2006-11-01T04:16:00.000-08:00</published><updated>2006-11-01T04:18:10.256-08:00</updated><title type='text'>Portable Apps Week - FolderSize</title><content type='html'>It's an all to familiar proplem.  Your favorite drive (HDD, USB, etc.) has filled up and you need to make some space.  So you go into explorer and pull up your drive.  Explorer shows you a list of folders and now its up to you to figure out which one is taking up the most space. This means a lot of right clicking.  Enter FolderSize from &lt;a href="http://www.rotebetasoftware.com"&gt;RoteBetaSoftware&lt;/a&gt;.   What a great play on words.&lt;br /&gt;&lt;br /&gt;Folder size gives you a graphical representation of the folder sizes.  Take a look at my ruby installation.  You'll quickly figure out that the 'lib' folder is far and away the largest folder in the directory.  You can even click directly on one of the bars in the graph to drill down into sub folders.  Its a neat little utility (333kb) that comes in handy from time to time.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/7994/2984/1600/FolderSize.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/7994/2984/320/FolderSize.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-116238349024078955?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/116238349024078955/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=116238349024078955' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/116238349024078955'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/116238349024078955'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/11/portable-apps-week-foldersize.html' title='Portable Apps Week - FolderSize'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-116232534744220631</id><published>2006-10-31T12:04:00.000-08:00</published><updated>2006-10-31T12:11:45.246-08:00</updated><title type='text'>Portable App Week - WinAudit</title><content type='html'>&lt;p&gt;Today's portable application comes to us from &lt;a href="http://www.pxserver.com"&gt;Parmavex Services&lt;/a&gt;. It took me a while to figure this company out. If I understand it right they have two main functions. They provide network services, software development, web hosting and IT services. And also, they supply spare parts for construction plant equipment. Kind of like a Barber shop that sells socks.&lt;br /&gt;Despite their questionable lack of business direction, they have put out a pretty cool free-ware utility called &lt;a href="http://www.pxserver.com/WinAudit.htm"&gt;WinAudit&lt;/a&gt;. WinAudit scans your machine and gathers up all the information it can find into a neat html report. Here is the description off the web site.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;em&gt;"The programme reports on virtually every aspect of computer inventory and configuration. Results are displayed in web-page format, categorised for ease of viewing and text searching. Whether your interest is in software compliance, hardware inventory, technical support, security or just plain curiosity, WinAudit has it all. The programme has advanced features such as service tag detection, hard-drive failure diagnosis, network port to process mapping, network connection speed, system availability statistics as well as Windows® update and firewall settings."&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;And when they say every aspect, they really mean it. It even read the serial number off my motherboard. You can save the results to an html file, a pdf, a chm, several flavors of text and XML. I wish I had this when I was still doing network support. It will come in handy the next time I'm troubleshooting on someone else's machine.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-116232534744220631?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/116232534744220631/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=116232534744220631' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/116232534744220631'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/116232534744220631'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/10/portable-app-week-winaudit.html' title='Portable App Week - WinAudit'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-116221711377752712</id><published>2006-10-30T06:02:00.000-08:00</published><updated>2006-10-30T06:07:53.040-08:00</updated><title type='text'>Portable Apps Week - Smart Undelete</title><content type='html'>I've been really keen on the idea of &lt;a href="http://allen-mack.blogspot.com/2006/09/portable-apps-are-cool.html"&gt;portable applications&lt;/a&gt; lately and last weekend I picked up a few more for my USB drive.  So, I'm declaring a portable app week here at Mack the # implement.  Let's get started with the only application that actually cost me any money.&lt;br /&gt;&lt;br /&gt;I was tidying up some folders on my desktop at home, got a little 'Shift+Delete' happy, and accidentally deleted all the digital pictures from my son's first trip to the Georgia Aquarium.  This is a bad place to be.  My mind began calculating the odds that my wife would just forget that the pictures ever existed.  Of course, NASA would have a hard time coming up with that number.  Then it hit me, they aren't really gone.  They're just marked as deleted.&lt;br /&gt;&lt;br /&gt;After a quick search (on another machine), I found several recovery tools.  I finally opted for Smart Soft's &lt;a href="http://www.smartundelete.com"&gt;Smart Undelete&lt;/a&gt;.  It was cheap, had a small footprint(&lt;1mb) and could be used from a USB drive.  It also has a 100% money back guarantee.&lt;br /&gt;&lt;br /&gt;The UI is simple and easy to use.  Just tell it where to scan.  It also gives you the option to only scan for certain file types.  In my case, .jpg files.  I was able to get everything back.  I even justified to expense to my wife by explaining how I could use it the next time one of our many relatives deletes something important.  Yeah... that's the ticket. ;)&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/7994/2984/1600/SmartUndelete.0.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/7994/2984/320/SmartUndelete.0.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-116221711377752712?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/116221711377752712/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=116221711377752712' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/116221711377752712'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/116221711377752712'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/10/portable-apps-week-smart-undelete.html' title='Portable Apps Week - Smart Undelete'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-115981928564847212</id><published>2006-10-02T13:00:00.000-07:00</published><updated>2006-10-02T13:01:25.666-07:00</updated><title type='text'>Pausing a PowerShell Script</title><content type='html'>I was having an issue while running my watir scripts where if I ran a script that saved information to the database on two or more machines at the exact same time, failure was sure to follow.  This is really annoying and not likely to happen in the real world. However, in the alternate universe where I do my testing, this happens all the time.  Alternate universes are cool.&lt;br /&gt;&lt;br /&gt;We now have a lot of Watir scripts, and it is really tedious to run them individually.  So I wrote a script that calls each one sequentially using PowerShell &lt;thunderclap&gt;.  With my new batch script, I am able to kick off all the Watir scripts from all of my test boxes at the same time and walk away while the website gets put through its paces.  This works great until New York and DC try to save changes to the same story at the same time.  One of the watir scripts will fail.  Usually New York wins.  Stupid New York.&lt;br /&gt;&lt;br /&gt;I'm sure that there is a great solution, which involves messing with the database, but I don't have that kind of time, or patience or attention span.  For the time being, I just wanted to put a pause in the execution of my PowerShell &lt;thunderclap&gt; script that waited for me to press enter to continue.  So here you go:&lt;br /&gt;&lt;br /&gt;Code of Power:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;[System.Console]::ReadLine()&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Awesome!&lt;br /&gt;&lt;/thunderclap&gt;&lt;/thunderclap&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-115981928564847212?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/115981928564847212/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=115981928564847212' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115981928564847212'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115981928564847212'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/10/pausing-powershell-script.html' title='Pausing a PowerShell Script'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-115936215559334899</id><published>2006-09-27T06:00:00.000-07:00</published><updated>2006-09-27T06:02:35.610-07:00</updated><title type='text'>How to generate a connection string</title><content type='html'>&lt;span idspanfor="frame" mlb_idspanflag="true" style="border: 1px solid black; padding: 0px 3px; z-index: 500; font-size: xx-small; font-family: sans-serif; background-color: rgb(214, 227, 254); position: absolute; top: 0pt; left: 0pt; display: none;"&gt;1&lt;/span&gt; The other day I found myself trying to write my own connection string to a System DSN I had just set up.  That was stupid and silly and I know that now.  Seriously, who remembers the syntax for creating a connection string?  No one.  Why?  Because we don't need to create these things every day.  And also, it is stupid and silly.&lt;br /&gt;&lt;br /&gt;So I donned the ceremonial robe and beseeched the great google for help.  Of course, I was presented with a mountain of information on connection strings.  But then it pulled out a large chest that looked like something right out of a pirate movie.  I think this was because it happened to be  &lt;a href="http://www.talklikeapirate.com/"&gt;International Talk Like a Pirate Day&lt;/a&gt;.  The great google loves this stuff. &lt;br /&gt;&lt;br /&gt;It spoke these words to me, "Avast! These examples be good, but ye have the noggin of a bilge rat.  Perhaps ye be in need of some voodoo, ...some Windows voodoo." And it pulled a scroll from the chest and handed it to me with a twisted ferret look in its eyes.&lt;br /&gt;&lt;br /&gt;Hmmm... voodoo, eh? Sounds iffy.  But then again, not all windows voodoo is bad.  There have been books dedicated to the subject.  And I think we have all been in situations where we would gladly rub our computer monitors down with a fried drumstick from KFC while chanting the names of the 12 dwarves in reverse alphabetical order, if it would just keep IE from spewing random "Operation aborted" errors at our users.  But that is another blog post.  I wasn't that desperate, yet.  I opened up the scroll, read the instructions and said to the great google, "This may be the grog talking, but I like sheh way you sthink."  What follows are simple steps to get windows to generate a connection string that even a bilge rat could perform after a couple mugs of grog.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Create a new file, the name doesn't matter, and give it a .udl extension.&lt;/li&gt;&lt;li&gt;Double click on your new file. This will bring up the Data Link Properties dialog&lt;/li&gt;&lt;li&gt;Select the "Use connection string" option and then click the "Build..." button.&lt;/li&gt;&lt;li&gt;Your connection string will show up in the connection string text field. You can also access it by opening up your udl file in a text editor.&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-115936215559334899?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/115936215559334899/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=115936215559334899' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115936215559334899'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115936215559334899'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/09/how-to-generate-connection-string.html' title='How to generate a connection string'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-115826456741051241</id><published>2006-09-14T13:08:00.000-07:00</published><updated>2006-09-14T13:09:27.433-07:00</updated><title type='text'>Mouseless Firefox</title><content type='html'>&lt;span idspanfor="frame" mlb_idspanflag="true" style="border: 1px solid black; padding: 0px 3px; z-index: 500; font-size: xx-small; font-family: sans-serif; background-color: rgb(214, 227, 254); position: absolute; top: 0pt; left: 0pt; display: inline;"&gt;1&lt;/span&gt;I just got back from vacation and I guess I left my mind on the beach, because I forgot to pick up my mouse on the way out the door.  No biggy, I still have my laptop's touch pad and I don't really use the mouse much anyway.  I was even able to pick up a new short cut key, just because I had to. &lt;br /&gt;&lt;br /&gt;In Query Analyzer:&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Shift+F6&lt;/span&gt; - Switch between panes.&lt;br /&gt;&lt;br /&gt;I think this is a good time to talk about some "mouseless" features and extensions that I have found very useful in Firefox. Here are some of my least known/most favorite shortcut keys for Firefox:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;F6/Shift+F6&lt;/span&gt; - Cycle through the frames on a page.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;F7&lt;/span&gt; - Enable/Disable caret browsing. The caret browsing is great for selecting and copying text.&lt;br /&gt;&lt;br /&gt;One of my favorite Firefox add-ons is &lt;a href="https://addons.mozilla.org/firefox/879/"&gt;Mouseless Browsing&lt;/a&gt;. It takes some getting used to, but now I don't know what I would do without it.  This extension enables browsing in Firefox using only the numpad keys.  The extension puts a number next to each control or link on the page.  All you have to do is type in the number and hit enter to browse to that link or control.  You can even hold down the alt key while entering the number to open the link in a new tab.  The numbers do mess with the formatting on the page, but it is really easy to turn them on or off.  Just use the period key on the numpad.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-115826456741051241?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/115826456741051241/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=115826456741051241' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115826456741051241'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115826456741051241'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/09/mouseless-firefox.html' title='Mouseless Firefox'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-115773152126737939</id><published>2006-09-08T09:00:00.000-07:00</published><updated>2006-09-08T09:06:56.660-07:00</updated><title type='text'>Portable Apps are cool!</title><content type='html'>&lt;span idspanfor="frame" mlb_idspanflag="true" style="border: 1px solid black; padding: 0px 3px; z-index: 500; background-color: rgb(214, 227, 254); position: absolute; top: 0pt; left: 0pt; display: none;font-family:sans-serif;font-size:xx-small;"  &gt;I'll be going on vacation next week to the beach and then to visit some family.  That means I'll probably spend some time on their computer.  Now, I like my little utilities that I use from day to day, and I would like to use them but I don't want to take the time to install them.  I remembered that Hansleman was looking for a portable browser and it got me searching for other portable applications.&lt;br /&gt;&lt;br /&gt;What is a portable application? Here is the definition from the PortableApps web site:http://portableapps.com/&lt;br /&gt;&lt;br /&gt;A portable app is a computer program that you can carry around with you on a portable device and use on any Windows computer. When your USB flash drive, portable hard drive, iPod or other portable device is plugged in, you have access to your software and personal data just as you would on your own PC. And when you unplug, none of your personal data is left behind.&lt;br /&gt;&lt;br /&gt;So, what kinds of portable applications are out there?  About everything you could want and then some.&lt;br /&gt;&lt;br /&gt;Luckily for me I had just picked up a shiny new Verbatim 512MB USB Flash Drive.  It was just over ten bucks at Office Max. Its light and feels a lot sturdier than my last one.  Here is a list of some of the apps that I have installed on my USB drive.&lt;br /&gt;&lt;br /&gt;SysInternals:&lt;br /&gt;Go to SysInternals while you still can and at the very least get:&lt;br /&gt;Process Explorer&lt;br /&gt;FileMon&lt;br /&gt;RegMon&lt;br /&gt;Autoruns&lt;br /&gt;TCPView&lt;br /&gt;&lt;br /&gt;Internet Stuff:&lt;br /&gt;Browsar - Private browsing in IE. http://www.browzar.com&lt;br /&gt;TorPark - Ultra private browsing in FireFox. http://torpark.nfshost.com/&lt;br /&gt;Gaim Portable - IM Client. http://portableapps.com/apps/internet/gaim_portable&lt;br /&gt;&lt;br /&gt;File Stuff:&lt;br /&gt;7-Zip portable - Have you ever been stuck without a way to open up a zip file? http://portableapps.com/apps/utilities/7-zip_portable&lt;br /&gt;ClamWin Portable - Portable virus scanner. http://portableapps.com/apps/utilities/clamwin_portable&lt;br /&gt;FileZilla - FTP utility. http://filezilla.sourceforge.net/&lt;br /&gt;Foxit Reader - Smaller and faster than Acrobat reader for pdfs. http://www.foxitsoftware.com/pdf/rd_intro.php&lt;br /&gt;&lt;br /&gt;Just for fun:&lt;br /&gt;Sudoku Portable http://portableapps.com/apps/games/sudoku_portable&lt;br /&gt;&lt;br /&gt;Unclassified but cool:&lt;br /&gt;PStart - PStart can be configured to start up when you plug in your USB drive.  I creates an icon in your systray that acts like a start menu for your drive. Giving you quick access to the applications in a menu.&lt;br /&gt;&lt;br /&gt;All these utilities only added up to 77MB.  I wonder what it would take to get everything that we need to do our jobs as developers onto a 1GB USB drive.  We wouldn't have to worry about dragging around laptops as long as we had a clean XP install to plug our drive's into.  You wouldn't even require an internet connection for some of the apps.  1&lt;/span&gt; I'll be going on vacation next week to the beach and then to visit some family.  That means I'll probably spend some time on their computer.  Now, I like my little utilities that I use from day to day, and I would like to use them but I don't want to take the time to install them.  I remembered that Hansleman was looking for a portable browser and it got me searching for other portable applications.&lt;br /&gt;&lt;br /&gt;What is a portable application? Here is the definition from the &lt;a href="http://portableapps.com/"&gt;PortableApps&lt;/a&gt; web site:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;A portable app is a computer program that you can carry around with you on a portable device and use on any Windows computer. When your USB flash drive, portable hard drive, iPod or other portable device is plugged in, you have access to your software and personal data just as you would on your own PC. And when you unplug, none of your personal data is left behind.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So, what kinds of portable applications are out there?  About everything you could want and then some.&lt;br /&gt;&lt;br /&gt;Luckily for me I had just picked up a shiny new Verbatim 512MB USB Flash Drive.  It was just over ten bucks at Office Max. Its light and feels a lot sturdier than my last one.  Here is a list of some of the apps that I have installed on my USB drive.&lt;br /&gt;&lt;br /&gt;SysInternals:&lt;br /&gt;Go to &lt;a href="http://www.sysinternals.com/"&gt;SysInternals&lt;/a&gt; while you still can and at the very least get:&lt;br /&gt;Process Explorer&lt;br /&gt;FileMon&lt;br /&gt;RegMon&lt;br /&gt;Autoruns&lt;br /&gt;TCPView&lt;br /&gt;&lt;br /&gt;Internet Stuff:&lt;br /&gt;&lt;a href="http://www.browzar.com"&gt;Browsar &lt;/a&gt;- Private browsing in IE.&lt;br /&gt;&lt;a href="http://torpark.nfshost.com/"&gt;TorPark &lt;/a&gt;- Ultra private browsing in FireFox.&lt;br /&gt;&lt;a href="http://portableapps.com/apps/internet/gaim_portable"&gt;Gaim Portable &lt;/a&gt;- IM Client.&lt;br /&gt;&lt;br /&gt;File Stuff:&lt;br /&gt;&lt;a href="http://portableapps.com/apps/utilities/7-zip_portable"&gt;7-Zip Portable&lt;/a&gt; - Have you ever been stuck without a way to open up a zip file?&lt;br /&gt;&lt;a href="http://portableapps.com/apps/utilities/clamwin_portable"&gt;ClamWin Portable&lt;/a&gt; - Portable virus scanner.&lt;br /&gt;&lt;a href="http://filezilla.sourceforge.net/"&gt;FileZilla&lt;/a&gt; - FTP utility.&lt;br /&gt;&lt;a href="http://www.foxitsoftware.com/pdf/rd_intro.php"&gt;Foxit Reader&lt;/a&gt; - Smaller and faster than Acrobat reader for pdfs.&lt;br /&gt;&lt;br /&gt;Just for fun:&lt;br /&gt;&lt;a href="http://portableapps.com/apps/games/sudoku_portable"&gt;Sudoku Portable&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Unclassified but cool:&lt;br /&gt;&lt;a href="http://www.pegtop.de/start/"&gt;PStart&lt;/a&gt; - PStart can be configured to start up when you plug in your USB drive.  I creates an icon in your systray that acts like a start menu for your drive. Giving you quick access to the applications in a menu.&lt;br /&gt;&lt;br /&gt;All these utilities only added up to 77MB.  I wonder what it would take to get everything that we need to do our jobs as developers onto a 1GB USB drive.  We wouldn't have to worry about dragging around laptops as long as we had a clean XP install to plug our drive's into.  You wouldn't even require an internet connection for some of the apps.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-115773152126737939?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/115773152126737939/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=115773152126737939' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115773152126737939'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115773152126737939'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/09/portable-apps-are-cool.html' title='Portable Apps are cool!'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-115764128776411047</id><published>2006-09-07T07:57:00.000-07:00</published><updated>2006-09-07T08:10:18.896-07:00</updated><title type='text'>Decode ViewState with PowerShell</title><content type='html'>We have been screwing around with ViewState lately, trying to resolve some issues and shrink down the size.  In the process, we've downloaded several utilities to decode the viewstate.  However, even these were failing to decode if the Viewstate was over a certain size or if it had non-native datatypes.  Since we didn't have access to the source code, we couldn't fix the problems with the utilities.  So yesterday, at approximately 3:57 pm, I thought to myself, "Gee, how hard could it be to write my own decoder?"  But who wants to create a new VS project for a dinky little utility that you may never use again.  Time for a PowerShell Script.  It's one file with no compiling necessary.&lt;br /&gt;&lt;br /&gt;This script reads the contents of a text file containing the viewstate in question.  Then it decodes it, replaces the non-printable characters with pipe symbols and writes the results to another text file.  You could easily rewrite this to pass in the viewstate string as a parameter to the script, if you wanted to.  You're the kind of person who isn't afraid to paste a +50kb string into your command line of choice.  Get down with your bad self!&lt;br /&gt;&lt;br /&gt;A note on the non-printable characters:  As of .NET 2.0, the viewstate is now delimited with non-printable characters.  To learn more read &lt;a href="http://pluralsight.com/blogs/fritz/archive/2004/06/03/408.aspx"&gt;Fritz Onion's blog&lt;/a&gt; on the subject.&lt;br /&gt;&lt;br /&gt;Now, onto the script:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;# Get the file from the arguments and read it into the x&lt;br /&gt;$x = Get-Content $Args[0]&lt;br /&gt;&lt;br /&gt;# Parse the string into a byte array&lt;br /&gt;$byteArray = [System.Convert]::FromBase64String($x)&lt;br /&gt;&lt;br /&gt;# Create a new encoding object&lt;br /&gt;$enc = New-Object System.Text.ASCIIEncoding&lt;br /&gt;&lt;br /&gt;# We need a charArray with the same length as the byteArray.  I am having a&lt;br /&gt;# hard time finding out how to create an strongly typed empty array of a given&lt;br /&gt;# length in powershell.  If you know how, please let me know.  For now I just&lt;br /&gt;# make charArray a copy of byteArray that will be overwritten later.&lt;br /&gt;[System.Char[]]$charArray = $byteArray&lt;br /&gt;&lt;br /&gt;# Do the decoding.&lt;br /&gt;$enc.GetDecoder().GetChars($byteArray, 0, $byteArray.Length, $charArray, 0)&lt;br /&gt;&lt;br /&gt;# Build the result string.&lt;br /&gt;$charArray | ForEach-Object { $result += $_ }&lt;br /&gt;&lt;br /&gt;# This is a neat regex to replace all the non-printing characters with something else.&lt;br /&gt;# Then the result is written out to ViewStateDecoded.txt.&lt;br /&gt;$result -replace "[\x01-\x1F]+", "|" | Out-File ViewStateDecoded.txt&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;I could probably get this down to 5 lines of code or less, but it more readable this way.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-115764128776411047?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/115764128776411047/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=115764128776411047' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115764128776411047'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115764128776411047'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/09/decode-viewstate-with-powershell.html' title='Decode ViewState with PowerShell'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-115754302501489077</id><published>2006-09-06T04:41:00.000-07:00</published><updated>2006-09-06T04:43:45.030-07:00</updated><title type='text'>Set Window Title in PowerShell</title><content type='html'>&lt;span idspanfor="frame" mlb_idspanflag="true" style="border: 1px solid black; padding: 0px 3px; z-index: 500; background-color: rgb(214, 227, 254); position: absolute; top: 0pt; left: 0pt; display: none;font-family:sans-serif;font-size:xx-small;"  &gt;1&lt;/span&gt; It's been a month since my last post, and I'm sure that you were thinking I was dead.  Not quite, just really busy.  Here's a little time saving tip that I implemented last week in PowerShell.  I was working on several issues and had multiple PowerShell windows open.  Its kind of hard to find the instance of PowerShell that you are looking for while alt+tabbing through &lt;a href="http://www.ntwind.com/software/taskswitchxp.html"&gt;TaskSwitchXP&lt;/a&gt;.  TaskSwitch even has a preview window, which helps as long as your window isn't minimized.  The problem was that I had 3-4 PowerShell windows all titled "Windows PowerShell".&lt;br /&gt;&lt;br /&gt;Wouldn't it be great if I could change the window title to something more meaningful?  No sweat, PowerShell gives you access to the window through the $Host variable.  The command looks like this "&lt;span style="font-family: courier new;"&gt;$Host.UI.RawUI.WindowTitle = 'My New Title'&lt;/span&gt;".  Of course, I'll never be able to remember this and it does seem like a lot of typing.  So I added the following function and alias statement to my profile.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;function Set-WindowTitle($title)&lt;br /&gt;{&lt;br /&gt;   $Host.UI.RawUI.WindowTitle = $title&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;set-alias swt Set-WindowTitle&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Notice that I tried to mimic the verb-noun convention used by the rest of the PowerShell commands.  Now, to set the title I can type in "&lt;span style="font-family: courier new;"&gt;swt 'My New Title'&lt;/span&gt;".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-115754302501489077?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/115754302501489077/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=115754302501489077' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115754302501489077'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115754302501489077'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/09/set-window-title-in-powershell.html' title='Set Window Title in PowerShell'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-115513013792198101</id><published>2006-08-09T06:27:00.000-07:00</published><updated>2006-08-09T06:28:57.936-07:00</updated><title type='text'>RDoc Documentation for Watir</title><content type='html'>In my dealings with Watir, I have been overlooking a very useful reference tool.  The kind Watir developers have conveniently compiled class documentation with RDoc.  &lt;a href="http://rdoc.sourceforge.net/"&gt;RDoc&lt;/a&gt; is the Ruby version of  NDoc (R.I.P.)  This is great for when you want to see what the IE object really does.  You can access this documentation here.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Your Install Dir&lt;/span&gt;\Watir\doc\rdoc\index.htm&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-115513013792198101?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/115513013792198101/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=115513013792198101' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115513013792198101'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115513013792198101'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/08/rdoc-documentation-for-watir.html' title='RDoc Documentation for Watir'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-115336631718340674</id><published>2006-07-19T20:26:00.000-07:00</published><updated>2006-07-19T20:34:32.860-07:00</updated><title type='text'>Edit IE Address Bar with PowerShell</title><content type='html'>Lately, I've been doing a lot of testing of our web app.  And for the last month or so, its all been on the same page. Being a shortcut key addict, I would type the url to the page in IE's address bar and then use F4 and the arrow keys to call it.  As long as I kept going to that page, the url would always be at the top of the list.  However, if I started going to other sites, the address bar's list would get long and my test url would get lost somewhere inside.  It's a real pain the rump to go searching for it.&lt;br /&gt;&lt;br /&gt;So I put together this little PowerShell script.  It clears the address list and puts in the test urls that I want.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;#1&lt;br /&gt;$regpath = "HKCU:\Software\Microsoft\Internet Explorer\TypedURLs"&lt;br /&gt;$xmlpath = "C:\Allen\PSScripts\AddressBarLinkList.xml"&lt;br /&gt;cd $regpath&lt;br /&gt;#2&lt;br /&gt;(Get-Item . ).GetValueNames() |&lt;br /&gt;Where-Object {$_ -match "^url\d+"} |&lt;br /&gt;ForEach-Object { Remove-ItemProperty . $_ }&lt;br /&gt;&lt;br /&gt;#3&lt;br /&gt;$xml = New-Object xml&lt;br /&gt;$xml.Load($xmlpath)&lt;br /&gt;&lt;br /&gt;#4&lt;br /&gt;$xml.urls.url |&lt;br /&gt;ForEach-object {&lt;br /&gt;  New-ItemProperty -Path $path -Name $_.name -type string -value $_.link&lt;br /&gt;}&lt;br /&gt;cd c:&lt;/code&gt;&lt;br /&gt;Let's look at each step and see what's going on.  In step #1, I create 2 variables, $regpath and $xmlpath, and load them with some paths.  Note that the regpath uses the registry key HKCU as a drive.  In PowerShell the registry keys are treated equivalent to folders in the File System and registry values are treated equivalent to files in the File System. All you have to do is change directory to HK whatever and your in.&lt;br /&gt;&lt;br /&gt;In step #2, we see a string of commands piped into each other.  First we get the names of all the values in the key. Next we use Where-Object to pull only those values that match a regular expression.  Then I delete all the values in the result set.&lt;br /&gt;&lt;br /&gt;Step #3 starts with the creation of a new variable, $xml, of type xml (of the .NET xml's).  Pretty much, what I'm doing here is creating a new Xml.Document object.  On the next line I call the xml object's Load method to load an xml file from a filepath.  The xml file contains a list of urls that I want loaded into the address bar.  Take a look:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&amp;lt;urls&amp;gt;&lt;br /&gt;  &amp;lt;url&amp;gt;&lt;br /&gt;      &amp;lt;name&amp;gt;url1&amp;lt;/name&amp;gt;&lt;br /&gt;      &amp;lt;link&amp;gt;http://localhost/Application/test.aspx?ItemId=70946&amp;lt;/link&amp;gt;&lt;br /&gt;  &amp;lt;/url&amp;gt;&lt;br /&gt;  &amp;lt;url&amp;gt;&lt;br /&gt;      &amp;lt;name&amp;gt;url2&amp;lt;/name&amp;gt;&lt;br /&gt;      &amp;lt;link&amp;gt;http://DevServer/Application/test.aspx?ItemId=70946&amp;lt;/link&amp;gt;&lt;br /&gt;  &amp;lt;/url&amp;gt;&lt;br /&gt;&amp;lt;/urls&amp;gt;&lt;/code&gt;&lt;br /&gt;In step #4, I get a list of all the url nodes.  What is really interesting is the notation I used to get them, "$xml.urls.url".  It reads like an XPath statement, just with dots instead of slashes.  Next I use the New-ItemProperty command to create a key value for each of the urls in my xml file.&lt;br /&gt;&lt;br /&gt;So this script edits the registry, reads an external file and parses an xml document.  That's a lot when you consider that it took what amounts to 6 lines of code.  I put in some line breaks and formatting to make it easier to read.  Also note, that I didn't use any aliases in the script.  It could be rewritten as:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;cd HKCU:\Software\Microsoft\Internet Explorer\TypedURLs&lt;br /&gt;(gi . ).GetValueNames() | ? {$_ -match "^url\d+"} | % { rp . $_ }&lt;br /&gt;$xml = New-Object xml&lt;br /&gt;$xml.Load("C:\Allen\PSScripts\AddressBarLinkList.xml")&lt;br /&gt;$xml.urls.url | % { New-ItemProperty -P HKCU:\Software\Microsoft\Internet Explorer\TypedURLs -N $_.name -t string -v $_.link }&lt;br /&gt;cd c:&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-115336631718340674?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/115336631718340674/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=115336631718340674' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115336631718340674'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115336631718340674'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/07/edit-ie-address-bar-with-powershell.html' title='Edit IE Address Bar with PowerShell'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-115288724046951840</id><published>2006-07-14T07:24:00.000-07:00</published><updated>2006-07-14T07:27:20.526-07:00</updated><title type='text'>Access your classes in PowerShell</title><content type='html'>In this example, we will build a small class library and "shell out" to it in a PowerShell script.  I know that it is dinky and lame, but bear with me.  We will build on this knowledge in a later post.  Here are the steps to reproduce the example.&lt;br /&gt;&lt;br /&gt;Fire up your favorite text editor and paste in the following code.  I'm using Notepad2 http://www.flos-freeware.ch/notepad2.html.  It has c# syntax highlighting.  Save your file as "Person.cs".  For me, the full path look like "C:\Allen\Spikes\PSClassAccess\Person.cs".&lt;br /&gt;&lt;br /&gt;&lt;code&gt;using System;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;namespace Person&lt;br /&gt;{&lt;br /&gt; public class Phrases&lt;br /&gt; {&lt;br /&gt;  public Phrases()&lt;br /&gt;  {&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  public static string Hello(string Name)&lt;br /&gt;  {&lt;br /&gt;   return "Hello " + Name;&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  public string GoodBye(string Name)&lt;br /&gt;  {&lt;br /&gt;   return "Goodbye " + Name;&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;}&lt;/code&gt;&lt;br /&gt;Open up an instance of the Visual Studio command prompt.  Then browse to your folder and enter the following command. If all goes well, you will now have a Person.dll file. &lt;br /&gt;&lt;br /&gt;&lt;code&gt;csc /target:library Person.cs&lt;/code&gt;&lt;br /&gt;Open another instance of your text editor and paste in this code.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;# This loads the dll into memory&lt;br /&gt;[System.Reflection.Assembly]::loadfrom("C:\Allen\Spikes\PSClassAccess\Person.dll")&lt;br /&gt;&lt;br /&gt;# Write a blank line for aesthetic reasons&lt;br /&gt;echo("")&lt;br /&gt;&lt;br /&gt;# Here we call the static method directly from the class.&lt;br /&gt;[Person.Phrases]::Hello("Allen")&lt;br /&gt;&lt;br /&gt;# Now lets create an instance of the class.&lt;br /&gt;[Person.Phrases] $Greeter = New-Object -TypeName Person.Phrases&lt;br /&gt;&lt;br /&gt;# Here we call the non-static method GoodBye.&lt;br /&gt;$Greeter.GoodBye("Max")&lt;/code&gt;&lt;br /&gt;Save your file as "HelloGoodbye.ps1".  The "PS1" extension is PowerShells default extenstion for scripts.  The first thing that we do in the script is load our dll into the shells memory.  A couple of lines down we call the static Hello method.  Notice that the type is enclosed in square brackets.  Next we use the New-Object commandlet to create a new instance fo the Phrases class as $Greeter.  In Powershell, all variables begin with the $ character.  Finally we use the new object to call the Goodbye method.&lt;br /&gt;&lt;br /&gt;So lets see what we get.  Open up a PowerShell console and browse to the directory where you saved your script.  Run the script by typing "./HelloGoodbye.ps1".  Your results should look like the following:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;PS&gt; ./HelloGoodbye.ps1&lt;br /&gt;&lt;br /&gt;GAC    Version        Location&lt;br /&gt;---    -------        --------&lt;br /&gt;False  v2.0.50727     C:\Allen\Spikes\PSClassAccess\Person.dll&lt;br /&gt;&lt;br /&gt;Hello Allen&lt;br /&gt;Goodbye Max&lt;/code&gt;&lt;br /&gt;Sweet!  The first thing we see is the result from loading the dll.  You'll quickly determine that it is not in the gac and was compiled with version 2 of the .NET framework.  Then we see the results of our script.  Its a beautiful thing.&lt;br /&gt;&lt;br /&gt;This really shows the power and versatility of PowerShell. How many uses just popped into your head?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-115288724046951840?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/115288724046951840/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=115288724046951840' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115288724046951840'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115288724046951840'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/07/access-your-classes-in-powershell.html' title='Access your classes in PowerShell'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-115281756165739867</id><published>2006-07-13T12:05:00.000-07:00</published><updated>2006-07-13T12:06:01.776-07:00</updated><title type='text'>Just Upgraded StarTeam</title><content type='html'>I just upgraded to StarTeam 2005 and here are my initial thoughts.  The first thing I noticed is that it doesn't look all that different.  That's probably smart.  No need to burden the users with a learning curve.  Aesthetically, they prettied up the icons in the toolbar and sported a new splash screen.&lt;br /&gt;&lt;br /&gt;They must have read my earlier blog post, because the All Descendants functionality is now available in the Change Request and File Menus.  There still isn't a dedicated shortcut for it, but you access it quickly using "Alt+L, A" when in the file view and "Alt+C, A" when in the Change Request view.&lt;br /&gt;&lt;br /&gt;The biggest item on my StarTeam wish list is the ability to easily extend the application.  Maybe I'm spoiled from using Visual Studio, where I can assign keyboard mappings and add plugins.  One thing that gets me is Borland's willingness to give us access to the SDK, but not let us use it to extend StarTeam directly.  I have functionality that is still missing.  I can write it, but I can't run it from inside StarTeam.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-115281756165739867?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/115281756165739867/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=115281756165739867' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115281756165739867'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115281756165739867'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/07/just-upgraded-starteam.html' title='Just Upgraded StarTeam'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-115273247478595254</id><published>2006-07-12T12:26:00.000-07:00</published><updated>2006-07-12T12:29:13.923-07:00</updated><title type='text'>List files based on number of lines.</title><content type='html'>&lt;span idspanfor="frame" mlb_idspanflag="true" style="border: 1px solid black; padding: 0px 3px; z-index: 500; background-color: rgb(214, 227, 254); position: absolute; top: 0pt; left: 0pt; display: none;font-family:sans-serif;font-size:xx-small;"  &gt;1&lt;/span&gt;I was working on a javascript error in IE which returned the line number of the error but not the file where the error occured.  The page was accessing half a dozen seperate js files.  This particular page doesn't do to well in FireFox, so using Venkman was out.  However, there was something unusual about the error.  The line number was 1202.  I thought to myself, "How many js files could we possibly have with more than a thousand lines of code?"  It actually isn't that many.  But how to find this out?  I'll tell you how!  Powershell!&lt;br /&gt;&lt;br /&gt;I opened up a powershell console, changed the directory to the directory where we keep all the js files, and typed in this little ditty (after several revisions, of course).&lt;br /&gt;&lt;code&gt;ls *.js | where {(gc $_).length -gt 1200}&lt;/code&gt;&lt;br /&gt;Which returned:&lt;br /&gt;&lt;code&gt;Mode                LastWriteTime     Length Name&lt;br /&gt;----                -------------     ------ ----&lt;br /&gt;-a---         7/11/2006   2:12 PM      53520 JScript.js&lt;br /&gt;-a---         6/15/2006   1:43 PM      43806 StoryDescription.js&lt;br /&gt;-a---         7/11/2006   2:12 PM      88027 StoryDescriptionEdit.js&lt;/code&gt;&lt;br /&gt;Let's look at what just happened here.  At first glance, you'll notice that the line is pretty terse.  That's because I used predefined aliases for the functions that I called.  In PowerShell, every command that you call is actually a small application known as a commandlet.  PowerShell also lets you alias these commandlets, in order to save you some time.  There are many predefined aliases.  To see a list of the aliases, just type "alias" at the prompt.  If you pass in an alias then it will limit the results to that alias name.  So if you type in "alias ls",  you'll see that you're actually calling Get-ChildItem.  It has just been aliased to make it easier for Unix/Linux users.  It is also aliased as "dir".  In fact, the entire line could be rewritten without any aliases as&lt;br /&gt;&lt;code&gt;Get-ChildItem *.js | Where-Object { (Get-Content $_)&lt;br /&gt;    .length -gt 1200 }&lt;/code&gt;&lt;br /&gt;So the first little bit of the string returns a list of all the files in the current directory that have a ".js" extension. Then the pipe symbol, "|", passes the results to the next code statement.  The where-object commandlet acts like a filter and only returns the items that meet the specified criteria.  In this case we're making sure that the number of lines in the file is greater than (-gt) 1200.&lt;br /&gt;&lt;br /&gt;We determine the number of lines with the Get-Content commandlet.  This commandlet returns an array of all the lines in the file.  You can even loop through the array, but that's another blog post.  We just need to get the length property off of the array object.&lt;br /&gt;&lt;br /&gt;And there you have it.  Only three files in the directory have more than 1200 lines of code and my page only uses one of them.  Even though I'm just a newbie, I'm loving PowerShell.  Unlike most of my peers, I refuse to believe that it is only for system admins.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-115273247478595254?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/115273247478595254/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=115273247478595254' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115273247478595254'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115273247478595254'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/07/list-files-based-on-number-of-lines.html' title='List files based on number of lines.'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-115264262991859002</id><published>2006-07-11T11:29:00.000-07:00</published><updated>2006-07-11T11:30:29.930-07:00</updated><title type='text'>Random Thoughts</title><content type='html'>It's been a slow week for blogging.  I've been pretty busy with the latest push. Here are few of my random thoughts that occured to me as I worked on StarTeam tickets.&lt;br /&gt;&lt;br /&gt;9:05   Apparently, there is no "I" in "StarTeam".&lt;br /&gt;10:38 If I were a pirate, my favorite word to say would be "Scurvy".&lt;br /&gt;11:07 Mmmmm... &lt;a href="http://www.accessatlanta.com/restaurants/restaurants/22405/DetailedList.jspd?activity=direction&amp;id=22405&amp;amp;searchcriteriaurl=&amp;searchtype="&gt;Rosa's&lt;/a&gt;&lt;br /&gt;1:43   The new &lt;a href="http://www.usmint.gov/mint_programs/nickel/index.cfm?action=returnToMonticello"&gt;nickel&lt;/a&gt; really creeps me out.  Stop staring at me!&lt;br /&gt;2:05   Stupid Farpoint!  What would the &lt;a href="http://jayseae.cxliv.org/2006/07/07/magic_8-skull.html"&gt;magic eight skull&lt;/a&gt; do?&lt;br /&gt;2:06   Walk the plank? ...riiight.&lt;br /&gt;2:10   I just had a great idea for a blog post.&lt;span idspanfor="frame" mlb_idspanflag="true" style="border: 1px solid black; padding: 0px 3px; z-index: 500; font-size: xx-small; font-family: sans-serif; background-color: rgb(214, 227, 254); position: absolute; top: 0pt; left: 0pt;"&gt;1&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-115264262991859002?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/115264262991859002/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=115264262991859002' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115264262991859002'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115264262991859002'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/07/random-thoughts.html' title='Random Thoughts'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-115229233868584715</id><published>2006-07-07T10:10:00.000-07:00</published><updated>2006-07-07T10:14:15.216-07:00</updated><title type='text'>Translate Time values with Javascript</title><content type='html'>&lt;span idspanfor="frame" mlb_idspanflag="true" style="border: 1px solid black; padding: 0px 3px; z-index: 500; font-size: xx-small; font-family: sans-serif; background-color: rgb(214, 227, 254); position: absolute; top: 0pt; left: 0pt;"&gt;1&lt;/span&gt;&lt;span idspanfor="frame" mlb_idspanflag="true" style="border: 1px solid black; padding: 0px 3px; z-index: 500; background-color: rgb(214, 227, 254); position: absolute; top: 0pt; left: 0pt;font-family:sans-serif;font-size:xx-small;"  &gt;1&lt;/span&gt; On my current project, I have a need to convert a string to a valid time format.  The user wants to be able to enter time in several formats.  For example military time(1400), hour followed by a or p(2p), etc...  I had a solution that got the job done, but it was getting long, was covered with bandaids and smelled like spaghetti.  So I refactored it and came up with this approach.  If you take out the comments, it has less than half the lines of code in the previous version.  I use a trim string function to trim the spaces off the front and back of the time string, so I'm including it at the bottom.&lt;br /&gt;&lt;br /&gt;Let me know if there is a better way to do this or if this might solve a problem you are having.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;  function fixTime(strTime)&lt;br /&gt;  {&lt;br /&gt;      var dayHalf = "a";&lt;br /&gt;      var Hour = "";&lt;br /&gt;      var Minute = "00";&lt;br /&gt;   &lt;br /&gt;      // Drop the case&lt;br /&gt;      strTime = strTime.toLowerCase();&lt;br /&gt;   &lt;br /&gt;      // Trim the spaces from the front and back&lt;br /&gt;// of the string&lt;br /&gt;      strTime = TrimStr(strTime);&lt;br /&gt;   &lt;br /&gt;      // Check for a|am|p|pm.&lt;br /&gt;      var amMatch = /(am|a|pm|p)$/.exec(strTime);&lt;br /&gt;      if(amMatch != null)&lt;br /&gt;      {&lt;br /&gt;         if(/p/.test(amMatch[0]))&lt;br /&gt;              dayHalf = "p";&lt;br /&gt;      }&lt;br /&gt;   &lt;br /&gt;      // Remove a|am|p|pm&lt;br /&gt;      strTime = strTime.replace(/[a|p|m|:|\s]*/g, "");&lt;br /&gt;   &lt;br /&gt;      // Now we should have nothing left but numbers. &lt;br /&gt;// If the length of the string is 1 or 2,&lt;br /&gt;      // then we are dealing with hours only.&lt;br /&gt;      if(strTime.length &lt; hour =" strTime;" hour =" strTime.slice(0," minute =" strTime.slice(-2);"&gt; 23)&lt;br /&gt;          Hour = Hour % 24;&lt;br /&gt;        &lt;br /&gt;      // Convert the hour and dayhalf.&lt;br /&gt;      if(Hour &gt; 12)&lt;br /&gt;      {&lt;br /&gt;          Hour = Hour - 12;&lt;br /&gt;          dayHalf = "p";&lt;br /&gt;      }&lt;br /&gt;      else if(Hour == 0)&lt;br /&gt;      {&lt;br /&gt;          Hour = 12;&lt;br /&gt;          dayHalf = "a";&lt;br /&gt;      }&lt;br /&gt;   &lt;br /&gt;      // This line ensures that the Hour variable is&lt;br /&gt;// converted to a number type so the result&lt;br /&gt;// won't have any preceding zeros.&lt;br /&gt;      // ex.  "02" would loose the first zero.&lt;br /&gt;      Hour *= 1;&lt;br /&gt;   &lt;br /&gt;      // Build our return string&lt;br /&gt;      strTime = Hour + ":" + Minute + dayHalf;&lt;br /&gt;      return strTime;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  function TrimStr(str)&lt;br /&gt;  {&lt;br /&gt;      var sResult = new String(str);&lt;br /&gt;      var re1 = /(^\s+)/&lt;br /&gt;      var re2 = /(\s+$)/&lt;br /&gt;      sResult = sResult.replace (re1, "");&lt;br /&gt;      sResult = sResult.replace (re2, "");&lt;br /&gt;      return sResult.toString();&lt;br /&gt;  }&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-115229233868584715?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/115229233868584715/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=115229233868584715' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115229233868584715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115229233868584715'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/07/translate-time-values-with-javascript.html' title='Translate Time values with Javascript'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-115212827867954785</id><published>2006-07-05T12:34:00.001-07:00</published><updated>2006-07-05T12:42:20.590-07:00</updated><title type='text'>SQL Tip: Union vs Union All</title><content type='html'>A co-worker gave me a SQL tip today.&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;TIP:&lt;/span&gt; Whenever possible, use UNION ALL, instead of UNION, because it is faster.&lt;br /&gt;&lt;br /&gt;This is a great tip and here's why. UNION eliminates all duplicate rows and sorting results. This requires that it create a temp table, storing all the records and sorting them before generating the result. So its not the most efficient way of doing things. A potential issue with using UNION is the danger of loading the tempdb database with a huge temptable.&lt;br /&gt;&lt;br /&gt;UNION ALL, on the other hand, doesn't eliminate duplicates. It just performs the first select and then appends the second select onto the first result set. There is no temp table or sorting involved. This is much more efficient. If you don't expect duplicate data, then this is the way to go.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-115212827867954785?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/115212827867954785/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=115212827867954785' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115212827867954785'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115212827867954785'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/07/sql-tip-union-vs-union-all_05.html' title='SQL Tip: Union vs Union All'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-115168595564981948</id><published>2006-06-30T09:40:00.000-07:00</published><updated>2006-06-30T09:45:55.663-07:00</updated><title type='text'>Coin Shrinker!</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/7994/2984/1600/ShrunkenQuarter.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://photos1.blogger.com/blogger/7994/2984/200/ShrunkenQuarter.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Today's totally rad technology is the amazing &lt;a href="http://205.243.100.155/frames/shrinkergallery.html"&gt;coin shrinker&lt;/a&gt;.  That's right, a machine that can actually shrink a quarter down to the size of a dime.&lt;br /&gt;&lt;br /&gt;How do they do it?  Simple, they just pass about 1 million amps of electrical current through the coin.  To put things in perspective, that is enough power to run a large city.  The whole process takes approximately 25 millionths of a second.  The coin only shrinks in diameter. It gets thicker, so the actual weight of the coin doesn't change. If this thing were a Master Card commercial it would run something like this:&lt;br /&gt;&lt;br /&gt;Coin: 25¢&lt;br /&gt;Electricity Bill:  $1,000,000*&lt;br /&gt;Ruining a perfectly good quarter just to impress your physicist friends while you hang out in you mom's basement:  priceless&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;* I'm sure its not that high, but anything lower would lessen the comedic effect.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The salivating coolness factor on this is way up there.  I don't even know why.  My theory is that is a guy thing.  Try asking your wife if you can install one in your basement.  You  should refrain from using phrases like "high-velocity metal forming", and "bullet-proof blast case".&lt;br /&gt;I'm pretty sure the &lt;a href="http://forums.whirlpool.net.au/index.cfm?a=wiki&amp;tag=WAF"&gt;WAF&lt;/a&gt; on this is extremely low.&lt;br /&gt;&lt;br /&gt;I'm sure that there are millions of industrial uses for this kind of technology.  I even believe that we can end world hunger.  Follow me here.&lt;br /&gt;&lt;br /&gt;You can cook food with electricity.  When I was in college I had a physics professor who showed us how to cook a hotdog with nothing more than a 12volt outlet and two pieces of wire. The shrinking process uses electricity and makes things thicker. Therefore we should be able to go from a couple of pieces of steakums to a 1 in. thick steak(medium well) in 25 millionths of a second. Talk about fast food.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Corrolation:&lt;/span&gt; There is something to be said about throwing massive amounts of effort to accomplish a goal in a relatively small amount of time.  However, the end product isn't necessarily any better because of it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-115168595564981948?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/115168595564981948/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=115168595564981948' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115168595564981948'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115168595564981948'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/06/coin-shrinker.html' title='Coin Shrinker!'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-115152524463983074</id><published>2006-06-28T13:06:00.000-07:00</published><updated>2006-06-29T04:46:17.263-07:00</updated><title type='text'>StarTeam Productivity Hints</title><content type='html'>If you've spent 5 minutes in a room with me, you know that I'm almost fanatical about keyboard shortcuts.  Don't get me wrong, I love the mouse.  I need it to play &lt;a href="http://www.unrealtournament.com"&gt;UT&lt;/a&gt;.  However, when it comes to just about everything else, I always feel more productive the less I use the mouse.  Micheal Hyatt, CEO of Thomas Nelson Publishers and part-time productivity guru, once &lt;a href="http://www.michaelhyatt.com/workingsmart/2006/05/using_keyboard_.html"&gt;blogged&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;"I have never met anyone really productive who relied on the mouse. It’s just too inefficient. ...few people take the time to really learn the standard operating system shortcuts (Mac or Windows). If you haven’t learned these already, I would urge you to do so. Over time, you will see a major boost in your productivity."&lt;br /&gt;&lt;br /&gt;So today I was asked indirectly about how I use &lt;a href="http://www.borland.com/starteam"&gt;StarTeam&lt;/a&gt;.  I was able to mention a shortcut or two, but there just aren't that many.  StarTeam is a great system, but the UI is grotesque and not very customizable.  And yet I can get 99% of what I need done accomplished without the mouse.  Here is a list of shortcuts that really increase my productivity in StarTeam:&lt;br /&gt;&lt;br /&gt;NAVIGATION&lt;br /&gt;Ctrl+F6 - cycle through open projects&lt;br /&gt;Ctrl+Shift+F6 - reverse cycle through open projects&lt;br /&gt;Alt+W, num - Takes you to the project by its number in the Window menu&lt;br /&gt;Tab - cycle through open panes&lt;br /&gt;Shift+Tab - reverse cycle through panes&lt;br /&gt;Ctrl+Tab - cycle through tabs in current pane&lt;br /&gt;Ctrl+Shift+Tab - reverse cycle through tabs in current pane&lt;br /&gt;&lt;br /&gt;FILES&lt;br /&gt;Alt + i, i - Add files&lt;br /&gt;Ctrl+g - Check out files&lt;br /&gt;Ctrl+i - Check in files&lt;br /&gt;Ctrl+l - Lock File&lt;br /&gt;&lt;br /&gt;When you check in or add a file, StarTeam requires that you fill in a comment on the Check In dialog.  I often just use a space.  Pressing the Enter key doesn't close the dialog.  It acts like a word processor and sends you to the next line.  To combat this, I use the following combination of keystrokes.  I don't even think about them anymore.  Its all muscle memory now.&lt;br /&gt;&lt;br /&gt;Ctrl+i, [space], Shift+Tab, Shift+Tab, [space]&lt;br /&gt;&lt;br /&gt;One of my biggest problems with the StarTeam UI is that there is a button on the toolbar with no matching menu item or available shortcut. Of course, I'm talking about the "All Descendants" button.  It's the only thing I haven't figured out how to do without the mouse.  This has disturbed me to the point of insanity.  &lt;a href="http://en.wikipedia.org/wiki/Sprockets_%28television%29"&gt;There.  I am insane now&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;If you know how to accomplish this, please let me know.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-115152524463983074?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/115152524463983074/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=115152524463983074' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115152524463983074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115152524463983074'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/06/starteam-productivity-hints.html' title='StarTeam Productivity Hints'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-115106585742188529</id><published>2006-06-23T05:25:00.000-07:00</published><updated>2006-06-23T05:30:57.436-07:00</updated><title type='text'>Lasik @ Home!</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/7994/2984/1600/Scal_Pal.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; height: 105px;" src="http://photos1.blogger.com/blogger/7994/2984/320/Scal_Pal.jpg" alt="" border="0" /&gt;&lt;/a&gt;Are you tired of wearing those glasses?  Do you think that Lasik surgery is way out of your price range?  Well let me introduce you to the &lt;a href="http://www.lasikathome.com/"&gt;Scal-Pal&lt;/a&gt;.  That's right, for the measely price of $99.95, you too can reap the benefits of expensice Lasik surgery in the privacy and comfort of your home. &lt;br /&gt;&lt;br /&gt;The Complete LASIK@Home Kit (patent pending) includes everything you need to complete the procedure.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Scal-Pal™ Hand-Operated Combination Femtosecond/Excimer Laser - A real laser!&lt;/li&gt;&lt;li&gt;Mild sedative (diazepam 4mg) - I'd pay the $99.95 for the sedative alone.&lt;/li&gt;&lt;li&gt;No-Blink™ brand Eye Drops - Don't Blink!!! More on that later.&lt;/li&gt;&lt;li&gt;Detailed Instructions and QuickStart Guide - Just four easy steps.&lt;/li&gt;&lt;li&gt;Protective Post-Op Sleep Mask - You're going to need a lot of sleep after this.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;From what I can tell, these guys are serious.  However, you won't find me shooting a laser into my own eye.  What if I had an itch?  As you can see in the below instructions, which are in cartoon form, even blinking can be disastrous. I like how every page has a footnote that reads "*This statement has not been evaluated by the FDA."&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/7994/2984/1600/four%20easy%20steps.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/7994/2984/320/four%20easy%20steps.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The instructions also show the added benefits of diy Lasik.  Apparently, the laser shoots past your eye and into your brain.  As it etches information into your gray matter, you will be granted enhanced archery, piloting, romantic and artistic skills.&lt;br /&gt;&lt;br /&gt;I think my biggest question is, what do you do with the laser after you're done with your self-surgery.  I'll bet you can cut stuff with it.  &lt;butthead&gt;That would be cool.&lt;/butthead&gt;  Do you have any ideas?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Correlation: &lt;/span&gt;When you are trying to implement a process change without the proper support, DON'T BLINK!!!&lt;br /&gt;&lt;br /&gt;*This post has not been evaluated by the FDA.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-115106585742188529?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/115106585742188529/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=115106585742188529' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115106585742188529'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115106585742188529'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/06/lasik-home.html' title='Lasik @ Home!'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-115099826099829345</id><published>2006-06-22T10:42:00.000-07:00</published><updated>2006-06-22T10:46:08.506-07:00</updated><title type='text'>Little known Sql String functions</title><content type='html'>We are all familiar with SQL string functions like LEFT and SUBSTRING.  Here are some of the lesser known Sql string functions:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;PATINDEX &lt;/span&gt;lets you search a string for the first instance that matches a given pattern.  The pattern must begin and end with % signs.  So the following code selects all the last names in the table that contain the pattern 'ack'.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;SELECT LastName FROM tblPersonnel&lt;br /&gt;WHERE PATINDEX('%ack%', LastName) &gt; 0&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;STUFF &lt;/span&gt;inserts a string into another string.  It can delete a specified number of characters from the start position before inserting the string.  Here is some code that starts at the second letter in the string, deletes the next two characters and then inserts the phrase 'ack'.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;SELECT STUFF(LastName, 2, 2, 'ack') FROM tblPersonnel&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;SOUNDEX &lt;/span&gt;and &lt;span style="font-weight: bold;"&gt;DIFFERENCE &lt;/span&gt;can by used to compare how much two strings sound alike.  SOUNDEX takes a string and returns a four-character that can be used by DIFFERENCE to determine if two strings sound alike.  Here's and example:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;SELECT SOUNDEX('Barnett') --&gt; B653&lt;br /&gt;SELECT LastName FROM tblPersonnel&lt;br /&gt;WHERE DIFFERENCE('Barnett', LastName) &lt; 4&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Notice that I didn't have to use the SOUNDEX function in the difference parameters.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here are two where I can't think of a reason to use:&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;REPLICATE &lt;/span&gt;returns a string that is composed by repeating a string for a set number of iterations.  Heres a sample:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;SELECT REPLICATE('A', 5) --&gt; 'AAAAA'&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;REVERSE &lt;/span&gt;produces a mirrored image of the string.  So if you want to return all the names in the table spelled backwards, you could use:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;SELECT REVERSE(LastName) FROM tblPersonnel&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Like I said, I can't think of any real world examples where those last two would be useful, but they are cool anyway.  If you can come up with an example, let me know.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-115099826099829345?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/115099826099829345/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=115099826099829345' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115099826099829345'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115099826099829345'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/06/little-known-sql-string-functions.html' title='Little known Sql String functions'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-115074377113226682</id><published>2006-06-19T12:00:00.000-07:00</published><updated>2006-06-19T12:02:51.146-07:00</updated><title type='text'>I pwn'd it!</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/7994/2984/1600/WINNING-CREST.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://photos1.blogger.com/blogger/7994/2984/320/WINNING-CREST.gif" alt="" border="0" /&gt;&lt;/a&gt;I stumbled across a highly addictive brain teaser from Cambrian House titled &lt;a href="http://www.cambrianhouse.com/pwnit/"&gt;PWNIT&lt;/a&gt;.  It is aimed at coders and technologists and was a lot of fun.  It took me about 4 hours, but I got through it all on my own.  Oh, and with a little help from the Great Google.  I didn't ask the Great Google for the solution, I just looked up reference materials, like the Hebrew alphabet.&lt;br /&gt;&lt;br /&gt;When you complete all the puzzles you get to download this graphic to prove that you solved it.  Yay me!&lt;br /&gt;&lt;br /&gt;I have to give Cambrian House some credit, this is a pretty cool attention grabbing device.  I even like their business plan.  I guess a bunch of programmer types got sick of their jobs and decided to start their own software company.  But wait, they didn't have any idea what software to create.  So here is their scheme.  They solicit cool and innovative ideas from you, the web audience.  You provide them with a great idea and they will make it happen.  And if by some chance your idea actually makes some money, they will give you some of the profits.  This is brilliant.  I think Microsoft should adopt this model as well.  I have some great ideas for them and they owe me a refund for all the zeros that they have sold me anyway.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-115074377113226682?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/115074377113226682/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=115074377113226682' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115074377113226682'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115074377113226682'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/06/i-pwnd-it.html' title='I pwn&apos;d it!'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-115042709010635698</id><published>2006-06-15T20:03:00.000-07:00</published><updated>2006-06-15T20:05:29.116-07:00</updated><title type='text'>Rounding in .NET</title><content type='html'>I was having an issue on at work, where I needed to determine how tall to make a Farpoint Spread row to display some text.  I would calculate the size of some text to be entered into a table cell.  Then I would take the length of the text, based on the font and divide it by the width of the cell and voila, I should have the number of lines that need to be displayed.  However, I was having a problem with some of my tests.  About half of the time, I ended up missing a line.&lt;br /&gt;&lt;br /&gt;As I looked closer I noticed that all of the variables in my calculation were integers.  A ha!  .Net was rounding stuff for me, using its default Banker's Rounding system.&lt;br /&gt;&lt;br /&gt;If you are unfamiliar with Banker's Rounding, or aren't a banker, then this way of rounding may seem insane to you.  Let me explain.  In Banker's Rounding everything works just like in regular rounding, except when dealing with halves.  So anything less than .5 will always round down and anything greater than .5 will always round up.  But when we have exactly .5 then we round to the closest even number.  You are probably used to .5 always rounding up.  This is a little known, yet extremely important behavior and I hope to have saved you some heartache.  Lets see some Bankers Rounding in action:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;1.49 ==&amp;gt; 1&lt;br /&gt;1.50 ==&amp;gt; 2&lt;br /&gt;2.50 ==&amp;gt; 2&lt;br /&gt;2.51 ==&amp;gt; 3&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Back to my issue.  I needed a way to always round up, no matter what the decimal.  Enter the Math.Ceiling function.  The Math.Ceiling function returns the next whole number greater than the decimal that you started with.  Here it is in action:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;System.Math.Ceiling(1.0) ==&amp;gt; 1&lt;br /&gt;System.Math.Ceiling(1.3) ==&amp;gt; 2&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Alternatively, if you want to always round down, you could use the Math.Floor function.  It returns the next lowest whole number from the starting decimal.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;System.Math.Floor(2.0) ==&amp;gt; 2&lt;br /&gt;System.Math.Floor(1.9) ==&amp;gt; 1&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-115042709010635698?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/115042709010635698/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=115042709010635698' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115042709010635698'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/115042709010635698'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/06/rounding-in-net.html' title='Rounding in .NET'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-114978052588052212</id><published>2006-06-08T08:26:00.000-07:00</published><updated>2006-06-08T08:30:44.180-07:00</updated><title type='text'>Internet Explorer's Progress Bar doesn't stop when the page is finished loading.</title><content type='html'>I have an asp.net page that is loaded with Farpoint controls and I use Anthem to make callbacks everytime something is changed in any of the cells.  So every once and while, I experience an issue where a callback starts up the progress bar.  Really, this isn't a problem.  The problem is that the progress bar continues to progress slowly, even after the page is complete and ready to use.  This gives the users that the page is still doing something and they should wait, a long time, before they start making more edits.&lt;br /&gt;&lt;br /&gt;A quick look in google reveiled that the Internet Explorer progress bar was apparently developed by a group of snails, who are not only slow but also of subpar intelligence.  At least that's what the community thinks.  Google also reveiled this &lt;a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;Q320731"&gt;support document&lt;/a&gt;.   Even Farpoint recognizes this problem and you can read about it &lt;a href="http://www.clubfarpoint.com/Forums/ShowPost.aspx?PostID=13345"&gt;here&lt;/a&gt;.  Here's the gist.  When you dynamically insert behaviors in your page, the progress bar gets dazed and confused. If you use the Farpoint spread, you know that this happens a lot.  We can set the progress bar back on the right track by writing something to the status bar.  I'm guessing that this resets the whole footer in IE.&lt;br /&gt;&lt;br /&gt;I am now reseting the status bar on the window.load event and everytime I handle a callback in Anthem. It seems to have corrected my issue.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-114978052588052212?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/114978052588052212/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=114978052588052212' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/114978052588052212'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/114978052588052212'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/06/internet-explorers-progress-bar-doesnt.html' title='Internet Explorer&apos;s Progress Bar doesn&apos;t stop when the page is finished loading.'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-114953326481976068</id><published>2006-06-05T10:04:00.000-07:00</published><updated>2006-06-05T11:47:44.873-07:00</updated><title type='text'>Reign in the track wheel in IE</title><content type='html'>I work on a lot of  ASPX pages and  IE is currently the default browser for the enterprise.   I'm sure that you have workied with IE before too.  Here's a little quirk that has been especially troublesome for my team and I lately.&lt;br /&gt;&lt;br /&gt;Have you ever clicked on a dropdown box, made a selection and then moved the mouse out of the dropdown box and started to scroll the page with your mouse's track wheel?  Then you know that in IE the page doesn't scroll, the items in the dropdown do.  This can be a real headache since everytime the dropdown list item changes it fires off an event.  And God help you if that event is tied to an AJAX callback.&lt;br /&gt;&lt;br /&gt;Luckily, there is a way around this.  A buddy of mine on the team found this &lt;a href="http://www.universal-webnames.com/web-sites/ie6-mousewheel.html"&gt;article &lt;/a&gt;to explain everything.  You just have to handle the 'onmousewheel' event.  See the sample:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;select name="mylist" onmousewheel="return(false);"&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Note: You don't have to worry about this in FireFox&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-114953326481976068?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/114953326481976068/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=114953326481976068' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/114953326481976068'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/114953326481976068'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/06/reign-in-track-wheel-in-ie.html' title='Reign in the track wheel in IE'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-114924962242088203</id><published>2006-06-02T04:52:00.000-07:00</published><updated>2006-06-02T05:22:40.813-07:00</updated><title type='text'>Cellular Squirrel!</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/7994/2984/1600/cellularsquirrel.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://photos1.blogger.com/blogger/7994/2984/320/cellularsquirrel.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;I have received several positive comments about the &lt;a href="http://allen-mack.blogspot.com/2006/05/ba-donk-donk.html"&gt;Badonkadonk post&lt;/a&gt;, so I thought I might make a segment out of it.  From here on out, every Friday, I will try to bring you yet another demonstration of technology run amuck.  And to keep it relevant, I'll draw a correlation of some sort.  I have yet to come up with a good name.  Maybe my loyal readers will offer some suggestions (this is a blatent attemp to get you to comment on this post). Now onto the good stuff.&lt;br /&gt;&lt;br /&gt;Before we get to the finished product, let's take a look at the underlying technology which is really cool.  Stefan Marti at the MIT Media Lab has developed an intermediary conversation agent for use with your cellphone.  Basically it acts like a call screener.  When you get an incoming call the agent picks up the line and interrogates the caller.  If the caller is on a whitelist and they don't seem too agitated, then the agent will alert you that you have a call that you want to take.  It's like having your own personal secretary.  I've always wanted one of those.&lt;br /&gt;&lt;br /&gt;Now, let's get creepy.  As with all good projects, if you get too intense you run the risk of going insane. Case in point, &lt;a href="http://en.wikipedia.org/wiki/Apocalypse_Now"&gt;Apocalypse Now&lt;/a&gt;.  I think the designers walked right up to the line and boldly crossed it without looking back.  Let's listen into the designers as they deal with how to package their new technology.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;[Designer One]:&lt;/span&gt; We've created a cool technology that will forever change the way we use our cell phones!&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;[Designer Two]:&lt;/span&gt; Brilliant!&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;[Designer One]:&lt;/span&gt; Look I'm getting a call right now.  Hello?...  Hi Timmy...  You did what?... I thought I told you never to play with the beakers... but... alright, I'll clean it up when I get there. &amp;lt;click&amp;gt; &lt;a href="http://www.retrojunk.com/details_tvquotes.php?main_id=63"&gt;Looks like we're going to need another Timmy! &lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;[Designer Two]:&lt;/span&gt; Brilliant!&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;[Designer One]:&lt;/span&gt; I know, lets take our new technology and stuff it into an animitronic plush toy fashioned in the image of a cute, cuddly squirrel.  Except we'll give the squirrel red, beady eyes and make it shake uncontrollably while we say scary things to Timmy through it.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;[Designer Two]:&lt;/span&gt; Brilliant!&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;[Designer One]:&lt;/span&gt; HAHAHAHAHA... (Maniacal laughter lasting well into the night.)&lt;br /&gt;&lt;br /&gt;And so was born the &lt;a href="http://web.media.mit.edu/%7Estefanm/phd/cellularsquirrel/"&gt;Cellular Squirrel&lt;/a&gt;.  Take a look at the pictures, it actually has blood red, beady eyes.  There is also a plan for a &lt;a href="http://www.thinkgeek.com/geektoys/plush/778d/"&gt;bunny version.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Todays Correlation:  As developers we often take a cool technology and wrap it in a cute and cuddly UI.  Maybe I'll give my next UI beady eyes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-114924962242088203?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/114924962242088203/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=114924962242088203' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/114924962242088203'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/114924962242088203'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/06/cellular-squirrel.html' title='Cellular Squirrel!'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-114916586529967455</id><published>2006-06-01T05:39:00.000-07:00</published><updated>2006-06-01T05:53:46.033-07:00</updated><title type='text'>Music and Productivity</title><content type='html'>Last night our team got together in a war room type setup where we all converged into one room with our laptops to help solve some of our outstanding issues with our current project.  One of the guys used his laptop for a jukebox so we would have some background noise.  It was a pretty eclectic collection and I enjoyed all of the selections, especially &lt;a href="http://www.queensryche.com"&gt;Queensrÿche&lt;/a&gt;'s Silent Lucidity.  &lt;span style="font-weight: bold;"&gt;Queensrÿche Rules!!!&lt;/span&gt;  And as much as I like the &lt;a href="http://www.beastieboys.com"&gt;Beastie Boys&lt;/a&gt;, I couldn't help feel more relaxed and focused during songs like Silent Lucidity.  So it got me thinking about music's affect on my mood, concentration and productivity.&lt;br /&gt;&lt;br /&gt;Can music actually make you more productive or help your concentration?  In his article, &lt;a href="http://www.howtoadvice.com/Preview/Bumhav"&gt;"Does listening to music improve productivity"&lt;/a&gt;, Michael Setton shows that it does.  He sites a study that showed people who listened to music while they worked actually increased productivity by 10%.  Listening to music with an upbeat rhythm can reduce stress hormone levels by as much as 41%.  Apparently even cows produce more milk when listening to the right music.&lt;br /&gt;&lt;br /&gt;In the spirit of &lt;a href="http://www.listibles.com"&gt;Listibles&lt;/a&gt;, I have compiled my top 5 Artist/Albums for increasing my concentration and productivity while I work.  They are all What are yours?&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.chromakey.com"&gt;Chroma Key&lt;/a&gt;  - Dead Air For Radios&lt;br /&gt;&lt;a href="http://www.osiband.com"&gt;OSI&lt;/a&gt;  - OSI&lt;br /&gt;&lt;a href="http://www.toolband.com"&gt;Tool&lt;/a&gt;  - Aenima&lt;br /&gt;&lt;a href="http://www.pinkfloyd.com"&gt;Pink FLoyd&lt;/a&gt; - The Delicate Sound of Thunder (I know its a double cd)&lt;br /&gt;&lt;a href="http://www.porcupinetree.com"&gt;Porcupine Tree&lt;/a&gt; - Stupid Dream&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-114916586529967455?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/114916586529967455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=114916586529967455' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/114916586529967455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/114916586529967455'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/06/music-and-productivity.html' title='Music and Productivity'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-114909692683003440</id><published>2006-05-31T10:26:00.000-07:00</published><updated>2006-05-31T10:36:29.906-07:00</updated><title type='text'>Javascript Debugging Hint</title><content type='html'>Often times I feel like I have to be a cross between Gil Grisom and Sherlock Holmes when I'm trying to debug a javascript error.  So I get very excited when I find a tool or technique to help me.  So far my favorite tool is the &lt;a href="http://www.mozilla.org/projects/venkman/"&gt;Venkman &lt;/a&gt;javascript debugger, despite rumors that it crashes on some machines.&lt;br /&gt;&lt;br /&gt;The other day a co-worker mentioned that enabling the script debugging in Internet Explorer allowed Visual Studio to debug javascript in your site.  You can do this by going into IE &gt; Tools &gt; Iternet Options &gt; Advanced and unchecking the "Disable Script Debugging (Internet Explorer)" option.  This was very exciting, a way to debug javascript directly in the IDE.  It still didn't get rid of those cryptic IE errors, but at least you would break in the IDE.  If you want to get better error messages, use &lt;a href="http://www.mozilla.org/projects/venkman/"&gt;Venkman&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Anyway, back to the task at hand.  I noticed the other day that Visual Studio's CallStack window works while debugging javascript.  Let's perform an exercise to see how useful this could be.  Suppose you have a javascript function that is called from several different places.  If that function threw an error, the call stack information could help determine what called it.  Take a look at this simple page:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml" &amp;gt;&lt;br /&gt;&amp;lt;head runat="server"&amp;gt;&lt;br /&gt;   &amp;lt;title&amp;gt;Test Page&amp;lt;/title&amp;gt;&lt;br /&gt;   &amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;       function runtest1()&lt;br /&gt;       {&lt;br /&gt;           test(true);&lt;br /&gt;       }&lt;br /&gt;       function runtest2()&lt;br /&gt;       {&lt;br /&gt;           test(false);&lt;br /&gt;       }&lt;br /&gt;       function test(x)&lt;br /&gt;       {&lt;br /&gt;           if(x == false)&lt;br /&gt;              throw("New Error");&lt;br /&gt;       }&lt;br /&gt;   &amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;   &amp;lt;form id="form1" runat="server"&amp;gt;&lt;br /&gt;   &amp;lt;div&amp;gt;&lt;br /&gt;       &amp;lt;input type="button" &lt;br /&gt;       onclick="javascript:runtest1();runtest2();" &lt;br /&gt;       value="Push Me" /&amp;gt;&lt;br /&gt;   &amp;lt;/div&amp;gt;&lt;br /&gt;   &amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;When you click on the button, runtest1 will execute successfully and runtest2 will throw an error.  Now pretend that you don't know exactly where the error was coming from.  Take a look at the stack trace and see if you can figure it out.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/7994/2984/1600/JSDebugCallStack.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://photos1.blogger.com/blogger/7994/2984/320/JSDebugCallStack.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-114909692683003440?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/114909692683003440/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=114909692683003440' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/114909692683003440'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/114909692683003440'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/05/javascript-debugging-hint.html' title='Javascript Debugging Hint'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-114900595570350241</id><published>2006-05-30T09:17:00.000-07:00</published><updated>2006-05-30T11:54:38.746-07:00</updated><title type='text'>I Love Lists</title><content type='html'>Everyone loves a list, right?  Well, a lot of us do.  We watch Letterman because his &lt;a href="http://www.cbs.com/latenight/lateshow/top_ten/"&gt;top ten lists&lt;/a&gt; are funny.  We go Hanselman's website for his &lt;a href="http://www.hanselman.com/blog/ScottHanselmans2005UltimateDeveloperAndPowerUsersToolList.aspx"&gt;ultimate list of tools&lt;/a&gt;.  We love to see what other people find important and compare their lists with our own.  I find that lists are a great way to find out about tools and sites that I wouldn't have found otherwise.&lt;br /&gt;&lt;br /&gt;For the most part, lists are cool.  This is why &lt;a href="http://www.listible.com"&gt;Listible &lt;/a&gt;is cool.  Listible is kind of like &lt;a href="http://www.digg.com"&gt;Digg&lt;/a&gt; and &lt;a href="http://del.icio.us"&gt;Del.icio.us&lt;/a&gt;  got together and had a really cool baby, and named it Listible.  Here's how it works. Basically, someone requests that a list be created to cover a topic.  Then the public is free to add items to the list and tag them like in del.icio.us.  But what makes this site special, is the public's ability to vote for an item thereby driving it up the list.  The public sets the relevancy of all the items in the list.  So when you view a list, you can be relatively confident that the best stuff is at the top.&lt;br /&gt;&lt;br /&gt;You can even vote for the relevancy of the list itself, which will determine how that list ranks compared to other lists.  However, I'm a little unclear about this.  I can understand one site being a better .NET reference than another site.  But, can you really say that a list of .NET reference sites is more important than a list of Wedding Planning sites?  It seems to me that importance is in the eye of the beholder.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-114900595570350241?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/114900595570350241/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=114900595570350241' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/114900595570350241'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/114900595570350241'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/05/i-love-lists.html' title='I Love Lists'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-114855938187300311</id><published>2006-05-25T05:15:00.000-07:00</published><updated>2006-05-25T05:16:21.880-07:00</updated><title type='text'>IE/Clipboard Security Risk</title><content type='html'>Have you ever wondered what information a web server can glean from you when you visit a site?  You can find out on the &lt;a href="http://projectip.com/"&gt;Project IP&lt;/a&gt; web site.  I was really surprised at some of the stuff the site found about my pc and web session.  Sure, I expected it to know my IP address, browser version, whether or not cookies were enabled, etc.  However, I was surprised to find a list of all the plugins I have installed in my browser and the number of pages that I have viewed in my current web session. &lt;br /&gt;&lt;br /&gt;But here's the real kicker, the last text item you copied onto your clipboard! Only works in Internet Explorer on the Windows platform. If you aren't using FireFox by now, maybe this will sway you.  It reportedly works with varied success when IE is running in an emulator such as VMWare on another OS.  Have you ever copied a password or credit card number or ssn and pasted it into anywhere?  Hopefully, it wasn't right before you browsed a site that took advantage of this.&lt;br /&gt;&lt;br /&gt;Luckily there is a fix:&lt;br /&gt;Go to Tools &gt; Internet Options &gt; Security &gt; Select a security zone &gt; Custom Level &gt; Scripting &gt; Allow paste operations via script and set it to Disabled or Prompt.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-114855938187300311?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/114855938187300311/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=114855938187300311' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/114855938187300311'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/114855938187300311'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/05/ieclipboard-security-risk.html' title='IE/Clipboard Security Risk'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-114852146638369907</id><published>2006-05-24T18:43:00.000-07:00</published><updated>2006-05-24T18:44:26.396-07:00</updated><title type='text'>Windows Shortcut Keys</title><content type='html'>I'm always looking for cool keyboard short cuts to help me be more productive in my applications.  For example, Visual Studio has a gazillion shortcut keys that enables you to do just about anything without the mouse.  I find that while I'm coding, the less time I use switching back and forth between the keyboard and the mouse the more I get done.  But what if you aren't in your favorite development environment.  Here is a great list of &lt;a href="http://www.codinghorror.com/blog/archives/000378.html"&gt;windows shortcut keys&lt;/a&gt; from CodingHorror.&lt;br /&gt;&lt;br /&gt;If you wish to expand on this list, you might want to try &lt;a href="http://www.softpedia.com/progDownload/WinKey-Download-887.html"&gt;Winkeys&lt;/a&gt;.  Winkeys allows you to use the Windows key to create keyboard shortcuts for your favorite applications.  Here is a list of the ones that I have added.  For example, I use Windows + Shift + V to open Visual Studio 2005.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-114852146638369907?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/114852146638369907/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=114852146638369907' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/114852146638369907'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/114852146638369907'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/05/windows-shortcut-keys.html' title='Windows Shortcut Keys'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-114833981917640393</id><published>2006-05-22T16:15:00.000-07:00</published><updated>2006-05-23T05:30:28.003-07:00</updated><title type='text'></title><content type='html'>The &lt;a href="http://orange.blender.org"&gt;Orange Movie project&lt;/a&gt; has just released their animated short, The Elephant's Dream.  The project was sponsored by the &lt;a href="http://www.blender.org"&gt;Blender &lt;/a&gt;Foundation, an opensource community around the Blender 3D modeling, animation and rendering application.  The Orange Movie Project's stated goals were to create an outstanding movie short, and to research efficient ways to increase quality of Open Source projects in general.&lt;br /&gt;&lt;br /&gt;The short is nothing less than awesome. I've already downloaded it, you can get it and the project files that were used to make it on their &lt;a href="http://orange.blender.org"&gt;web site&lt;/a&gt;.  It makes me want to try my hand at 3d modeling and animation.&lt;br /&gt;&lt;br /&gt;I had to download and install &lt;a href="http://www.mplayerhq.hu"&gt;MPlayer &lt;/a&gt;to get it to play.  MPlayer is currently a console application for Windows.  However, there are frontends available for download.  &lt;a href="http://mpf.dzm.hu/"&gt;Here is one&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-114833981917640393?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/114833981917640393/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=114833981917640393' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/114833981917640393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/114833981917640393'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/05/orange-movie-project-has-just-released.html' title=''/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-114798145501491408</id><published>2006-05-18T12:41:00.000-07:00</published><updated>2006-05-18T14:23:24.033-07:00</updated><title type='text'>Ba-donk-a-donk!</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/7994/2984/1600/donk-feat1%5B1%5D.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://photos1.blogger.com/blogger/7994/2984/200/donk-feat1%5B1%5D.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Now what I'm about to share with you is either a testament to marketing genius or my stupidity.  But if loving this stuff is wrong, I don't want to be right.  I came across this site by &lt;a href="http://www.naodesign.net"&gt;NAO Design&lt;/a&gt;, who describe themselves as, and I quote:&lt;br /&gt;&lt;br /&gt;"...a multidisciplinary design firm with a focus on automotive design, architecture, pyrotechnics, lighting, furniture, electronics, signage, and web and graphic design, and often the fusion of several such diverse elements."&lt;br /&gt;&lt;br /&gt;Wow, there's a mouthful.  So what makes these guys so special?  One word, "Badonkadonk".  The Badonkadonk is a personal motorized, armored transport with head/tail lights, turn signals, accent and underbody lights, 400 watt premium sound with PA system, and... Oh yeah, and an optional pyrotechnic system that shoots flames out the top.  This product became so popular(how?) that it garnered its own &lt;a href="http://"&gt;web site&lt;/a&gt;. I think the inception went a little like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Designer 1:  &lt;/span&gt;I'll bet I can fit my fist in my mouth.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Designer 2:&lt;/span&gt;  I'll bet I can sell a go-cart on &lt;a href="http://www.amazon.com/exec/obidos/tg/stores/detail/-/miscellaneous/B00067F1CE/qid%3D1147974562/sr%3D11-1/ref%3Dsr%5F11%5F1/002-4905130-9172032"&gt;Amazon&lt;/a&gt; for 20 grand.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Designer 1:&lt;/span&gt;  How the hell are you going to do that?&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Designer 2:&lt;/span&gt;  Easy, I'll just armor plate it and throw in a stereo.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Designer 1:&lt;/span&gt;  You know what would be cool?  If it shot fire.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Designer 2:&lt;/span&gt;  eh, eh... fire...  sweeet.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;SideNote:&lt;/span&gt; I can't not talk about the PneumatiPak 2, also found on the &lt;a href="http://www.naodesign.net/"&gt;NAO Design&lt;/a&gt; website.  Basically a pneumatic powered handheld cannon.  So what makes this so much better that your average nail gun that you could pick at Homedepot?  I swear I'm not making this up. "With a removable 1.5L liquid reservoir for shooting water, paint, beer, etc. New rotary reloading breech-loader mechanism allows for very rapid reloading of solid ammo, such as hotdogs, marshmallow, batteries, tampons, and carrots.  With a maximum range of 100 yards."  Priceless... Speechless...&lt;br /&gt;&lt;br /&gt;Back to the Badonkadonk and why it inspired this blog.  The Badonkadonk is cool, but I don't need all that stuff.  Have you every used a piece of software that made you feel the same way?  Have you every coded software that made you or the client feel that way?  We sometimes have the tendancy to gravitate towards flashy things with lots of cool features that we never use because we don't need them.  &lt;a href="http://news.zdnet.co.uk/hardware/chips/0,39020354,39194880,00.htm"&gt;Gordon Moore&lt;/a&gt;  recently noted that software has become so complex that it prevents the users from making effective use of the underlying power of their computer.  It may be too late for a new years resolution, but the Badonkadonk and my Badonkadonk project, have me picking up and dusting of the old development ethos: "Keep it simple stupid."&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-114798145501491408?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/114798145501491408/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=114798145501491408' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/114798145501491408'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/114798145501491408'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/05/ba-donk-donk.html' title='Ba-donk-a-donk!'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-114780112347701429</id><published>2006-05-16T10:34:00.000-07:00</published><updated>2006-05-17T11:03:16.733-07:00</updated><title type='text'>Cool Atlas information from Jeff Prosise</title><content type='html'>Yesterday we had a very interesting lunch and learn session on the topic of Atlas.   The speaker was Jeff Prosise, co-founder of &lt;a href="http://www.wintellect.com/"&gt;Wintellect&lt;/a&gt;.  Jeff was an excellent speaker.  I learned a lot in the little time that we had.  Here is a breakdown of Jeff's presentation.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1. Introductions&lt;/span&gt;&lt;br /&gt;Jeff started out the presentation with a brief overview of Atlas.  Atlas is Microsoft's upcoming AJAX framework.  It is only compatible with ASP.NET, so you have to serve it from IIS.  It is also only compatible with .NET 2.0 and higher.  There will be no backwards compatibility with .NET 1.x.  I was under the impression that Atlas was a mostly server side technology.  However, using the XML scripting language, you can do just about everything on the client side.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2. Ajax support already built into ASP.NET&lt;/span&gt;&lt;br /&gt;Jeff demonstrated that there is already support for AJAX built into ASP.NET 2.0.  You just have to do a little bit of coding to get it to work. Basically you implement the ICallBackEventHandler interface on your page and then grab a reference to the javascript function that you wish to return to.  Here is a page and the code-behind that demonstrates using AJAX in an ASP page.&lt;br /&gt;ASPX:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt; &amp;lt;script language="javascript" type="text/javascript"&amp;gt;&lt;br /&gt;    function MultiplyByTwo()&lt;br /&gt;    {&lt;br /&gt;        var tb = document.getElementById("txtNumber");&lt;br /&gt;        var value = tb.value;&lt;br /&gt;        CallServer(value, "");&lt;br /&gt;    }&lt;br /&gt;    function DisplayResult(rValue)&lt;br /&gt;    {&lt;br /&gt;        document.getElementById("lblResult").innerHTML = rValue;&lt;br /&gt;    }&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;form id="form1" runat="server"&amp;gt;&lt;br /&gt; &amp;lt;div&amp;gt;&lt;br /&gt;     &amp;lt;input id="txtNumber" type="text"&amp;gt; * 2&lt;br /&gt;     &amp;lt;input onclick="MultiplyByTwo();" value="=" type="button"&amp;gt;&lt;br /&gt;     &amp;lt;asp:label id="lblResult" runat="server"&gt;&amp;gt;&lt;br /&gt; &amp;lt;/asp:label&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt; &amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Code-behind:&lt;br /&gt;&lt;code&gt;public partial class _Default : System.Web.UI.Page, ICallbackEventHandler&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;protected string returnValue;&lt;br /&gt;&lt;br /&gt;protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;string cbReference = Page.ClientScript.GetCallbackEventReference(this, "arg", "DisplayResult", "context");&lt;br /&gt;string callbackScript = "function CallServer(arg, context){" + cbReference + ";}";&lt;br /&gt;Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "CallServer", callbackScript, true);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#region ICallbackEventHandler Members&lt;br /&gt;&lt;br /&gt;public string GetCallbackResult()&lt;br /&gt;{&lt;br /&gt;return returnValue;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void RaiseCallbackEvent(string eventArgument)&lt;br /&gt;{&lt;br /&gt;if (!String.IsNullOrEmpty(eventArgument))&lt;br /&gt;{&lt;br /&gt;  int arg = int.Parse(eventArgument);&lt;br /&gt;  arg *= 2;&lt;br /&gt;  this.returnValue = arg.ToString();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#endregion&lt;br /&gt;}&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;3. Framework&lt;/span&gt;&lt;br /&gt;When a page containing atlas controls is requested, Atlas sends a copy of its framework down     to the client machine.  The framework is written completely in javascript.  Since most browsers cache javascript, the framework should only be downloaded once, instead of everytime you hit page with an Atlas control.   Jeff also mentioned that the release version will contain a browser abstraction layer.  This layer will be responsible for making sure your code runs correctly no matter what browser it is displayed in.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;4. Clientside Focus&lt;/span&gt;&lt;br /&gt;For the clientside, Jeff focused on Atlas' XML scripting language.  Most of the examples used very little server side code.   The framework parsed the script and generated the necessary javascript to perform the actions.   Here is an example of some XML script that displays a panel when you click on a button.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;script type="text/xml-script"&amp;gt;&lt;br /&gt;  &amp;lt;button id="showButton"&amp;gt;&lt;br /&gt;    &amp;lt;click&amp;gt;&lt;br /&gt;      &amp;lt;setProperty target="panel" property="visible" value="true" /&amp;gt;&lt;br /&gt;    &amp;lt;/click&amp;gt;&lt;br /&gt;  &amp;lt;/button&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;5. Serverside Focus&lt;/span&gt;&lt;br /&gt;For the serverside, Jeff showed off some "Extender" controls.  Most noteable the MSN Earth control that hits the same servers as &lt;a href="http://local.live.com"&gt;Windows Live Local&lt;/a&gt;.  There isn't a lot of documentation out there for these, but they seem really cool.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-114780112347701429?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/114780112347701429/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=114780112347701429' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/114780112347701429'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/114780112347701429'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/05/cool-atlas-information-from-jeff.html' title='Cool Atlas information from Jeff Prosise'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-114779136745682019</id><published>2006-05-16T07:55:00.000-07:00</published><updated>2006-05-16T07:56:07.460-07:00</updated><title type='text'>WinFX SDK killed my download</title><content type='html'>I am extremely keen on XML technologies.  I don't claim to be an expert, but I think that they are pretty cool.  Recently I have become more and more interested in the prospect of using Flash like technologies to boost the user experience on my web sites.  My search led me to &lt;a href="http://www.xaml.net/"&gt;XAML&lt;/a&gt;.  &lt;a href="http://www.xaml.net/"&gt;XAML&lt;/a&gt; is cool.  I haven't actually written anything in XAML, but the demo's on the web are sweet. &lt;br /&gt;&lt;br /&gt;What's that you're saying?  Why haven't I written anything in XAML yet.  I'll tell you why. Because it took almost 4 freak'n hours to get the stuff installed and return my machine to working order, that's why! I don't that kind time.  Sure I love watching paint dry as much as the next guy, but seriously!  James Robertson has any excellent &lt;a href="http://www.squidoo.com/xaml"&gt;Squidoo lense for XAML&lt;/a&gt; that includes a section on what you need to download and the installation order.  Here's a break down of the installation steps and how long it took for each one.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;1. WinFX Runtime Components - couple of minutes:&lt;/b&gt; This is all you need to view XAML files on your machine. But if your like me, and want to actually write an application you'll need the...&lt;br /&gt;&lt;br /&gt;&lt;b&gt;2. WinFX SDK - 3+ hours:&lt;/b&gt;  Holy creeping downloads Batman!  Its a good thing my hard drive had an extra gig of free space.  I kid you not, 1.2 gigs.  Maybe I should have limited what I wanted to install, but it all looked so delicious.  This is why they shouldn't let me eat at buffets.  The only thing that I turned off in the install was the 64-bit processor support and Monad (more on that later).&lt;br /&gt;&lt;br /&gt;&lt;b&gt;3. Optional Development Tools - 30 minutes:&lt;/b&gt; The install took longer than the download.&lt;br /&gt;&lt;br /&gt;At this point I am already frustrated with the SDK install, but I made it through and thought that a reboot was in order.  You don't have to reboot, I'm just weird.  Anyway, I tried to open up a Powershell instance after the reboot and recieved an error.  That's odd.  Powershell was working before.  Wait a minute, where's my powershell install directory?!!!  I guess when I told the SDK not to install Monad (because I already had Powershell installed), &lt;span style="color:#ff0000;"&gt;&lt;b&gt;THE SDK UNISTALLED POWERSHELL!!!&lt;/b&gt;&lt;/span&gt;  I don't even know how.  Monad installs under a completely different directory.  So that led me to...&lt;br /&gt;&lt;br /&gt;&lt;b&gt;4. Microsoft Powershell RC1 - 5-10 minutes:&lt;/b&gt;  PowerShell rules! Reinstalling sucks!&lt;br /&gt;&lt;br /&gt;Alright now its time for a "hello world" application.  Wish me luck.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-114779136745682019?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/114779136745682019/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=114779136745682019' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/114779136745682019'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/114779136745682019'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/05/winfx-sdk-killed-my-download.html' title='WinFX SDK killed my download'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28209705.post-114779101670486839</id><published>2006-05-16T07:36:00.000-07:00</published><updated>2006-05-16T07:50:16.713-07:00</updated><title type='text'>Welcome to my blog</title><content type='html'>One of my new job "requirements" is to blog to an internal blog.  But I thought that some of my more technical and less jobby posts should be shared with the rest of the world.  And since I am so cheap, I started this blog for free. &lt;br /&gt;&lt;br /&gt;A little about me. I'm an Advanced Software Engineer working with C# and creating mostly web applications.  I love xml technologies and am trying to give up the mouse while I'm programming.  This is turning out to be very difficult when working on web apps.  So expect to see more blogs in those arenas.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28209705-114779101670486839?l=allen-mack.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://allen-mack.blogspot.com/feeds/114779101670486839/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28209705&amp;postID=114779101670486839' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/114779101670486839'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28209705/posts/default/114779101670486839'/><link rel='alternate' type='text/html' href='http://allen-mack.blogspot.com/2006/05/welcome-to-my-blog.html' title='Welcome to my blog'/><author><name>Allen Mack</name><uri>http://www.blogger.com/profile/12211936604263198206</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
