<?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-6179682925625902039</id><updated>2012-02-09T09:42:24.025Z</updated><title type='text'>Simon Hughes</title><subtitle type='html'>Software should not break. It should just work. Forever. No matter what...</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://simon-hughes.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>39</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-411054743545741612</id><published>2012-01-27T11:38:00.001Z</published><updated>2012-02-09T09:42:24.119Z</updated><title type='text'>www.lizigns.com</title><content type='html'>Just finished a new website for a friend called &lt;a href="http://lizigns.com/"&gt;lizigns.com&lt;/a&gt;&lt;br /&gt;I played with three CMS systems: &lt;a href="http://www.joomla.org/"&gt;Joomla&lt;/a&gt;, &lt;a href="http://www.concrete5.org/"&gt;concrete5&lt;/a&gt; and finally settled on &lt;a href="http://wordpress.org/"&gt;WordPress &lt;/a&gt;CMS system.&lt;br /&gt;&lt;br /&gt;Overall I spent about 13 hours on the website, 6 of which were  sorting out the photo's and correcting them as they were poor quality.  Liz didn't use flash, so the camera correctly exposed the view through the  window, but left the curtains in the dark.&lt;br /&gt;&lt;br /&gt;I'm pleased with the result. It looks fresh and has all the meta tags Liz wanted. Plus is quick and snappy to use.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-size: small;"&gt;My views on the CMS systems I tried:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Jooma &lt;/b&gt;has good customisation of templates, and a very good admin side of things, but its actually quite slow in use.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Concrete5 &lt;/b&gt;is excellent in everyway, apart from one major stumble. You can't modify any of the template colours in the admin panel. I couldn't find the right template I wanted, so I ditched it.&lt;/li&gt;&lt;li&gt;&lt;b&gt;WordPress&lt;/b&gt;. Good admin panel, so I was confident Liz could use it to edit her pages after I handed it over. And it has lots and lots of free template and plugins (like a gallery) to choose from.&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/6179682925625902039-411054743545741612?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://lizigns.com/' title='www.lizigns.com'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/411054743545741612'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/411054743545741612'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2012/01/wwwlizignscom.html' title='www.lizigns.com'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-2240010011399479244</id><published>2011-07-20T10:29:00.000+01:00</published><updated>2011-07-20T10:29:36.877+01:00</updated><title type='text'>Microsoft's 'Roslyn' compiler as a service project</title><content type='html'>&lt;span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font-family: Times; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="color: #222222; font-family: 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 15px;"&gt;Microsoft plans to share more information on its "Roslyn" compiler-as-a-service (CaaS) project during its annual Microsoft Research Faculty Summit this week.&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Roslyn, at a high level, is Microsoft's vehicle for "taking .Net to the cloud." Microsoft's stated goal with Roslyn is to "build a compiler architecture that is amenable to use as a foundation for modern tools."&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.zdnet.com/blog/microsoft/microsoft-moves-forward-with-roslyn-compiler-as-a-service-project/10071" style="border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #0e64ab; font-family: inherit; font-size: 12px; font-style: inherit; font-weight: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none; vertical-align: baseline;" target="_blank" title="http://www.zdnet.com/blog/microsoft/microsoft-moves-forward-with-roslyn-compiler-as-a-service-project/10071"&gt;http://www.zdnet.com/blog/microsoft/…&lt;/a&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="remaining-body" style="border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: inherit; font-size: 12px; font-style: inherit; font-weight: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;You can do all sorts of fancy tricks with the compiler pipeline, like automatic parallelization for example.&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I forsee compiler add-in companies sprouting up all over the place now. Development teams will have to agree on what add-ins to use, possibly even the ordering of the add-ins, so that the exe's match. Build-servers will have to include this technology, unless you can config the compiler+addins outside of FinalBuilder.&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;Overall I see this is as a good thing, a bit like Firefox+add-ins. But I fear there will be only a few real gems, and a ton of dross out there&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6179682925625902039-2240010011399479244?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/2240010011399479244'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/2240010011399479244'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2011/07/microsofts-roslyn-compiler-as-service.html' title='Microsoft&apos;s &apos;Roslyn&apos; compiler as a service project'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-3662792012239440358</id><published>2011-06-07T14:01:00.000+01:00</published><updated>2011-06-07T14:01:48.812+01:00</updated><title type='text'>How to stop Skype crashing upon startup</title><content type='html'>Open a command prompt and run the following:&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;c:&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;cd\users&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;del shared.xml /s&lt;/div&gt;&lt;br /&gt;Now you can run skype without it crashing.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6179682925625902039-3662792012239440358?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/3662792012239440358'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/3662792012239440358'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2011/06/how-to-stop-skype-crashing-upon-startup.html' title='How to stop Skype crashing upon startup'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-2780597684624497467</id><published>2011-05-17T15:49:00.000+01:00</published><updated>2011-05-17T15:49:13.221+01:00</updated><title type='text'>Setting the PowerShell execution policy - the trap</title><content type='html'>I was recently pulling my hair out trying to run a powerShell script in VisualStudio. I kept getting the error: "File SomeScript.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help about_signing" for more details."&lt;br /&gt;&lt;br /&gt;So I ran the script:&lt;br /&gt;&lt;b&gt;powershell set-executionpolicy remotesigned&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Tried a gain, and still it fails! Only until I spoke to my developer collegue &lt;a href="http://www.shadow-angel.com/blog/"&gt;Damian Powell&lt;/a&gt; did he say you actually have to run that command for both x86 and x64 powershells.&lt;br /&gt;&lt;br /&gt;So I ran:&lt;br /&gt;&lt;b&gt;C:\Windows\System32\WindowsPowerShell\v1.0\powershell set-executionpolicy remotesigned&lt;br /&gt;C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell set-executionpolicy remotesigned&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Hey presto! All works. Thanks Damian!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6179682925625902039-2780597684624497467?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/2780597684624497467'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/2780597684624497467'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2011/05/setting-powershell-execution-policy.html' title='Setting the PowerShell execution policy - the trap'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-304421373876132205</id><published>2011-03-14T22:28:00.004Z</published><updated>2012-02-02T16:46:03.368Z</updated><title type='text'>Service Broker sys.transmission_queue clean up</title><content type='html'>If you’re developing a Service Broker application and you misspell your services, forget to create a master key, or do any of the many things that result in your messages not being delivered, then your transmission queue will fill up.&lt;br /&gt;Due to the nature of service broker, errors don't occur at the client but rather your messages go in to Service Brokers &lt;b&gt;sys.transmission_queue&lt;/b&gt; and are then subsequently processed. If they fail, they stay in the queue. Some errors can be resolved, i.e. missing services. However, others can't, or are just plain difficult. I.e. You've misspelt something, or not used the correct security.&lt;br /&gt;To clear your transmission queue you need to end the conversations, this is a handy little script for doing this. Be aware this ends ALL conversations in the queue and so should NEVER be used on a production system.&lt;br /&gt;&lt;br /&gt;To see how many messages are in your transmission queue, use this&lt;br /&gt;&lt;pre style="background: none repeat scroll 0% 0% white; color: black; font-family: Courier New; font-size: 13px;"&gt;&lt;span style="color: blue;"&gt;SELECT&lt;/span&gt;&amp;nbsp;&lt;span style="color: magenta;"&gt;COUNT&lt;/span&gt;&lt;span style="color: grey;"&gt;(&lt;/span&gt;1&lt;span style="color: grey;"&gt;)&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;FROM&lt;/span&gt;&amp;nbsp;&lt;span style="color: green; font-weight: bold;"&gt;sys&lt;/span&gt;&lt;span style="color: grey;"&gt;.&lt;/span&gt;&lt;span style="color: green; font-weight: bold;"&gt;transmission_queue&lt;/span&gt;&lt;br /&gt; &lt;/pre&gt;On my system i7, DB on Raid10, Log on Raid1, the following clears messages at approximately 20000/second.&lt;br /&gt;&lt;br /&gt;&lt;script type="syntaxhighlighter" class="brush: sql"&gt;&lt;![CDATA[DECLARE item_cursor CURSOR LOCAL FAST_FORWARD FOR&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT conversation_handle FROM sys.transmission_queueOPEN item_cursorDECLARE @conversation UNIQUEIDENTIFIERFETCH NEXT FROM item_cursor INTO @conversationWHILE @@FETCH_STATUS = 0 BEGIN&amp;nbsp;&amp;nbsp;&amp;nbsp; END CONVERSATION @conversation WITH CLEANUP&amp;nbsp;&amp;nbsp;&amp;nbsp; FETCH NEXT FROM item_cursor INTO @conversationEND]]&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6179682925625902039-304421373876132205?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/304421373876132205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/304421373876132205'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2011/03/service-broker-systransmissionqueue.html' title='Service Broker sys.transmission_queue clean up'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-6847255958852871951</id><published>2011-01-18T11:59:00.002Z</published><updated>2011-01-18T12:01:52.670Z</updated><title type='text'>How to dump your Skype database to a text file for easy searching</title><content type='html'>I had a problem recently trying to search the Skype instant messeage history. Searching for a historical chat can be done in Skype by pressing CTRL-F, but only if you know the person(s) that were involved on that chat. You cannot search the chat history globally.&lt;br /&gt;&lt;br /&gt;The solution is to dump out the skype database into a TXT file for easy searching with notepad.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Download SQLite command shell at &lt;a href="http://www.sqlite.org/download.html"&gt;http://www.sqlite.org/download.html.&lt;/a&gt; (I downloaded &lt;a href="http://www.sqlite.org/sqlite-shell-win32-x86-3070400.zip"&gt;http://www.sqlite.org/sqlite-shell-win32-x86-3070400.zip&lt;/a&gt;)&lt;/li&gt;&lt;li&gt;Extract sqllite3.exe to a place on your path, or somewhere you can run it easily from.&lt;/li&gt;&lt;li&gt;Open a DOS command prompt.&lt;/li&gt;&lt;li&gt;Change the folder to C:\Users\[pc user name]\AppData\Roaming\Skype\[skype user name]&lt;/li&gt;&lt;li&gt;There you should find &lt;b&gt;main.db&lt;/b&gt; database.&lt;/li&gt;&lt;li&gt;Type the following (in bold):&lt;/li&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;sqlite3 main.db&lt;/b&gt;&lt;/li&gt;&lt;li&gt;sqlite&amp;gt; &lt;b&gt;.output c:\skype_chat.txt&lt;/b&gt;&lt;/li&gt;&lt;li&gt;sqlite&amp;gt; &lt;b&gt;.dump&lt;/b&gt;&lt;/li&gt;&lt;li&gt;sqlite&amp;gt; &lt;b&gt;.quit&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ol&gt;&lt;br /&gt;You can now start Notepad and open file c:\skype_chat.txt to search through.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6179682925625902039-6847255958852871951?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/6847255958852871951'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/6847255958852871951'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2011/01/how-to-dump-your-skype-database-to-text.html' title='How to dump your Skype database to a text file for easy searching'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-5021339301994275148</id><published>2011-01-05T20:05:00.001Z</published><updated>2011-01-13T13:24:48.439Z</updated><title type='text'>How to create a Gource graphical repository movie</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.hicrest.net/blog_images/gource.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="319" src="http://www.hicrest.net/blog_images/gource.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Download Gource from &lt;a href="https://code.google.com/p/gource/"&gt;https://code.google.com/p/gource/&lt;/a&gt; extract to C:\gource-0.28.win32&lt;br /&gt;Download FFMPEG from &lt;a href="http://www.videohelp.com/tools/ffmpeg"&gt;http://www.videohelp.com/tools/ffmpeg&lt;/a&gt; extract to c:\ffmpeg&lt;br /&gt;&lt;br /&gt;If using SVN also download the following: &lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://gource.googlecode.com/files/svn-gource-1.2.tar.gz"&gt;svn-gource.py&lt;/a&gt; from &lt;a href="https://code.google.com/p/gource/wiki/SVN"&gt;https://code.google.com/p/gource/wiki/SVN&lt;/a&gt; extract to c:\python31&lt;/li&gt;&lt;li&gt;Python from&amp;nbsp;&lt;a href="http://www.python.org/download/"&gt;http://www.python.org/download/&lt;/a&gt; I used v3.1.3. extract to c:\python31&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;In a DOS command prompt type:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;c:&lt;/li&gt;&lt;li&gt;cd C:\Data Files\Projects&lt;i&gt;&lt;b&gt; (Use your own SVN repository location)&lt;/b&gt;&lt;/i&gt;&lt;/li&gt;&lt;li&gt;svn log -r {2011-01-01}:{2010-01-01} --verbose --xml &amp;gt; c:\code-trunk.log&lt;/li&gt;&lt;li&gt;cd C:\gource-0.28.win32&lt;/li&gt;&lt;li&gt;The follow is only required if using SVN: c:\python31\python svn-gource.py --filter-dirs c:\code-trunk.log &amp;gt; c:\code-trunk-gource.log&lt;/li&gt;&lt;li&gt;gource --log-format custom c:\code-trunk-gource.log -1600x1040 --date-format "%d %B %y" --seconds-per-day 0.5 -a 0.1 --highlight-all-users --stop-at-end --disable-progress --output-ppm-stream c:\code-trunk.ppm --camera-mode overview --bloom-intensity 0.1 --output-framerate 25 --max-files 2000 --hide filenames,mouse -i 20&lt;/li&gt;&lt;li&gt;cd c:\ffmpeg\bin&lt;/li&gt;&lt;li&gt;ffmpeg -y -b 9000K -r 25 -f image2pipe -vcodec ppm -i c:\code-trunk.ppm -vcodec mpeg1video -s 1600x1040 c:\code-trunk.mpg&lt;/li&gt;&lt;li&gt;ffmpeg -vcodec copy -acodec copy -i C:\some-cool-music.mp3 -i c:\code-trunk.mpg c:\code-trunk-audio.mpg&lt;/li&gt;&lt;/ol&gt;The last step is optional, it adds an audio music to your gource video.&lt;br /&gt;In step 3 above, if you remove the &lt;b&gt;-r {2011-01-01}:{2010-01-01}&lt;/b&gt; it will export your whole repository. I just wanted last years.&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/6179682925625902039-5021339301994275148?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/5021339301994275148'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/5021339301994275148'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2011/01/how-to-create-gource-graphical.html' title='How to create a Gource graphical repository movie'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-5149146200142030963</id><published>2010-12-20T13:12:00.001Z</published><updated>2010-12-20T13:18:38.403Z</updated><title type='text'>SQL Server MAXDOP and parallelism</title><content type='html'>At our company, we have a 4 core blade running SQL Server 2008 Enterprise Edition.&lt;br /&gt;This is a very, very busy SQL Server and is running on HP EVA hardware, so the I/O is not an issue.&lt;br /&gt;We have over 50 warehouses all running SQL Server 2008 and replicating data to/from this primary database.&lt;br /&gt;This database is also used by our website, webservices and import/export applications. The only thing this database does not serve is our SSRS reports, which are hosted on another blade.&lt;br /&gt;&lt;br /&gt;What is an issue, however, are the CPU's. They were very busy. To help with this we can play around with two settings on SQL Server:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;MAXDOP (Max degree of parallelism)&lt;/li&gt;&lt;li&gt;Cost threshold for parallelism&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.hicrest.net/blog_images/SQL_maxdop.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.hicrest.net/blog_images/SQL_maxdop.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Our DBA and I had a few discussions around this recently. Read plenty of articles on it, such as &lt;a href="http://sqlblog.com/blogs/adam_machanic/archive/2010/05/28/sql-university-parallelism-week-part-3-settings-and-options.aspx"&gt;Adam Machanic&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;On a normal system, leaving these settings alone are fine, but on a very very busy system you need to change them.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;MAXDOP=1. What this does is to always use 1 core for the query.&lt;/li&gt;&lt;li&gt;MAXDOP=0, Cost = 20. This will use 1 core for simple queries, and for complex queries (cost &amp;gt; 20)&amp;nbsp; will be allowed to use parallel queries.&lt;/li&gt;&lt;/ol&gt;&lt;b&gt;What we found is setting MAXDOP = 1 is optimal.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This is because running complex queries faster made the replication suffer. By using MAXDOP=1 we save CPU time by not having to join up parallel queries at the end. Save time by stopping the "thread thrashing" that can occur on many queries all running in parallel.&lt;br /&gt;&lt;br /&gt;Because the SQL box is very busy fielding many queries at once, using MAXDOP=1still utilises all cores due to running 4 or more queries at the same time.&lt;br /&gt;Also replication is a lot happier now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6179682925625902039-5149146200142030963?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/5149146200142030963'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/5149146200142030963'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2010/12/sql-server-maxdop-and-parallelism.html' title='SQL Server MAXDOP and parallelism'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-8982745974961661503</id><published>2010-10-11T12:22:00.000+01:00</published><updated>2010-10-11T12:22:19.727+01:00</updated><title type='text'>Index Analysis</title><content type='html'>Some nice articles by &lt;a href="http://www.jasonstrate.com/"&gt;Jason Strate&lt;/a&gt; on index analysis, page splits, etc.Check them out at:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.jasonstrate.com/index.php/2010/10/return-of-index-analysis-part-1/"&gt;Return of Index Analysis - Part 1&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.jasonstrate.com/index.php/2010/10/return-of-index-analysis-part-2/"&gt;Return of Index Analysis - Part 2&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.jasonstrate.com/index.php/2010/09/an-index-on-indexing-tsql2sday/"&gt;An Index on Indexing #TSQL2sDay&lt;/a&gt;&amp;nbsp; Read the black-ops articles.&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/6179682925625902039-8982745974961661503?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/8982745974961661503'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/8982745974961661503'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2010/10/index-analysis.html' title='Index Analysis'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-1809781867295671658</id><published>2010-09-07T20:29:00.003+01:00</published><updated>2010-09-07T20:36:17.849+01:00</updated><title type='text'>Lifeguard</title><content type='html'>I just found my very first commercial software I wrote in Z80 assembler. It's called lifeguard and can be found &lt;a href="http://www.worldofspectrum.org/infoseekid.cgi?id=0008359"&gt;here&lt;/a&gt;.&lt;br /&gt;Its basically an unlimited lives finder for the ZX Spectrum and ran on the Multiface hardware. Romantic Robot made the &lt;a href="http://en.wikipedia.org/wiki/Multiface"&gt;multiface&lt;/a&gt; and distributed it for me. They used to pay me a commssion on a monthly basis.&lt;br /&gt;I still remember the algorithm for finding lives, grenades, timers, etc.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_weEyw1YJRuo/TIaSdVI5duI/AAAAAAAAABw/nXlFuMDAO6k/s1600/showscreen%5B1%5D.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_weEyw1YJRuo/TIaSdVI5duI/AAAAAAAAABw/nXlFuMDAO6k/s320/showscreen%5B1%5D.gif" /&gt;&lt;/a&gt;&lt;a href="http://1.bp.blogspot.com/_weEyw1YJRuo/TIaSkd2bjbI/AAAAAAAAAB4/mCHyedKtSBM/s1600/showscreen%5B1%5D.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_weEyw1YJRuo/TIaSkd2bjbI/AAAAAAAAAB4/mCHyedKtSBM/s320/showscreen%5B1%5D.gif" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;Good times.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6179682925625902039-1809781867295671658?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/1809781867295671658'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/1809781867295671658'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2010/09/lifeguard.html' title='Lifeguard'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_weEyw1YJRuo/TIaSdVI5duI/AAAAAAAAABw/nXlFuMDAO6k/s72-c/showscreen%5B1%5D.gif' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-5230375519428584801</id><published>2010-06-15T23:24:00.006+01:00</published><updated>2010-06-16T00:48:23.770+01:00</updated><title type='text'>Pex and Moles</title><content type='html'>Pex and Moles are Visual Studio 2010 Power Tools extension that help Unit Testing .NET applications.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Pex &lt;b&gt;automatically generates&lt;/b&gt; test suites with high code coverage. Right from the Visual Studio code editor, Pex finds interesting input-output values of your methods, which you can save as a small test suite with high code coverage. Microsoft Pex is a Visual Studio add-in for testing .NET Framework applications.Moles allows to replace any .NET method with a delegate. &lt;/li&gt;&lt;li&gt;Moles supports unit testing by providing isolation by way of detours and stubs. The Moles framework is provided with Pex, or can be installed by itself as a Microsoft Visual Studio add-in. &lt;/li&gt;&lt;/ul&gt;Microsoft Moles helps with writing unit tests, but what remains is the tedious task of writing the specific unit tests that exhaustively exercise and validate the logic of the code-under-test. Microsoft Pex can help you in understanding the input/output behavior of your code, finding inputs that cause the code-under-test to crash, and exploring parameterized unit tests to check whether your code implements the desired functionality for all inputs.&lt;br /&gt;When you run Microsoft Pex on your .NET code, Pex generates test cases by analyzing the code-under-test. For every statement in the code, Pex will eventually try to create a test input that will reach that statement. Pex will do a case analysis for every conditional branch in the code—for example, if statements, assertions, and all operations that can throw exceptions.&lt;br /&gt;The result appears as a table that shows each test attempted by Pex. Each line in the table shows the input and the resulting output or exceptions generated by the method for the specific input.&lt;br /&gt;&lt;br /&gt;This is great, automatic unit test generation and complete code  coverage!&lt;br /&gt;You can download it &lt;a href="http://research.microsoft.com/en-us/projects/pex/"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Ok been using for a while and my verdict is: &lt;b&gt;Pex rocks!&lt;/b&gt;&lt;br /&gt;I can't believe I've never known about it until now!&lt;br /&gt;Pex generates MSTests or NUnit tests. MSTests are default, but if your project already has NUnit tests, it will use those.&lt;br /&gt;Here is a video you should &lt;a href="http://channel9.msdn.com/posts/Peli/Getting-started-with-Pex-in-Visual-Studio-2008/"&gt;watch&lt;/a&gt;. &lt;br /&gt;Pex first records your codes responses, and generates ASSERTS, so in future, these can be used as regression tests. It achieves 100% code coverage by analysing your code, and cleverly generating tests. Very impressive.&lt;br /&gt;&lt;br /&gt;Pex generates edge cases, and every combination of null and empty strings to each parameter, etc, which is not what you'd like to see pollute your nice and clean nUnit tests. Plus, those would take forever to make. So by having your hand crafted nUnit tests and Pex generated MSTests separate its best of both worlds.&lt;br /&gt;Resharper will also happily run both nUnit and MSTests in your solution together and gives you the green/red lights as normal.&lt;br /&gt;In a couple of hours, Pex has so far generated over 1100 lines of MSTest C# code for me. And I didn't have to write a line of code (apart from me having to fix my C# code when Pex found a fault with it).&lt;br /&gt;I like it very much as it allows me to concentrate on building nUnit tests and not mind-numbing combinatorial parameter checking :-)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Automated builds&lt;/b&gt;Using FinalBuilder or CruiseControl to automate your builds and run your tests? In order to have the generated tests execute on a machine that does not  have Pex installed, you can check in into your depot the following  assemblies:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Microsoft.Pex.Framework.dll&lt;/li&gt;&lt;li&gt;Microsoft.ExtendedReflection.dll&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Here is a picture of Pex in action:&lt;br /&gt;&lt;a href="http://www.hicrest.net/blog_images/PexandMoles_149E6/pex.jpg" target="_blank"&gt;&lt;img alt="pex" border="0" height="156" src="http://www.hicrest.net/blog_images/PexandMoles_149E6/pex_thumb.jpg" style="border-width: 0px; display: inline;" title="pex" width="244" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6179682925625902039-5230375519428584801?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/5230375519428584801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/5230375519428584801'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2010/06/pex-and-moles.html' title='Pex and Moles'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-9129357846571713238</id><published>2010-06-11T09:46:00.002+01:00</published><updated>2010-06-11T10:10:16.563+01:00</updated><title type='text'>Scott Hanselman - The Best Visual Studio 2010 Productivity Power Tools, Power Commands and Extensions</title><content type='html'>&lt;a href="http://www.hanselman.com/blog/TheBestVisualStudio2010ProductivityPowerToolsPowerCommandsAndExtensions.aspx"&gt;Scott Hanselman - The Best Visual Studio 2010 Productivity Power Tools, Power Commands and Extensions&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;My favourites are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://visualstudiogallery.msdn.microsoft.com/en-us/e5f41ad9-4edc-4912-bca3-91147db95b99"&gt;PowerCommands &lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://visualstudiogallery.msdn.microsoft.com/en-us/d0d33361-18e2-46c0-8ff2-4adea1e34fef"&gt;Pro Power Tools&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;Lots of others, so go check em out. &lt;br /&gt;&lt;ul&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6179682925625902039-9129357846571713238?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.hanselman.com/blog/TheBestVisualStudio2010ProductivityPowerToolsPowerCommandsAndExtensions.aspx' title='Scott Hanselman - The Best Visual Studio 2010 Productivity Power Tools, Power Commands and Extensions'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/9129357846571713238'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/9129357846571713238'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2010/06/scott-hanselman-best-visual-studio-2010.html' title='Scott Hanselman - The Best Visual Studio 2010 Productivity Power Tools, Power Commands and Extensions'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-2308978047330230835</id><published>2010-05-16T01:15:00.002+01:00</published><updated>2010-05-16T01:28:10.777+01:00</updated><title type='text'>Defragmenting SQL Server 2008+ using ALTER INDEX</title><content type='html'>In SQL 2009 &lt;b&gt;DBCC INDEXDEFRAG&lt;/b&gt; will no longer work as Microsoft have removed the command. You need to user &lt;b&gt;ALTER INDEX&lt;/b&gt; instead:&lt;br /&gt;&lt;br /&gt;&lt;div style="background: none repeat scroll 0% 0% white; color: black; font-family: Courier New; font-size: 10pt;"&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;CREATE PROCEDURE &lt;/span&gt;sjh_defragment_indexes_2008&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;(&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @maxfrag &lt;span style="color: blue;"&gt;FLOAT&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;)&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;AS&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;/* Simon Hughes 15 May 2010&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;For SQL 2008+&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;This stored procedure checks index fragmentation in a database and defragments&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;indexes whose fragmentation fall above a specified threshold: @maxfrag&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;Must be run in the database to be defragmented.&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;exec sjh_defragment_indexes_2008 5&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;*/&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;SET NOCOUNT ON&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;SET XACT_ABORT ON&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;-- Write start time for information purposes&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;PRINT &lt;/span&gt;&lt;span style="color: #a31515;"&gt;'Started defragmenting at: ' &lt;/span&gt;+ &lt;span style="color: blue;"&gt;CONVERT&lt;/span&gt;(&lt;span style="color: blue;"&gt;VARCHAR&lt;/span&gt;, &lt;span style="color: blue;"&gt;GETDATE&lt;/span&gt;())&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;-- Check fragmentation&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;DECLARE &lt;/span&gt;@execstr NVARCHAR(255)&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;DECLARE &lt;/span&gt;lcsr &lt;span style="color: blue;"&gt;CURSOR local &lt;/span&gt;fast_forward READ_ONLY &lt;span style="color: blue;"&gt;FOR&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;SELECT &lt;/span&gt; &lt;span style="color: #a31515;"&gt;'ALTER INDEX [' &lt;/span&gt;+ i.name + &lt;span style="color: #a31515;"&gt;'] ON [' &lt;/span&gt;+ so.name + &lt;span style="color: #a31515;"&gt;'] REORGANIZE;' &lt;/span&gt;&lt;span style="color: blue;"&gt;AS &lt;/span&gt;execstr&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;FROM &lt;/span&gt;&amp;nbsp;&amp;nbsp; sys.sysobjects &lt;span style="color: blue;"&gt;AS &lt;/span&gt;so&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;INNER JOIN &lt;/span&gt;sys.dm_db_index_physical_stats(&lt;span style="color: blue;"&gt;DB_ID&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;'bybox'&lt;/span&gt;), &lt;span style="color: blue;"&gt;NULL&lt;/span&gt;, &lt;span style="color: blue;"&gt;NULL&lt;/span&gt;, &lt;span style="color: blue;"&gt;NULL&lt;/span&gt;, &lt;span style="color: #a31515;"&gt;'LIMITED'&lt;/span&gt;) &lt;span style="color: blue;"&gt;AS &lt;/span&gt;phystat&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;INNER JOIN &lt;/span&gt;sys.indexes &lt;span style="color: blue;"&gt;AS &lt;/span&gt;i&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;ON &lt;/span&gt;i.object_id = phystat.object_id&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;AND &lt;/span&gt;i.index_id = phystat.index_id&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;ON &lt;/span&gt;so.name = &lt;span style="color: blue;"&gt;OBJECT_NAME&lt;/span&gt;(i.object_id)&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;WHERE &lt;/span&gt;&amp;nbsp; (i.name &lt;span style="color: blue;"&gt;IS NOT NULL&lt;/span&gt;)&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;AND &lt;/span&gt;(so.type = &lt;span style="color: #a31515;"&gt;'U'&lt;/span&gt;)&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;AND &lt;/span&gt;(phystat.avg_fragmentation_in_percent &amp;gt; @maxfrag)&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;OPEN &lt;/span&gt;lcsr&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;FETCH NEXT FROM &lt;/span&gt;lcsr &lt;span style="color: blue;"&gt;INTO &lt;/span&gt;@execstr&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;WHILE &lt;/span&gt;@@FETCH_STATUS = 0&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;BEGIN&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;EXEC &lt;/span&gt;sp_executesql @execstr&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;FETCH NEXT FROM &lt;/span&gt;lcsr &lt;span style="color: blue;"&gt;INTO &lt;/span&gt;@execstr&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;END&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;CLOSE &lt;/span&gt;lcsr&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;DEALLOCATE &lt;/span&gt;lcsr&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;-- Report on finish time for information purposes&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;PRINT &lt;/span&gt;&lt;span style="color: #a31515;"&gt;'Finished defragmenting at: ' &lt;/span&gt;+ &lt;span style="color: blue;"&gt;CONVERT&lt;/span&gt;(&lt;span style="color: blue;"&gt;VARCHAR&lt;/span&gt;, &lt;span style="color: blue;"&gt;GETDATE&lt;/span&gt;())&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;GO&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;Download code &lt;a href="http://www.hicrest.net/code/sjh_defragment_indexes_2008.sql"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6179682925625902039-2308978047330230835?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/2308978047330230835'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/2308978047330230835'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2010/05/defragmenting-sql-server-2008-using.html' title='Defragmenting SQL Server 2008+ using ALTER INDEX'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-2900781067398657308</id><published>2010-05-16T00:38:00.000+01:00</published><updated>2010-05-16T00:38:16.468+01:00</updated><title type='text'>How to turn off auto-shrink on all your databases</title><content type='html'>Shrinking a database is bad. Why? Well its because it causes &lt;b&gt;massive &lt;/b&gt;index fragmentation. (You can read about it &lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/Why-you-should-not-shrink-your-data-files.aspx"&gt;here&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="background: none repeat scroll 0% 0% white; color: black; font-family: Courier New; font-size: 10pt;"&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;DECLARE &lt;/span&gt;@Base &lt;span style="color: blue;"&gt;SYSNAME&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;DECLARE &lt;/span&gt;database_cursor &lt;span style="color: blue;"&gt;CURSOR FOR&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;SELECT &lt;/span&gt; QUOTENAME(&lt;span style="color: blue;"&gt;name&lt;/span&gt;) &lt;span style="color: blue;"&gt;AS &lt;/span&gt;Base&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;FROM &lt;/span&gt;&amp;nbsp;&amp;nbsp; master..sysdatabases&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;WHERE &lt;/span&gt;&amp;nbsp; DATABASEPROPERTYEX(&lt;span style="color: blue;"&gt;name&lt;/span&gt;, &lt;span style="color: #a31515;"&gt;'Status'&lt;/span&gt;) = &lt;span style="color: #a31515;"&gt;'ONLINE'&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;AND &lt;/span&gt;DATABASEPROPERTYEX(&lt;span style="color: blue;"&gt;name&lt;/span&gt;, &lt;span style="color: #a31515;"&gt;'IsAutoShrink'&lt;/span&gt;) = 1&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;OPEN &lt;/span&gt;database_cursor&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;FETCH NEXT FROM &lt;/span&gt;database_cursor &lt;span style="color: blue;"&gt;INTO &lt;/span&gt;@Base&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;WHILE &lt;/span&gt;@@FETCH_STATUS = 0 &lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;BEGIN&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;EXEC &lt;/span&gt;(&lt;span style="color: #a31515;"&gt;'ALTER DATABASE ' &lt;/span&gt;+ @BASE + &lt;span style="color: #a31515;"&gt;' SET AUTO_SHRINK OFF'&lt;/span&gt;)&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;FETCH NEXT FROM &lt;/span&gt;database_cursor &lt;span style="color: blue;"&gt;INTO &lt;/span&gt;@Base&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;END&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;CLOSE &lt;/span&gt;database_cursor&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;DEALLOCATE &lt;/span&gt;database_cursor&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6179682925625902039-2900781067398657308?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/2900781067398657308'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/2900781067398657308'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2010/05/how-to-turn-off-auto-shrink-on-all-your.html' title='How to turn off auto-shrink on all your databases'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-4732886789831661139</id><published>2010-05-16T00:18:00.004+01:00</published><updated>2010-05-16T01:29:05.537+01:00</updated><title type='text'>Defragmenting SQL Server 2005 and 2008 using dynamic management views</title><content type='html'>You can read all about SQL defragmentation &lt;a href="http://www.sql-server-performance.com/articles/per/detect_fragmentation_sql2000_sql2005_p1.aspx"&gt;here&lt;/a&gt; by Satya Jayanty. The bottom line - defragmentation is bad. It causes high CPU load and poor SQL performance. Shrinking your database causes &lt;b&gt;massive&lt;/b&gt; index fragmentation. You can read about that &lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/Why-you-should-not-shrink-your-data-files.aspx"&gt;here&lt;/a&gt;, therefore you should always turn off auto-shrink (I also have a script for that &lt;a href="http://simon-hughes.blogspot.com/2010/05/how-to-turn-off-auto-shrink-on-all-your.html"&gt;here&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;For SQL 2000 you must use DBCC SHOWCONTIG. You can use the SQL given &lt;a href="http://msdn.microsoft.com/en-us/library/ms177571.aspx"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;However, for SQL Server 2005 onwards, there is a better way using the dynamic management view &lt;b&gt;sys.dm_db_index_physical_stats introduced&lt;/b&gt; in SQL 2005.&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color: #fff2cc;"&gt;Note: In SQL 2009 this proc is not going to work because Microsoft are going to remove DBCC INDEXDEFRAG from the next version of Microsoft SQL Server (read 2009), you need to user ALTER INDEX instead, as shown in my &lt;a href="http://simon-hughes.blogspot.com/2010/05/defragmenting-sql-server-2008-using.html"&gt;next blog entry&lt;/a&gt;. &lt;/div&gt;&lt;br /&gt;&lt;div style="background: none repeat scroll 0% 0% white; color: black; font-family: Courier New; font-size: 10pt;"&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;SELECT &lt;/span&gt; &lt;span style="color: blue;"&gt;OBJECT_NAME&lt;/span&gt;(i.object_id) &lt;span style="color: blue;"&gt;AS &lt;/span&gt;TableName,&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; i.name &lt;span style="color: blue;"&gt;AS &lt;/span&gt;TableIndexName,&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; phystat.avg_fragmentation_in_percent,&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; phystat.fragment_count&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;FROM &lt;/span&gt;&amp;nbsp;&amp;nbsp; sys.dm_db_index_physical_stats(&lt;span style="color: blue;"&gt;DB_ID&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;'your_database_name'&lt;/span&gt;), &lt;span style="color: blue;"&gt;NULL&lt;/span&gt;, &lt;span style="color: blue;"&gt;NULL&lt;/span&gt;, &lt;span style="color: blue;"&gt;NULL&lt;/span&gt;, &lt;span style="color: #a31515;"&gt;'LIMITED'&lt;/span&gt;) phystat&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;INNER JOIN &lt;/span&gt;sys.indexes i&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;ON &lt;/span&gt;i.object_id = phystat.object_id &lt;span style="color: blue;"&gt;AND &lt;/span&gt;i.index_id = phystat.index_id&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;WHERE &lt;/span&gt;&amp;nbsp; phystat.avg_fragmentation_in_percent &amp;gt; 10&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;ORDER BY &lt;/span&gt;phystat.avg_fragmentation_in_percent &lt;span style="color: blue;"&gt;DESC&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;Building that into a stored proc to execute every so often to defrag gives us:&lt;br /&gt;&lt;br /&gt;&lt;div style="background: none repeat scroll 0% 0% white; color: black; font-family: Courier New; font-size: 10pt;"&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;CREATE PROCEDURE &lt;/span&gt;sjh_defragment_indexes&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;(&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @maxfrag &lt;span style="color: blue;"&gt;FLOAT&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;)&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;AS&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;/* Simon Hughes 15 May 2010&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;For SQL 2005+ only&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;This stored procedure checks index fragmentation in a database and defragments&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;indexes whose fragmentation fall above a specified threshold: @maxfrag&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;Must be run in the database to be defragmented.&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;Please change 'your_database_name' to be the name of your database &lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;exec sjh_defragment_indexes 5.0&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;*/&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;SET NOCOUNT ON&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;SET &lt;/span&gt;XACT_ABORT &lt;span style="color: blue;"&gt;ON&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;-- Check this is not being run in a system database&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;IF DB_NAME&lt;/span&gt;() &lt;span style="color: blue;"&gt;IN &lt;/span&gt;(&lt;span style="color: #a31515;"&gt;'master'&lt;/span&gt;, &lt;span style="color: #a31515;"&gt;'msdb'&lt;/span&gt;, &lt;span style="color: #a31515;"&gt;'model'&lt;/span&gt;, &lt;span style="color: #a31515;"&gt;'tempdb'&lt;/span&gt;) &lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;BEGIN&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;PRINT &lt;/span&gt;&lt;span style="color: #a31515;"&gt;'This procedure should not be run in system databases.'&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;RETURN&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;END&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;-- Check fragmentation&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;SELECT &lt;/span&gt; &lt;span style="color: blue;"&gt;OBJECT_NAME&lt;/span&gt;(i.object_id) &lt;span style="color: blue;"&gt;AS &lt;/span&gt;TableName,&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; i.name &lt;span style="color: blue;"&gt;AS &lt;/span&gt;TableIndexName,&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; phystat.avg_fragmentation_in_percent,&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; phystat.fragment_count,&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515;"&gt;'DBCC INDEXDEFRAG (0, [' &lt;/span&gt;+ &lt;span style="color: blue;"&gt;OBJECT_NAME&lt;/span&gt;(i.object_id) + &lt;span style="color: #a31515;"&gt;'], ' &lt;/span&gt;+ i.name + &lt;span style="color: #a31515;"&gt;') WITH NO_INFOMSGS' &lt;/span&gt;&lt;span style="color: blue;"&gt;AS &lt;/span&gt;execstr&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;INTO &lt;/span&gt;&amp;nbsp;&amp;nbsp; [#frag]&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;FROM &lt;/span&gt;&amp;nbsp;&amp;nbsp; sys.dm_db_index_physical_stats(&lt;span style="color: blue;"&gt;DB_ID&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;'your_database_name'&lt;/span&gt;), &lt;span style="color: blue;"&gt;NULL&lt;/span&gt;, &lt;span style="color: blue;"&gt;NULL&lt;/span&gt;, &lt;span style="color: blue;"&gt;NULL&lt;/span&gt;, &lt;span style="color: #a31515;"&gt;'LIMITED'&lt;/span&gt;) phystat&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;INNER JOIN &lt;/span&gt;sys.indexes i&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;ON &lt;/span&gt;i.object_id = phystat.object_id&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;AND &lt;/span&gt;i.index_id = phystat.index_id&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;WHERE &lt;/span&gt;&amp;nbsp; i.name &lt;span style="color: blue;"&gt;IS NOT NULL&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;AND &lt;/span&gt;phystat.avg_fragmentation_in_percent &amp;gt; @maxfrag&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;ORDER BY &lt;/span&gt;phystat.avg_fragmentation_in_percent &lt;span style="color: blue;"&gt;DESC&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;SELECT &lt;/span&gt;* &lt;span style="color: blue;"&gt;FROM &lt;/span&gt;[#frag]&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;-- Write start time for information purposes&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;PRINT &lt;/span&gt;&lt;span style="color: #a31515;"&gt;'Started defragmenting at: ' &lt;/span&gt;+ &lt;span style="color: blue;"&gt;CONVERT&lt;/span&gt;(&lt;span style="color: blue;"&gt;VARCHAR&lt;/span&gt;, &lt;span style="color: blue;"&gt;GETDATE&lt;/span&gt;())&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;-- Begin defrag&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;DECLARE &lt;/span&gt;@execstr NVARCHAR(1024)&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;DECLARE &lt;/span&gt;cc &lt;span style="color: blue;"&gt;CURSOR &lt;/span&gt;FAST_FORWARD &lt;span style="color: blue;"&gt;FOR&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;SELECT &lt;/span&gt;execstr &lt;span style="color: blue;"&gt;FROM &lt;/span&gt;[#frag]&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;OPEN &lt;/span&gt;cc&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;FETCH NEXT FROM &lt;/span&gt;cc &lt;span style="color: blue;"&gt;INTO &lt;/span&gt;@execstr&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;WHILE &lt;/span&gt;@@FETCH_STATUS = 0 &lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;BEGIN&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;EXEC &lt;/span&gt;sp_executesql @execstr&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;FETCH NEXT FROM &lt;/span&gt;cc &lt;span style="color: blue;"&gt;INTO &lt;/span&gt;@execstr&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;END&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;-- Close and deallocate the cursor&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;CLOSE &lt;/span&gt;cc&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;DEALLOCATE &lt;/span&gt;cc&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;-- Report on finish time for information purposes&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;PRINT &lt;/span&gt;&lt;span style="color: #a31515;"&gt;'Finished defragmenting at: ' &lt;/span&gt;+ &lt;span style="color: blue;"&gt;CONVERT&lt;/span&gt;(&lt;span style="color: blue;"&gt;VARCHAR&lt;/span&gt;, &lt;span style="color: blue;"&gt;GETDATE&lt;/span&gt;())&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;-- Delete the temporary table&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;DROP TABLE &lt;/span&gt;[#frag]&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;GO&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;Download code &lt;a href="http://www.hicrest.net/code/sjh_defragment_indexes.sql"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6179682925625902039-4732886789831661139?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/4732886789831661139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/4732886789831661139'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2010/05/defragmenting-sql-server-2005-and-2008.html' title='Defragmenting SQL Server 2005 and 2008 using dynamic management views'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-391371928065084481</id><published>2010-05-14T10:10:00.001+01:00</published><updated>2010-05-14T10:12:38.020+01:00</updated><title type='text'>Generating Insert Statements</title><content type='html'>Quite a good &lt;a href="http://www.sqlservercentral.com/articles/T-SQL/66097/"&gt;article &lt;/a&gt;by &lt;a href="http://www.sqlservercentral.com/Authors/Articles/Oleg_Netchaev/904564/"&gt;Oleg Netchaev&lt;/a&gt; on how to automatically generate INSERT statements for a given table.&lt;br /&gt;The SQL for this is available &lt;a href="http://www.sqlservercentral.com/Files/gen_inserts.sql/3646.sql"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;If you only want a small subset generated, then have a look at the &lt;a href="http://www.ssmstoolspack.com/"&gt;SSMS Tools Pack&lt;/a&gt; which is free.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6179682925625902039-391371928065084481?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/391371928065084481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/391371928065084481'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2010/05/generating-insert-statements.html' title='Generating Insert Statements'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-3662357325886146338</id><published>2010-05-07T11:37:00.001+01:00</published><updated>2010-05-07T13:56:00.099+01:00</updated><title type='text'>Microsoft Hyper-V vs VMware ESXi</title><content type='html'>Full credit for this article goes to Jonathan Payne, who works as one of our esteemed DBAs. Unfortunately he has no blog, so here it is:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;What has been going on?&lt;/b&gt;&lt;br /&gt;Over the past week we have been testing and comparing VMware’s ESXi virtualisation product with Microsoft’s Hyper-V. This has come about because our existing virtualisation infrastructure, which is built on VMware’s WMware Server, has not been performing as expected and has been have a real impact on our services. The servers V1, V2 and BuildServer are all virtual machines running in this environment on the physical server Virtual1 and we have had problems with VMware Server where it just couldn’t seem to allocate enough CPU resources to run the VMs correctly when there was at least 60% of CPU capacity not being used.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;What are we comparing?&lt;/b&gt;&lt;br /&gt;We have investigated the use of ESXi or Hyper-V to provide the virtualisation environment. These are both type 1 hypervisors, which means that hardware resources are presented directly to the VMs. So a 1 core VM is presented with 1 physical CPU core with nothing in-between. Okay, it isn’t as simple as that, but you get the idea. For devices such as network adapters, there is more intervention involved and this is where the biggest differences beween ESXi and Hyper-V occur. Hyper-V uses the installed windows drivers, which are easy to update. ESXi creates its own environment and can only talk to the physical devices that it has pre-installed drivers for. This is why the hardware compatibility list is very important for ESXi, whereas it isn’t so important for Hyper-V as the Windows drivers are used. In this case, our HP hardware is supported by ESXi, so there is no problem there.&lt;br /&gt;We set up ESXi and Hyper-V environments to run on Virtual2  so that we could install test and compare the solutions. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;How will changing to a type 1 hypervisor help?&lt;/b&gt;&lt;br /&gt;The VMs will get more resources, which should help the performance bottlenecks that we are experiencing.&lt;br /&gt;The testing of both environments highlighted some of the pros and cons of using the technologies. Although the performance testing was limited, as it is difficult to create an environment containing multiple test VMs, we compared the test VM build server performances to the current production build server performance running under VMware Server. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;So what were the test results?&lt;/b&gt;&lt;br /&gt;Both ESXi and Hyper-V show performance improvements over VMware Server. The build server tests show that a software build will complete in half the time on the ESXi and Hyper-V versions of the VM when compared to the VMware Server VM. So we are expecting tangible performance improvements by moving to ESXi or Hyper-V. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Cut to the chase - Hyper-V or ESXi?&lt;/b&gt;&lt;br /&gt;Hyper-V.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;What benefits does Hyper-V provide?&lt;/b&gt;&lt;br /&gt;Hyper-V provides a number of benefits. It is a familiar technology within the company with a number of people having experience with older Microsoft virtualisation technologies, such as virtual PC and Virtual Server as well as experience with Hyper-V itself. Hyper-V is currently used to provide the SQL Server Reporting Server solution on two nodes.&lt;br /&gt;Using Hyper-V gives us the ability to use the Windows Server Datacenter licence that we have. This license covers any virtual machine that is run on a server where the host OS is the datacenter edition and means that we can create any number of VMs with any Windows OS to run on the hosts without any licensing issues. &lt;br /&gt;Combined with the clustering features of Windows Server 2008 R2, we can cluster the virtual machine hosts to provide a high availability environment that would protect us from a hardware failure. This would fail over any VMs that were running on a host that failed to another host.&lt;br /&gt;Another feature of clustering the virtualisation hosts is that we can use a feature called Live Migration. This feature allows us to move virtual machines between hosts with no interruption of service. This would be very useful for moving VMs between hosts to balance loads across hosts and also to be able to move VMs if maintenance is required on a host without any downtime.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Why not ESXi?&lt;/b&gt;&lt;br /&gt;A major drawback of ESXi is that we are not very familiar with VMware software. It does things in an unfamiliar way, so there is a learning curve involved with maintaining the host server and managing VMs. To use ESXi would also introduce a licensing problem for our VM OSes. Currently the VM OS licenses are covered by the Windows Server Datacenter license that is used as the host OS on Virtual1. If we used ESXi, this license could no longer be used because the Datacenter OS would not be being used as the host OS. We would have to purchase additional OS licenses to cover the VMs. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Is ESXi all bad?&lt;/b&gt;&lt;br /&gt;No, not at all. It seems to perform quite well, it has better monitoring tools than Hyper-V and it provides the ability to over allocate resources, so you can have a higher density of VMs on a server. vSphere Client is the tool used to maintain ESXi and this tool seems quite comprehensive, although it took a bit of getting used to.&lt;br /&gt;&lt;br /&gt;So why have we changed our minds about going for VMware over Hyper-V?&lt;br /&gt;We talked to Vohkus about virtualisation, and were seduced by the idea of a virtual cloud in which to run  and manage our servers, with the ability to move VMs around to balance the load on the host servers. The Windows Server 2008 version of Hyper-V couldn’t provide that level of functionality and so it appeared that VMware was the way to achieve this dream. However, it turns out that  the improvements in Hyper-V offered by the R2 version of the product do provide this functionality and more than that, it provides it without any further investment. To provide this with ESXi and vSphere would need a further investment in OS licenses and the vSphere license costs.&lt;br /&gt;ESXi is considered best of breed in terms of features with VMware having many years of experience in this field, but Hyper-V is playing catch-up and it appears to  be very close behind now.&lt;br /&gt;As Hyper-V suits our requirements with no further investment, it has been decided to go with Hyper-V.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Okay, so will Hyper-V really provide everything without any further investment?&lt;/b&gt;&lt;br /&gt;Umm, actually no. Yes we can provide a high availability environment and everything with what we have got, but we don’t have a way to perform live backups of VMs and there is no automated way to manage the VMs. Microsoft’s System Center will provide the management tool to manage the backing up and restoring VMs and provide the facility to automatically spread VMs across hosts to manage workloads on the host servers. There is a new version of System Center coming out at the end of the month and we’ll be investing in a copy.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;What now?&lt;/b&gt;&lt;br /&gt;So, that’s it. Windows Server 2008 R2 Core will be installed on Virtual2 and it will be set up as a single node cluster with Hyper-V. There will be a phased migration of VMs from Virtual1 to Virtual2 and once all the VMs have been migrated, Virtual1 will be re-built as an R2 Core server and joined to the cluster. We can then distribute the existing VMs across the cluster and add the servers that we are missing at the moment.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6179682925625902039-3662357325886146338?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/3662357325886146338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/3662357325886146338'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2010/05/microsoft-hyper-v-vs-vmware-esxi.html' title='Microsoft Hyper-V vs VMware ESXi'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-4231832706889799530</id><published>2010-04-19T14:44:00.000+01:00</published><updated>2010-04-19T14:44:19.242+01:00</updated><title type='text'>Disabling script debugging in VS 2008 + IE8</title><content type='html'>If you experience terrible performance and constant refreshing of a Script Documents node when using the Visual Studio Debugger, follow the instructions &lt;a href="http://blogs.msdn.com/greggm/archive/2009/04/06/disabling-script-debugging-in-vs-2008-ie8.aspx"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Work around:&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;This work around requires the Silverlight 2 Tools for Visual Studio  2008 SP1 to be installed. So if you don't have these tools installed,  you can download them from Microsoft (&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=C22D6A7B-546F-4407-8EF6-D60C8EE221ED&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?familyid=C22D6A7B-546F-4407-8EF6-D60C8EE221ED&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?familyid=C22D6A7B-546F-4407-8EF6-D60C8EE221ED&amp;amp;displaylang=en&lt;/a&gt;).  If this is not an option for you, there is some alternative work  arounds at the bottom of this blog post.&lt;/li&gt;&lt;li&gt;Right click on your project and open up project properties&lt;/li&gt;&lt;li&gt;Go to the 'Start Options' sheet, and click the 'Silverlight' button  at the bottom of the screen. Because the debugger cannot debug both  Silverlight code and Script code at the same time, this will disable  Script debugging and therefore avoid the problem.&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/6179682925625902039-4231832706889799530?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/4231832706889799530'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/4231832706889799530'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2010/04/disabling-script-debugging-in-vs-2008.html' title='Disabling script debugging in VS 2008 + IE8'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-664603443403365857</id><published>2010-03-12T12:11:00.000Z</published><updated>2010-03-12T12:11:21.183Z</updated><title type='text'>VHD disk images being read while VirtualPC is not running?</title><content type='html'>I setup a Virtual PC recently and noticed my hard disks were very busy lately. My VirtualPC is not on, but checking what files were being accessed (Task Manager --&amp;gt; Performance --&amp;gt; Resource monitor) I noticed that the VHD virtual disk image was being read a lot. Which is really odd as it's not in use.&lt;br /&gt;&lt;br /&gt;The solution was to disble the service "Superfetch". Hey presto, all is quiet again.&lt;br /&gt;&lt;br /&gt;Superfetch was trying to keep my system running fast by pre-loading the VHD into memory. Madness.&lt;br /&gt;&lt;br /&gt;I've had superfetch turned off all day, and my hard disks's have never been so quiet.&lt;br /&gt;&lt;br /&gt;Wonderful.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now, if only there was a way to exclude folders from superfetch...&lt;br /&gt;Having a Google around there's no exclusion list, however, there is a way to refine what's going on via the registry key: &lt;br /&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters&lt;br /&gt;&lt;br /&gt;Modify the EnablePrefetcher key to one of the following settings:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Disable Caching: 0&lt;/li&gt;&lt;li&gt;Cache Applications Only: 1&lt;/li&gt;&lt;li&gt;Cache Boot Files Only: 2&lt;/li&gt;&lt;li&gt;Cache Everything (default): 3&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Experiment with this key to see if caching applications or boot files rather than everything still provides enough of a performance boost without getting bogged down.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6179682925625902039-664603443403365857?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/664603443403365857'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/664603443403365857'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2010/03/vhd-disk-images-being-read-while.html' title='VHD disk images being read while VirtualPC is not running?'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-7948643017819117678</id><published>2010-03-11T22:03:00.004Z</published><updated>2010-03-11T22:17:54.778Z</updated><title type='text'>HOWTO: Compress Virtual PC virtual hard disks (.VHDs)</title><content type='html'>If you use Virtual PC  2007 you know that the virtual hard drive files (.VHDs) can grow to  extremely large sizes. The .VHD files dynamically expand when software is installed in the .VHD. After installation, the original setup files are deleted and no longer take up space in the .VHD. However the .VHD does not correspondingly  dynamically shrink in size. Once a .VHD file expands - it doesn't  shrink.&lt;br /&gt;&lt;br /&gt;EXAMPLE: If the installation of a product uses 500MB to expand its setup files and only really consumes 200MB in the "C:\Program Files\" directory, the .VHD file expands  accordingly. When the 500MB of setup files are subsequently deleted after installation has completed, the .VHD file doesn't shrink afterwards.&lt;br /&gt;&lt;br /&gt;That is wasted host storage.&lt;br /&gt;&lt;br /&gt;So the question is:&lt;br /&gt;&lt;b&gt;How do I  shrink the size of a .VHD when I know it's inflated unnecessarily?&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here's how to do it:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;b&gt;Clear out the machine  of filler&lt;/b&gt;&lt;br /&gt;Install ccleaner from &lt;a href="http://ccleaner.com/"&gt;http://ccleaner.com&lt;/a&gt;&amp;nbsp; which deletes all temporary files from the Windows installation, Internet Explorer cache, Recycle Bin, and any number of other "garbage"/"temp" directories in the Virtual PC.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Disable hibernation&lt;/b&gt; &lt;br /&gt;Go into Power options in Control Panel and  disable hiberation to get rid of the large hybernation file.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Capture the  Virtual Disk Precompactor .ISO&lt;/b&gt; In the menu of Virtual PC  windows for your machine, capture the Virtual Disk Precompactor .ISO  file which is located at:&lt;br /&gt;x32:&amp;nbsp; &lt;b&gt;C:\Program Files\Microsoft Virtual PC\Virtual Machine Additions\Virtual Disk Precompactor.iso&lt;/b&gt;&lt;br /&gt;x64: &lt;b&gt;C:\Program Files (x86)\Microsoft Virtual PC\Virtual Machine Additions\Virtual Disk Precompactor.iso&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Run the Precompactor&lt;/b&gt; &lt;br /&gt;Go to My Computer and double click on the mounted disk. It will begin to run the precompactor software which will essentially zero out all the  free space on the disk, making it available for elimination from the  file by the Virtual Disk Wizard, which we will use later. This process may take upwards of 15 minutes depending on the size of the VHD file.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Shutdown the Virtual PC&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Run the Virtual PC - Virtual Disk Wizard&lt;/b&gt;&lt;br /&gt;From the Virtual PC console, click File --&amp;gt; Virtual Disk Wizard and "Edit an existing virtual disk" It will ask you to identify the .VHD file to reduce in size - select it.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Compact the .VHD&lt;/b&gt;&lt;br /&gt;Select the "Compact" option then select "Replacing the original file". This again will take a while.&lt;/li&gt;&lt;/ol&gt;When this process finishes, you  should have a .VHD file with a much smaller size.&lt;br /&gt;&lt;br /&gt;The other final thing you can do is on your host PC, right-click and compress the folder:&lt;br /&gt;&lt;b&gt;C:\Users\Public\Downloads\My Virtual Machines&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;As an example:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Before compression:&lt;/b&gt; The size of my 8Gb VHD file (windows xp 32bit) was reported as only taking 3Gb physical space due to folder compression.&lt;/li&gt;&lt;li&gt;&lt;b&gt;After compression:&lt;/b&gt; After following the steps above, the VHD file was 3.5Gb and was reported as taking 2.6Gb physical space due to folder compression. &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/6179682925625902039-7948643017819117678?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/7948643017819117678'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/7948643017819117678'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2010/03/howto-compress-virtual-pc-virtual-hard.html' title='HOWTO: Compress Virtual PC virtual hard disks (.VHDs)'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-6582995761690829031</id><published>2009-12-22T11:18:00.004Z</published><updated>2009-12-22T11:26:47.588Z</updated><title type='text'>SSMS handy short cut keys</title><content type='html'>In Microsoft SQL Server Management Studio, its handy to have some short cut keys to do common tasks.&lt;br /&gt;&lt;br /&gt;One handy one I always use is to "&lt;span style="font-weight: bold;"&gt;select top 100 * from&lt;/span&gt; " as I like to highlight a table name and press CTRL+4 to get the top 100 rows instantly.&lt;br /&gt;&lt;br /&gt;To set this up, go to Tools-&gt;Options-&gt;Keyboard. And type "select top 100 * from " without the quotes and making sure you add a space after the from. Very important to leave a space at the end.&lt;br /&gt;&lt;br /&gt;Highlight a table and press Ctrl+4 and the top 100 rows will be shown.&lt;br /&gt;SSMS will run your command and append the highlighted text. If your table is called USERS, it would run "select top 100 * from USERS". If you forgot to leave a space at the end, it would try and run "select top 100 * fromUSERS" which won't work.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_weEyw1YJRuo/SzCrqzlNPWI/AAAAAAAAABg/DUCQ_QmRN08/s1600-h/fred.jpg"&gt;&lt;img style="cursor: pointer; width: 400px; height: 229px;" src="http://3.bp.blogspot.com/_weEyw1YJRuo/SzCrqzlNPWI/AAAAAAAAABg/DUCQ_QmRN08/s400/fred.jpg" alt="" id="BLOGGER_PHOTO_ID_5418019103615827298" 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/6179682925625902039-6582995761690829031?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/6582995761690829031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/6582995761690829031'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2009/12/ssms-handy-short-cut-keys.html' title='SSMS handy short cut keys'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_weEyw1YJRuo/SzCrqzlNPWI/AAAAAAAAABg/DUCQ_QmRN08/s72-c/fred.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-6962686335799679760</id><published>2009-12-01T11:58:00.007Z</published><updated>2009-12-11T17:23:12.025Z</updated><title type='text'>table-values functions. Make sure you write them as inline.</title><content type='html'>Here is a multi-line statement (slow):&lt;br /&gt;&lt;br /&gt;&lt;div    style="background: white none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;font-family:Courier New;font-size:10pt;color:black;"&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;CREATE &lt;/span&gt;FUNCTION dbo.fnSomeReport&lt;br /&gt;(&lt;br /&gt;@someParam &lt;span style="color:blue;"&gt;INT&lt;/span&gt;,&lt;br /&gt;@field_company_id &lt;span style="color:blue;"&gt;INT &lt;/span&gt;= &lt;span style="color:blue;"&gt;NULL&lt;/span&gt;&lt;br /&gt;)&lt;br /&gt;RETURNS @result &lt;span style="color:blue;"&gt;TABLE&lt;/span&gt;&lt;br /&gt;(&lt;br /&gt;[field_company_name] &lt;span style="color:blue;"&gt;VARCHAR&lt;/span&gt;(255),&lt;br /&gt;[engineer] &lt;span style="color:blue;"&gt;VARCHAR&lt;/span&gt;(100),&lt;br /&gt;[sku] &lt;span style="color:blue;"&gt;VARCHAR&lt;/span&gt;(30)&lt;br /&gt;)&lt;br /&gt;&lt;span style="color:blue;"&gt;AS&lt;/span&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;BEGIN&lt;/span&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;INSERT INTO &lt;/span&gt;@result&lt;br /&gt;(&lt;br /&gt;[field_company_name],&lt;br /&gt;[engineer],&lt;br /&gt;[sku]&lt;br /&gt;)&lt;br /&gt;&lt;span style="color:blue;"&gt;SELECT &lt;/span&gt;field_company_name, engineer, sku&lt;br /&gt;&lt;span style="color:blue;"&gt;FROM &lt;/span&gt;...&lt;br /&gt;&lt;span style="color:blue;"&gt;WHERE &lt;/span&gt;ID &amp;gt; someParam&lt;br /&gt;&lt;span style="color:blue;"&gt;AND &lt;/span&gt;(@field_company_id &lt;span style="color:blue;"&gt;IS NULL&lt;br /&gt; OR &lt;/span&gt;field_company_id = @field_company_id)&lt;br /&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;RETURN&lt;/span&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;END&lt;/span&gt;&lt;br /&gt;GO&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now as an inline statement (fast)&lt;br /&gt;&lt;div    style="background: white none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;font-family:Courier New;font-size:10pt;color:black;"&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;CREATE &lt;/span&gt;FUNCTION dbo.fnSomeReport&lt;br /&gt;(&lt;br /&gt;@someParam &lt;span style="color:blue;"&gt;INT&lt;/span&gt;,&lt;br /&gt;@field_company_id &lt;span style="color:blue;"&gt;INT &lt;/span&gt;= &lt;span style="color:blue;"&gt;NULL&lt;/span&gt;&lt;br /&gt;)&lt;br /&gt;RETURNS &lt;span style="color:blue;"&gt;TABLE AS&lt;/span&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;RETURN&lt;/span&gt;&lt;br /&gt;(&lt;br /&gt;&lt;span style="color:blue;"&gt;SELECT &lt;/span&gt;field_company_name, engineer, sku&lt;br /&gt;&lt;span style="color:blue;"&gt;FROM &lt;/span&gt;...&lt;br /&gt;&lt;span style="color:blue;"&gt;WHERE &lt;/span&gt;ID &amp;gt; someParam&lt;br /&gt;&lt;span style="color:blue;"&gt;AND &lt;/span&gt;(@field_company_id &lt;span style="color:blue;"&gt;IS NULL&lt;br /&gt;    OR &lt;/span&gt;field_company_id = @field_company_id)&lt;br /&gt;)&lt;br /&gt;GO&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Right then whats going on and what the hell is all the fuss about anyway?&lt;/span&gt;&lt;br /&gt;The query optimizer expands the function as if it was a macro, and &lt;u&gt;generates the plan as if you had provided the expanded query&lt;/u&gt;. Thus, there is no performance cost for packaging a SELECT statement into a table-valued function. For this reason, when you want to reuse a stored procedure that consists of a single SELECT statement, rewriting it into an inline UDF is without doubt the best choice. (Or instead of rewriting it, move the SELECT into a UDF, and rewrite the existing procedure as a wrapper on the function, so that the client is unaffected.)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Why is the multi-line function bad?&lt;/span&gt;&lt;br /&gt;A multi-statement function has a body that can have as many statements as you like. You need to declare a return table, and you insert the data to return into that table.&lt;br /&gt;&lt;br /&gt;You use multi-statement functions as inline functions, but in difference to inline functions, they are not expanded in place, but instead it's like you would call a stored procedure in the middle of the query, and return the data in a temp table. This permits you to move more complex stored procedure into functions.&lt;br /&gt;&lt;br /&gt;Compared to inline functions, multi-statement functions incur some overhead due to the return table. More important, though, is that if you use the function in a query, the optimizer will have no idea of what the function returns, and will make standard assumptions. Many times this is not a real issue, but particularly if the result is huge, it can be.&lt;br /&gt;&lt;br /&gt;In most cases, you want to avoid the use of scalar UDFs in SELECT, WHERE, GROUP BY and ORDER BY clauses. These will essentially force the optimizer to execute the function once for each row in the query, and depending on the complexity of the function, this could bring your system to its knees.&lt;br /&gt;&lt;br /&gt;A view does not accept parameters. To restrict the rows returned by a view, you use a WHERE clause in the query that is accessing the view, not in the view itself. Table-valued functions, are more like parameterized views; in fact, they were called parameterized views during development, according to Hal Berenson.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Inline table-valued functions &lt;/span&gt;- These are better than scalar functions. Some will say they are preferential over stored procedures because they can easily be used in JOINs and regular SELECTs; some will say they are preferential over views because they can be parameterized. In this way, they behave just like Access parameterized views, with the added benefit that a query plan can be cached.&lt;br /&gt;&lt;br /&gt;Other links:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://databases.aspfaq.com/database/should-i-use-a-view-a-stored-procedure-or-a-user-defined-function.html"&gt;Should I use a view, a stored procedure, or a user-defined function?&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://scarydba.wordpress.com/2008/08/13/view-vs-table-valued-function-vs-multi-statement-table-valued-function/"&gt;View vs. Table Valued Function vs. Multi-Statement Table Valued Function&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6179682925625902039-6962686335799679760?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/6962686335799679760'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/6962686335799679760'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2009/12/table-values-functions-make-sure-you.html' title='table-values functions. Make sure you write them as inline.'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-2850181935643821967</id><published>2009-11-17T21:34:00.003Z</published><updated>2009-11-17T21:46:42.170Z</updated><title type='text'>PLINQO - Get it, use it, love it</title><content type='html'>I've stumbled across a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;LINQ&lt;/span&gt; to &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;SQL&lt;/span&gt; extension called &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;PLINQO&lt;/span&gt; freely &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_3"&gt;downloadable&lt;/span&gt; at &lt;a href="http://plinqo.com/"&gt;http://plinqo.com/&lt;/a&gt; and includes source code.&lt;br /&gt;&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;PLINQO&lt;/span&gt; is a set of &lt;a href="http://www.codesmithtools.com"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;CodeSmith&lt;/span&gt; &lt;/a&gt;templates that generates code for you around your &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;LINQ&lt;/span&gt; to &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;SQL&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;DBML&lt;/span&gt; file. It generates Manager classes and Query classes automatically (it does this by looking at your primary keys, indexes and foreign key constraints).&lt;br /&gt;&lt;br /&gt;You must buy &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;CodeSmith&lt;/span&gt;, which is the template engine, but &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;PLINQO&lt;/span&gt; is free.&lt;br /&gt;&lt;br /&gt;Its actually quite amazing and saves you tons of time and energy creating boiler plate code. So glad I found it, now I want you to investigate it too. Go check out the &lt;a href="http://plinqo.com/Video%20Tutorials.ashx"&gt;video tutorials&lt;/a&gt; to see what I mean. &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_11"&gt;Awesome&lt;/span&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6179682925625902039-2850181935643821967?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/2850181935643821967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/2850181935643821967'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2009/11/plinqo-get-it-use-it-love-it.html' title='PLINQO - Get it, use it, love it'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-3803076931372809718</id><published>2009-11-12T12:52:00.003Z</published><updated>2009-11-12T13:15:27.594Z</updated><title type='text'>Virtual Machine Key Combinations with Hyper-V</title><content type='html'>Taken from &lt;a href="http://blogs.msdn.com/virtual_pc_guy/archive/2008/01/14/virtual-machine-connection-key-combinations-with-hyper-v.aspx"&gt;here&lt;/a&gt; and kept for prosperity incase the information was ever lost. So all credit for the following information goes to &lt;a href="http://blogs.msdn.com/virtual_pc_guy/default.aspx"&gt;Ben Armstrong&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;table border="1" cellpadding="2" cellspacing="0"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top"&gt;&lt;strong&gt;Standard Windows Key combination&lt;/strong&gt;&lt;/td&gt;        &lt;td valign="top"&gt;&lt;strong&gt;Virtual Machine Connection Key Combination&lt;/strong&gt;&lt;/td&gt;        &lt;td valign="top"&gt;&lt;strong&gt;Explanation&lt;/strong&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top"&gt;CTRL + ALT + DEL&lt;/td&gt;        &lt;td valign="top"&gt;CTRL + ALT + END&lt;/td&gt;        &lt;td valign="top"&gt;Displays the Task Manager or Windows Security dialog box on Windows (or logs in).&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top"&gt;ALT + TAB&lt;/td&gt;        &lt;td valign="top"&gt;ALT + PAGE UP&lt;/td&gt;        &lt;td valign="top"&gt;Switches between programs from left to right.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top"&gt;ALT + SHIFT + TAB&lt;/td&gt;        &lt;td valign="top"&gt;ALT + PAGE DOWN&lt;/td&gt;        &lt;td valign="top"&gt;Switches between programs from right to left.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top"&gt;ALT + ESC&lt;/td&gt;        &lt;td valign="top"&gt;ALT + INSERT&lt;/td&gt;        &lt;td valign="top"&gt;Cycles through the programs in the order they were started.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top"&gt;CTRL + ESC&lt;/td&gt;        &lt;td valign="top"&gt;ALT + HOME&lt;/td&gt;        &lt;td valign="top"&gt;Displays the Windows Start menu.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top"&gt;N/A&lt;/td&gt;        &lt;td valign="top"&gt;CTRL + ALT + PAUSE&lt;/td&gt;        &lt;td valign="top"&gt;Changes the Virtual Machine Connection window to / from full screen mode.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top"&gt;N/A&lt;/td&gt;        &lt;td valign="top"&gt;CTRL + ALT + LEFT ARROW&lt;/td&gt;        &lt;td valign="top"&gt;Releases mouse and keyboard focus from the Virtual Machine Connection window.&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Some extra things to know about Virtual Machine Connection key combinations:&lt;/p&gt;  &lt;ul&gt;&lt;li&gt;By default the standard Windows key combinations do not get sent to the virtual machine, unless you are in full screen mode.  You can change this so that they are always sent to the virtual machine (if the Virtual Machine Connection has focus) by going to the Hyper-V Manager and selecting &lt;strong&gt;Hyper-V Server Settings...&lt;/strong&gt; and then &lt;strong&gt;Keyboard&lt;/strong&gt; and selecting the &lt;strong&gt;Use on the virtual machine&lt;/strong&gt; option.  I always enable this setting.   &lt;br /&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Note: CTRL + ALT + DEL will always go to the physical computer - so you need to use CTRL + ALT + END no matter what you select for a setting here.&lt;br /&gt;  &lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;You can change the release key combination (CTRL + ALT + LEFT ARROW) by going to the Hyper-V Manager and selecting &lt;strong&gt;Hyper-V Server Settings...&lt;/strong&gt; and then &lt;strong&gt;Release Key&lt;/strong&gt; and selecting one of the options from the drop down (I usually change my release key combination to be CTRL + ALT + SHIFT as I find it easier to type).&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If you use the Virtual Machine Connection under an existing Remote Desktop Connection (not recommended - but I do it all the time) the Remote Desktop Connection will grab all of these key combinations before the Virtual Machine Connection gets to see them (even the release key combination).  To deal with this you will need to change the Hyper-V Server setting to allow Windows key combinations to go to the virtual machine, change the release key combination to something other than CTRL + ALT + LEFT ARROW, and use the toolbar button or Action menu of the Virtual Machine Connection to send CTRL + ALT + DEL to the virtual machine.&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/6179682925625902039-3803076931372809718?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/3803076931372809718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/3803076931372809718'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2009/11/virtual-machine-key-combinations-with.html' title='Virtual Machine Key Combinations with Hyper-V'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-7451812061167912076</id><published>2009-09-29T12:53:00.002+01:00</published><updated>2009-09-29T13:02:59.465+01:00</updated><title type='text'>Execution of user code in the .NET Framework is disabled</title><content type='html'>I was testing our new SQL Server 2008 enterprise cluster today and managed to get the following SqlException running a C# application:&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;"Execution of user code in the .NET Framework is disabled. Enable "clr enabled" configuration option.&lt;br /&gt;The statement has been terminated."&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The solution is to run the following:&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;EXEC &lt;/span&gt;&lt;span style="color: rgb(102, 0, 0);font-family:courier new;" &gt;sp_configure&lt;/span&gt;&lt;span style="color: rgb(204, 0, 0);font-family:courier new;" &gt; &lt;span style="color: rgb(255, 0, 0);"&gt;'show advanced options'&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;,&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);font-family:courier new;" &gt; '1'&lt;/span&gt;&lt;span style="font-family:courier new;"&gt; ;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;go&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;RECONFIGURE&lt;/span&gt;&lt;span style="font-family:courier new;"&gt; ;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;go&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;EXEC&lt;/span&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;span style="color: rgb(102, 0, 0);font-family:courier new;" &gt;sp_configure&lt;/span&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);font-family:courier new;" &gt;'clr enabled'&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;,&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);font-family:courier new;" &gt; '1'&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;go&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;RECONFIGURE&lt;/span&gt;&lt;span style="font-family:courier new;"&gt; ;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);font-family:courier new;" &gt;-- Turn advanced options back off&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);font-family:courier new;" &gt;-- EXEC sp_configure 'show advanced options' , '0';&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;GO&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6179682925625902039-7451812061167912076?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/7451812061167912076'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/7451812061167912076'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2009/09/execution-of-user-code-in-net-framework.html' title='Execution of user code in the .NET Framework is disabled'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-8534172469851655020</id><published>2009-09-25T11:47:00.002+01:00</published><updated>2009-09-25T11:58:42.984+01:00</updated><title type='text'>Web Deployment Tool 1.0 has shipped</title><content type='html'>After 2 years of development and lots of customer feedback, the Web Deployment Tool has shipped the RTW of version 1.0&lt;br /&gt;&lt;br /&gt;Click &lt;a href="http://blogs.iis.net/msdeploy/archive/2009/09/24/web-deployment-tool-1-0-has-shipped.aspx"&gt;here&lt;/a&gt; to be taken to the IIS Blog.&lt;br /&gt;&lt;br /&gt;Click &lt;a href="http://www.iis.net/extensions/WebDeploymentTool"&gt;here&lt;/a&gt; to be taken to the download site.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6179682925625902039-8534172469851655020?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/8534172469851655020'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/8534172469851655020'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2009/09/web-deployment-tool-10-has-shipped.html' title='Web Deployment Tool 1.0 has shipped'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-7717769507791365359</id><published>2009-07-24T15:33:00.004+01:00</published><updated>2009-10-09T21:44:29.098+01:00</updated><title type='text'>I love the Linq to REST capability</title><content type='html'>All without changes to your C# code at all. Awsome.&lt;br /&gt;&lt;br /&gt;Just watched &lt;a href="http://media01.smartcom.no/Microsite/go.aspx?eventid=4499&amp;amp;urlback=null&amp;amp;bitrate=2886271"&gt;Scott Hanselman's ADO.NET Data Services&lt;/a&gt; talk from NDC09. Rather good, so go watch.&lt;br /&gt;Given that it  (ADO.NET Data Services) is agnostic of EntityFramework, Ling2Sql, NHibernate, or MyHomeGrownOrm, seems like a good basis for implementing simple CRUD style services.&lt;br /&gt;&lt;br /&gt;Looking at it I can see the appeal and its a good way to go. You could easily plug in a mock objects with test data pretending to be your database for NUnit testing your code with ease.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6179682925625902039-7717769507791365359?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/7717769507791365359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/7717769507791365359'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2009/07/i-love-linq-to-rest-capability.html' title='I love the Linq to REST capability'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-4412168630187032522</id><published>2009-01-10T22:58:00.005Z</published><updated>2009-01-10T23:47:21.789Z</updated><title type='text'>Windows Server 2008 as a Workstation</title><content type='html'>Well, its well known that Windows Server 2008 is 11-19% faster than Vista, and its using the Vista kernel. There's a ton of articles and i'm not going to list them here.&lt;br /&gt;&lt;br /&gt;But what I am going to show you is how to do it.&lt;br /&gt;&lt;br /&gt;Quoting from &lt;a href="http://www.itwire.com/content/view/17140/1103/1/0/"&gt;Alex Zaharov-Reutt&lt;/a&gt;&lt;br /&gt;&lt;blockquote&gt;Although using server versions of Windows as desktop/workstation versions over the years certainly isn’t new, the source of the latest drive to turn Windows Server 2008 into Windows Workstation Vista 2008 seems to have come from Microsoft employee Vijayshinva Karnure, in his blog “The Way I See It”.&lt;br /&gt;&lt;br /&gt;Karnure works at Microsoft India, and in a &lt;a href="http://blogs.msdn.com/vijaysk/archive/2008/02/11/using-windows-server-2008-as-a-super-desktop-os.aspx" target="_blank"&gt;blog entry&lt;/a&gt;  called “Using Windows Server 2008 as a SUPER workstation OS”, and in a &lt;a href="http://blogs.msdn.com/vijaysk/archive/2008/02/20/using-windows-server-2008-as-a-super-workstation-os-cont-d.aspx" target="_blank"&gt;follow up “Cont’d”&lt;/a&gt;  posting, he outlined what Server 2008 users need to do to enable all the Vista-esque workstation goodness.&lt;br /&gt;&lt;br /&gt;Another &lt;a href="http://www.win2008workstation.com/wordpress/" target="_blank"&gt;website&lt;/a&gt;  called “Convert your Windows Server 2008 to a Workstation!” offers a “Windows Server 2008 to Workstation Manual”.&lt;br /&gt;&lt;br /&gt;Reasons why Server 2008 might be faster include the lack of DRM found in Vista, and the additional time (and incentive) Microsoft has had to get Server 2008 robust and fast, given the fact it is meant to be used in business environments which expect high-performance software and hardware.&lt;/blockquote&gt;&lt;br /&gt;Reveals some excellent must see/download links:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;It can look like this: &lt;a href="http://www.win2008workstation.com/wordpress/2008/03/08/final-windows-2008-workstation/"&gt;server 2008 aero screenshots&lt;/a&gt;&lt;/li&gt;&lt;li&gt;If your sitting on the fence and don't really know if you should use Windows XP, Windows Vista, or Windows Server 2008. Read &lt;a href="http://www.win2008workstation.com/wordpress/2008/03/16/why-should-i-use-a-server-os-for-my-workstation/"&gt;this&lt;/a&gt;. However, if your PC is old and slow, stick with XP. XP will always be faster than vista and server 2008 because it does less. Read Tomshardware &lt;a href="http://www.tomshardware.com/reviews/xp-vs-vista,1531.html"&gt;Windows XP vs Vista benchmark&lt;/a&gt; guide. Its close on all counts apart from Open GL applications such as Maya, 3DS Max, Ensign, Lightscape where Vista is 90% slower due do its lack of OpenGL support. &lt;blockquote&gt;There are some programs that showed deeply disappointing performance. Unreal Tournament 2004 and the professional graphics benchmarking suite SPECviewperf 9.03 suffered heavily from the lack of support for the OpenGL graphics library under Windows Vista. This is something we expected, and we clearly advise against replacing Windows XP with Windows Vista if you need to run professional graphics applications. Both ATI and Nvidia will offer OpenGL support in upcoming driver releases, but it remains to be seen if and how other graphics vendors or Microsoft may offer it.&lt;/blockquote&gt;&lt;br /&gt;However, my glass is always half full and I'm forever optimistic. Can you honestly see large companies like Autodesk (owners of Maya and 3DS Max) sitting back idly while their applications run like a dog on Vista? I'm sure they're poking ATI and nVidia in the ribs as you read this.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.win2008workstation.com/wordpress/2008/07/17/windows-server-2008-workstation-converter/"&gt;Windows Server 2008 Workstation Converter&lt;/a&gt;. This program automatically converts your server 2008 into a workstation. Totally excellent and a must have.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.win2008workstation.com/wordpress/wp-content/uploads/2008/07/converter_general.jpg"&gt;&lt;img style="cursor: pointer; width: 499px; height: 338px;" src="http://www.win2008workstation.com/wordpress/wp-content/uploads/2008/07/converter_general.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If you don't want to use the above program, you can do it by hand by following &lt;a href="http://www.win2008workstation.com/wordpress/"&gt;this guide&lt;/a&gt;, or download the full &lt;a href="http://www.win2008workstation.com/forum/viewtopic.php?f=2&amp;amp;t=11"&gt;PDF guide&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Another guide by Vijayshinva Karnure is here: &lt;a href="http://blogs.msdn.com/vijaysk/archive/2008/02/11/using-windows-server-2008-as-a-super-desktop-os.aspx"&gt;Page1&lt;/a&gt;, &lt;a href="http://blogs.msdn.com/vijaysk/archive/2008/02/20/using-windows-server-2008-as-a-super-workstation-os-cont-d.aspx"&gt;Page2&lt;/a&gt;.&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-weight: bold;"&gt;Are there any drawback to using a Server OS?&lt;/span&gt;&lt;br /&gt;Yes, in fact.&lt;br /&gt;Most things will work just fine, however some setups detect Windows Server 2008 as a server OS and may not install. Diskeeper for example, or any other software vendor with a workstation and server version of their product.&lt;br /&gt;The compatibility mode does not have a Vista option, only XP/Windows 2003 and other legacy OS.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6179682925625902039-4412168630187032522?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/4412168630187032522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/4412168630187032522'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2009/01/windows-server-2008-as-workstation.html' title='Windows Server 2008 as a Workstation'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-1806481027905653850</id><published>2008-12-31T12:25:00.005Z</published><updated>2009-02-26T23:35:04.289Z</updated><title type='text'>Blackberry 8800 video encoding - How to</title><content type='html'>Download this free encoder: &lt;a href="http://www.erightsoft.com/SUPER.html"&gt;http://www.erightsoft.com/SUPER.html&lt;/a&gt;&lt;br /&gt;The download link is very hard to find, so its &lt;a href="http://erightsoft.podzone.net/GetFile.php?SUPERsetup.exe"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Use these settings:&lt;/span&gt;&lt;br /&gt;Output container: AVI&lt;br /&gt;Video Codec: DIVX&lt;br /&gt;Audio Codec: mp3&lt;br /&gt;Encoder: MEncoder&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Video settings&lt;/span&gt;&lt;br /&gt;Size: 320:176&lt;br /&gt;Aspect: 16:9&lt;br /&gt;Frame/sec: 12.5 (pal) 14.985 (NTSC)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Audio settings&lt;/span&gt;&lt;br /&gt;Sampling freq: 22050&lt;br /&gt;Channels: 2&lt;br /&gt;Bitrate: 64&lt;br /&gt;Audio stream: default&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_weEyw1YJRuo/SVtulOEq8yI/AAAAAAAAABI/tUfS4lJrKrw/s1600-h/fred.gif"&gt;&lt;img style="cursor: pointer; width: 371px; height: 400px;" src="http://4.bp.blogspot.com/_weEyw1YJRuo/SVtulOEq8yI/AAAAAAAAABI/tUfS4lJrKrw/s400/fred.gif" alt="" id="BLOGGER_PHOTO_ID_5285940173361312546" 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/6179682925625902039-1806481027905653850?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/1806481027905653850'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/1806481027905653850'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2008/12/blackberry-8800-video-encoding-how-to.html' title='Blackberry 8800 video encoding - How to'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_weEyw1YJRuo/SVtulOEq8yI/AAAAAAAAABI/tUfS4lJrKrw/s72-c/fred.gif' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-558490692973118142</id><published>2008-12-19T23:30:00.004Z</published><updated>2008-12-19T23:46:33.495Z</updated><title type='text'>A generic singleton - Part 2</title><content type='html'>Here is the critique and why there is a better solution to the article: &lt;a href="http://simon-hughes.blogspot.com/2008/09/templated-singleton.html"&gt;A generic singleton&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Well, it isn't really singleton - since you can't control &lt;code&gt;T&lt;/code&gt;, there can be as many &lt;code&gt;T&lt;/code&gt; instances as you like.&lt;br /&gt;&lt;p&gt;The code does check for non-public constructors, which is good. However, this is a check which is only performed at execution time - there's no &lt;em&gt;compile-time&lt;/em&gt; check, which is a strike against it. It also relies on having enough access to call the non-public constructor, which adds some limitations.&lt;/p&gt;  &lt;p&gt;In addition, it doesn't prohibit &lt;em&gt;internal&lt;/em&gt; constructors - so you can end up with non-singletons.&lt;/p&gt;&lt;p&gt;There is an excellent article on singletons at &lt;a href="http://www.yoda.arachsys.com/csharp/singleton.html" class="comment-user" rel="nofollow"&gt;http://www.yoda.arachsys.com/csharp/singleton.html&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Here are two proper implementations:&lt;/p&gt; &lt;div    style="background: white none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;font-family:Courier;font-size:10pt;color:black;"&gt; &lt;pre style="margin: 0px;"&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;sealed&lt;/span&gt; &lt;span style="color:blue;"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Singleton&lt;/span&gt;&lt;/pre&gt; &lt;pre style="margin: 0px;"&gt;{&lt;/pre&gt; &lt;pre style="margin: 0px;"&gt;    &lt;span style="color:blue;"&gt;static&lt;/span&gt; &lt;span style="color:blue;"&gt;readonly&lt;/span&gt; Singleton instance = &lt;span style="color:blue;"&gt;new&lt;/span&gt; Singleton();&lt;/pre&gt; &lt;pre style="margin: 0px;"&gt; &lt;/pre&gt; &lt;pre style="margin: 0px;"&gt;    &lt;span style="color:green;"&gt;// Explicit static constructor to tell C# compiler&lt;/span&gt;&lt;/pre&gt; &lt;pre style="margin: 0px;"&gt;    &lt;span style="color:green;"&gt;// not to mark type as &lt;a href="http://www.yoda.arachsys.com/csharp/beforefieldinit.html"&gt;beforefieldinit&lt;/a&gt;&lt;/span&gt;&lt;/pre&gt; &lt;pre style="margin: 0px;"&gt;    &lt;span style="color:blue;"&gt;static&lt;/span&gt; Singleton()&lt;/pre&gt; &lt;pre style="margin: 0px;"&gt;    {&lt;/pre&gt; &lt;pre style="margin: 0px;"&gt;    }&lt;/pre&gt; &lt;pre style="margin: 0px;"&gt; &lt;/pre&gt; &lt;pre style="margin: 0px;"&gt;    Singleton()&lt;/pre&gt; &lt;pre style="margin: 0px;"&gt;    {&lt;/pre&gt; &lt;pre style="margin: 0px;"&gt;    }&lt;/pre&gt; &lt;pre style="margin: 0px;"&gt; &lt;/pre&gt; &lt;pre style="margin: 0px;"&gt;    &lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;static&lt;/span&gt; Singleton Instance&lt;/pre&gt; &lt;pre style="margin: 0px;"&gt;    {&lt;/pre&gt; &lt;pre style="margin: 0px;"&gt;        &lt;span style="color:blue;"&gt;get&lt;/span&gt; { &lt;span style="color:blue;"&gt;return&lt;/span&gt; instance; }&lt;/pre&gt; &lt;pre style="margin: 0px;"&gt;    }&lt;/pre&gt; &lt;pre style="margin: 0px;"&gt;}&lt;/pre&gt; &lt;pre style="margin: 0px;"&gt;&lt;br /&gt;Or simply:&lt;/pre&gt; &lt;pre style="margin: 0px;"&gt;&lt;span style="color:blue;"&gt;&lt;br /&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Singleton&lt;/span&gt;&lt;/pre&gt; &lt;pre style="margin: 0px;"&gt;{&lt;/pre&gt; &lt;pre style="margin: 0px;"&gt;    &lt;span style="color:blue;"&gt;private&lt;/span&gt; &lt;span style="color:blue;"&gt;static&lt;/span&gt; Singleton _instance = &lt;span style="color:blue;"&gt;new&lt;/span&gt; Singleton();&lt;/pre&gt; &lt;pre style="margin: 0px;"&gt;    &lt;span style="color:blue;"&gt;private&lt;/span&gt; Singleton() {}&lt;/pre&gt; &lt;pre style="margin: 0px;"&gt;    &lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;static&lt;/span&gt; Singleton Instance { &lt;span style="color:blue;"&gt;get&lt;/span&gt; { &lt;span style="color:blue;"&gt;return&lt;/span&gt; _instance; }}&lt;/pre&gt; &lt;pre style="margin: 0px;"&gt;}&lt;/pre&gt; &lt;/div&gt;  &lt;p&gt;Both of these classes removes the need for locking, as a static constructor is thread safe.&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6179682925625902039-558490692973118142?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/558490692973118142'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/558490692973118142'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2008/12/generic-singleton-part-2.html' title='A generic singleton - Part 2'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-8463673375946268270</id><published>2008-12-19T23:17:00.003Z</published><updated>2008-12-19T23:48:05.088Z</updated><title type='text'>Surprising SQL speed increase - Part 2</title><content type='html'>&lt;div class="post-text"&gt;&lt;p&gt;&lt;a href="http://simon-hughes.blogspot.com/2008/10/surprising-sql-speed-increase.html"&gt;Part 1&lt;/a&gt; is availble below&lt;br /&gt;&lt;/p&gt;&lt;p&gt;More generally speaking, you should never use a function on the LEFT side of a WHERE clause in a query. If you do, SQL won't use an index--it has to evaluate the function for every row of the table. The goal is to make sure that your where clause is "&lt;a href="http://en.wikipedia.org/wiki/Sargable" rel="nofollow"&gt;Sargable&lt;/a&gt;"&lt;/p&gt;  &lt;p&gt;Some other examples:&lt;/p&gt;&lt;div    style="background: white none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;font-family:Courier;font-size:10pt;color:black;"&gt;&lt;br /&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Bad: &lt;/span&gt;&lt;span style="color:blue;"&gt;Select &lt;/span&gt;... &lt;span style="color:blue;"&gt;WHERE isNull&lt;/span&gt;(FullName,&lt;span style="color: rgb(163, 21, 21);"&gt;''&lt;/span&gt;) = &lt;span style="color: rgb(163, 21, 21);"&gt;'Ed Jones'&lt;/span&gt;&lt;/p&gt;Fixed: &lt;span style="color:blue;"&gt;Select &lt;/span&gt;... &lt;span style="color:blue;"&gt;WHERE &lt;/span&gt;((FullName = &lt;span style="color: rgb(163, 21, 21);"&gt;'Ed Jones'&lt;/span&gt;) &lt;span style="color:blue;"&gt;OR &lt;/span&gt;(FullName &lt;span style="color:blue;"&gt;IS NULL&lt;/span&gt;))&lt;br /&gt;&lt;br /&gt;&lt;p style="margin: 0px;"&gt;Bad: &lt;span style="color:blue;"&gt;Select &lt;/span&gt;... &lt;span style="color:blue;"&gt;WHERE SUBSTRING&lt;/span&gt;(DealerName,&lt;span style="color:teal;"&gt;4&lt;/span&gt;) = &lt;span style="color: rgb(163, 21, 21);"&gt;'Ford'&lt;/span&gt;&lt;/p&gt;Fixed: &lt;span style="color:blue;"&gt;Select &lt;/span&gt;... &lt;span style="color:blue;"&gt;WHERE &lt;/span&gt;DealerName &lt;span style="color:blue;"&gt;Like &lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;'Ford%'&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;p style="margin: 0px;"&gt; &lt;/p&gt;Bad: &lt;span style="color:blue;"&gt;Select &lt;/span&gt;... &lt;span style="color:blue;"&gt;WHERE DateDiff&lt;/span&gt;(mm,OrderDate,&lt;span style="color:blue;"&gt;GetDate&lt;/span&gt;()) &gt;= &lt;span style="color:teal;"&gt;30&lt;/span&gt;&lt;br /&gt;&lt;p style="margin: 0px;"&gt;Fixed: &lt;span style="color:blue;"&gt;Select &lt;/span&gt;... &lt;span style="color:blue;"&gt;WHERE &lt;/span&gt;OrderDate &lt; &lt;span style="color:blue;"&gt;DateAdd&lt;/span&gt;(mm,-&lt;span style="color:teal;"&gt;30&lt;/span&gt;,&lt;span style="color:blue;"&gt;GetDate&lt;/span&gt;()) &lt;/p&gt;&lt;br /&gt;&lt;p style="margin: 0px;"&gt;Bad: &lt;span style="color:blue;"&gt;Select &lt;/span&gt;... &lt;span style="color:blue;"&gt;WHERE Year&lt;/span&gt;(OrderDate) = &lt;span style="color:teal;"&gt;2003&lt;/span&gt;&lt;/p&gt;Fixed: &lt;span style="color:blue;"&gt;Select &lt;/span&gt;... &lt;span style="color:blue;"&gt;WHERE &lt;/span&gt;OrderDate &gt;= &lt;span style="color: rgb(163, 21, 21);"&gt;'2003-1-1' &lt;/span&gt;&lt;span style="color:blue;"&gt;AND &lt;/span&gt;OrderDate &lt; &lt;span style="color: rgb(163, 21, 21);"&gt;'2004-1-1'&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6179682925625902039-8463673375946268270?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/8463673375946268270'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/8463673375946268270'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2008/12/surprising-sql-speed-increase-part-2.html' title='Surprising SQL speed increase - Part 2'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-655612730705936551</id><published>2008-11-06T11:07:00.002Z</published><updated>2008-11-06T11:10:34.518Z</updated><title type='text'></title><content type='html'>&lt;span style="font-size:130%;"&gt;&lt;strong&gt;The 3 Minute Management Course&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Lesson 1&lt;/strong&gt;&lt;br /&gt;A man is getting into the shower just as his wife is finishing up her shower, when the doorbell rings. The wife quickly wraps herself in a towel and runs downstairs. When she opens the door, there stands Bob, the next-door neighbour. Before she says a word, Bob says, "I'll give you £800 to drop that towel." After thinking for a moment, the woman drops her towel and stands naked in front of Bob. After a few seconds, Bob hands her £800 and leaves.&lt;br /&gt;&lt;br /&gt;The woman wraps back up in the towel and goes back upstairs. When she gets to the bathroom, her husband asks, "Who was that?" "It was Bob the next door neighbour," she replies. "Great!" the husband says, "did he say anything about the £800 he owes me?"&lt;br /&gt;&lt;br /&gt;Moral of the story: If you share critical information pertaining to credit and risk with your shareholders in time, you may be in a position to prevent avoidable exposure&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Lesson 2&lt;br /&gt;&lt;/strong&gt;A priest offered a Nun a lift. She got in and crossed her legs, forcing her gown to reveal a leg. The priest nearly had an accident. After controlling the car, he stealthily slid his hand up her leg. The nun said, "Father, remember Psalm 129?" The priest removed his hand. But, changing gears, he let his hand slide up her leg again. The nun once again said, "Father, remember Psalm 129?" The priest apologised "Sorry sister but the flesh is weak." Arriving at the convent, the nun went on her way. On his arrival at the church, the priest rushed to look up Psalm 129. It said, "Go forth and seek, further up, you will find glory."&lt;br /&gt;&lt;br /&gt;Moral of the story: If you are not well informed in your job, you might miss a great opportunity&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Lesson 3&lt;br /&gt;&lt;/strong&gt;A sales rep, an administration clerk, and the manager are walking to lunch when they find an antique oil lamp. They rub it and a Genie comes out. The Genie says, "I'll give each of you just one wish." "Me first! Me first!" says the admin clerk. "I want to be in the Bahamas, driving a speedboat, without a care in the world." Puff! She's gone.&lt;br /&gt;&lt;br /&gt;"Me next! Me next!" says the sales rep. "I want to be in Hawaii, relaxing on the beach with my personal masseuse, an endless supply of Pina Coladas and the love of my life." Puff! He's gone.&lt;br /&gt;&lt;br /&gt;"OK, you're up," the Genie says to the manager. The manager says, "I want those two back in the office after lunch."&lt;br /&gt;&lt;br /&gt;Moral of the story: Always let your boss have the first say.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Lesson 4&lt;br /&gt;&lt;/strong&gt;An eagle was sitting on a tree resting, doing nothing. A small rabbit saw the eagle and asked him, "Can I also sit like you and do nothing?" The eagle answered: "Sure, why not." So, the rabbit sat on the ground below the eagle and rested. All of a sudden, a fox appeared, jumped on the rabbit and ate it.&lt;br /&gt;&lt;br /&gt;Moral of the story: To be sitting and doing nothing, you must be sitting very, very high up&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Lesson 5&lt;/strong&gt;&lt;br /&gt;A turkey was chatting with a bull. "I would love to be able to get to the top of that tree," sighed the turkey, "but I haven't got the energy."&lt;br /&gt;"Well, why don't you nibble on some of my droppings?" replied the bull. They're packed with nutrients." The turkey pecked at a lump of dung, and found it actually gave him enough strength to reach the lowest branch of the tree.&lt;br /&gt;&lt;br /&gt;The next day, after eating some more dung, he reached the second branch. Finally after a fourth night, the turkey was proudly perched at the top of the tree. He was promptly spotted by a farmer, who shot him out of the tree.&lt;br /&gt;&lt;br /&gt;Moral of the story:  Bull Shit might get you to the top, but it won't keep you there&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Lesson 6&lt;br /&gt;&lt;/strong&gt;A little bird was flying south for the winter. It was so cold the bird froze and fell to the ground into a large field. While he was lying there, a cow came by and dropped some dung on him. As the frozen bird lay there in the pile of cow dung, he began to realize how warm he was. The dung was actually thawing him out! He lay there all warm and happy, and soon began to sing for joy. A passing cat heard the bird singing and came to investigate...&lt;br /&gt;Following the sound, the cat discovered the bird under the pile of cow dung, and promptly dug him out and ate him.&lt;br /&gt;&lt;br /&gt;Moral of the story:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Not everyone who shits on you is your enemy&lt;/li&gt;&lt;li&gt;Not everyone who gets you out of shit is your friend&lt;/li&gt;&lt;li&gt;And when you're in deep shit, it's best to keep your mouth shut!&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/6179682925625902039-655612730705936551?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/655612730705936551'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/655612730705936551'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2008/11/3-minute-management-course-lesson-1-man.html' title=''/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-8613407788267192366</id><published>2008-10-03T16:46:00.002+01:00</published><updated>2008-10-03T16:54:31.530+01:00</updated><title type='text'>Surprising SQL speed increase</title><content type='html'>I’ve just found out that the execution plan performance between the following two select statements are massively different:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="color:#3333ff;"&gt;select&lt;/span&gt; * &lt;span style="color:#3333ff;"&gt;from&lt;/span&gt; your_large_table&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="color:#3333ff;"&gt;where&lt;/span&gt; LEFT(some_string_field, 4) = '&lt;span style="color:#ff0000;"&gt;2505&lt;/span&gt;'&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;select&lt;/span&gt; * &lt;span style="color:#3333ff;"&gt;from&lt;/span&gt; your_large_table&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;where&lt;/span&gt; some_string_field like '&lt;span style="color:#ff0000;"&gt;2505%&lt;/span&gt;'&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;The execution plans are &lt;strong&gt;98%&lt;/strong&gt; and &lt;strong&gt;2%&lt;/strong&gt; respectively. Bit of a difference in speed then.&lt;br /&gt;&lt;br /&gt;There are lots of places in our SQL where we use LEFT(something, x) = 'string'&lt;br /&gt;This should be replaced by the LIKE command for greater speed.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;I actually found this out by checking the LINQ generated SQL against my hand crafted SQL. I assumed the LIKE command would be slower, but is in fact much much faster.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6179682925625902039-8613407788267192366?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/8613407788267192366'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/8613407788267192366'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2008/10/surprising-sql-speed-increase.html' title='Surprising SQL speed increase'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-7247143854171652576</id><published>2008-09-13T11:59:00.007+01:00</published><updated>2009-04-19T15:07:06.927+01:00</updated><title type='text'>A generic singleton</title><content type='html'>Taken from: http://andyclymer.blogspot.com/2008/02/true-generic-singleton.html&lt;br /&gt;Changed by Simon Hughes 20th Feb 2008&lt;br /&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color: rgb(204, 204, 204);"&gt;&lt;/span&gt; &lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System.Reflection;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color:green;"&gt;&lt;/span&gt; &lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color:green;"&gt;// Use like this&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color:green;"&gt;/*&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color:green;"&gt;public class Highlander : Singleton&amp;lt;Highlander&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color:green;"&gt;{&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color:green;"&gt;    private Highlander()&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color:green;"&gt;    {&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color:green;"&gt;        Console.WriteLine("There can be only one...");&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color:green;"&gt;    }&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color:green;"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color:green;"&gt;*/&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt; &lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Singleton&lt;/span&gt;&amp;lt;T&amp;gt; &lt;span style="color:blue;"&gt;where&lt;/span&gt; T : &lt;span style="color:blue;"&gt;class&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;{&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;    &lt;span style="color:blue;"&gt;private&lt;/span&gt; &lt;span style="color:blue;"&gt;static&lt;/span&gt; T instance;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;    &lt;span style="color:blue;"&gt;private&lt;/span&gt; &lt;span style="color:blue;"&gt;static&lt;/span&gt; &lt;span style="color:blue;"&gt;object&lt;/span&gt; initLock = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:blue;"&gt;object&lt;/span&gt;();&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt; &lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;    &lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;static&lt;/span&gt; T GetInstance()&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;    {&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;        &lt;span style="color:blue;"&gt;if&lt;/span&gt; (instance == &lt;span style="color:blue;"&gt;null&lt;/span&gt;)&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;        {&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;            CreateInstance();&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;        }&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt; &lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;        &lt;span style="color:blue;"&gt;return&lt;/span&gt; instance;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;    }&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt; &lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;    &lt;span style="color:blue;"&gt;private&lt;/span&gt; &lt;span style="color:blue;"&gt;static&lt;/span&gt; &lt;span style="color:blue;"&gt;void&lt;/span&gt; CreateInstance()&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;    {&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;        &lt;span style="color:blue;"&gt;lock&lt;/span&gt; (initLock)&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;        {&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;            &lt;span style="color:blue;"&gt;if&lt;/span&gt; (instance == &lt;span style="color:blue;"&gt;null&lt;/span&gt;)&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;            {&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;                &lt;span style="color: rgb(43, 145, 175);"&gt;Type&lt;/span&gt; t = &lt;span style="color:blue;"&gt;typeof&lt;/span&gt;(T);&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt; &lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;                &lt;span style="color:green;"&gt;// Ensure there are no public constructors...&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;                &lt;span style="color: rgb(43, 145, 175);"&gt;ConstructorInfo&lt;/span&gt;[] ctors = t.GetConstructors();&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;                &lt;span style="color:blue;"&gt;if&lt;/span&gt; (ctors.Length &amp;gt; &lt;span style="color:teal;"&gt;0&lt;/span&gt;)&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;                {&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;                    &lt;span style="color:blue;"&gt;throw&lt;/span&gt; &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;InvalidOperationException&lt;/span&gt;(&lt;span style="color: rgb(43, 145, 175);"&gt;String&lt;/span&gt;.Format(&lt;span style="color: rgb(163, 21, 21);"&gt;"{0} has at&lt;br /&gt;&lt;/span&gt;                    &lt;span style="color: rgb(163, 21, 21);"&gt;least one accesible ctor making it impossible to enforce&lt;br /&gt;&lt;/span&gt;                    &lt;span style="color: rgb(163, 21, 21);"&gt;singleton behaviour"&lt;/span&gt;, t.Name));&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;                }&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt; &lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;                &lt;span style="color:green;"&gt;// Create an instance via the private constructor&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;                instance = (T)&lt;span style="color: rgb(43, 145, 175);"&gt;Activator&lt;/span&gt;.CreateInstance(t, &lt;span style="color:blue;"&gt;true&lt;/span&gt;);&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;            }&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;        }&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;    }&lt;/pre&gt;&lt;pre style="margin: 0px;"&gt;}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6179682925625902039-7247143854171652576?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/7247143854171652576'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/7247143854171652576'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2008/09/templated-singleton.html' title='A generic singleton'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-6697228754480844189</id><published>2008-04-09T09:30:00.003+01:00</published><updated>2008-04-09T10:16:44.677+01:00</updated><title type='text'>BypassProxyOnLocal - a bug in .Net ?</title><content type='html'>If you have a local proxy server on your computer (127.0.0.1) that you wish to use when doing FTP communications, all you need do is set BypassProxyOnLocal = false right?&lt;br /&gt;&lt;br /&gt;There may be many important reasons for using a local proxy, such as caching and security etc.&lt;br /&gt;&lt;br /&gt;Here's an example:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;WebProxy proxy = new WebProxy("127.0.0.1", 3128);&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;proxy.BypassProxyOnLocal = true;&lt;br /&gt;bool a = proxy.IsBypassed(new Uri("ftp://127.0.0.1:3128"));&lt;br /&gt;bool b = proxy.IsBypassed(new Uri("ftp://127.0.0.1:21"));&lt;br /&gt;// a=true, b=true (ok)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;proxy.BypassProxyOnLocal = false;&lt;br /&gt;bool c = proxy.IsBypassed(new Uri("ftp://127.0.0.1:3128"));&lt;br /&gt;bool d = proxy.IsBypassed(new Uri("ftp://127.0.0.1:21"));&lt;br /&gt;// &lt;span style="color:#ff0000;"&gt;c=true, d=true (???)&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Why is the proxy being bypassed when I told it not to?&lt;br /&gt;The local proxy is always bypassed when when the proxy is on a loopback address. Why?&lt;br /&gt;&lt;br /&gt;Setting BypassProxyOnLocal to false should NOT bypass the proxy for local addresses. So let's see what MSDN Library has to say about IsBypassed method:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;If BypassProxyOnLocal is true, requests to local Internet resources do not use&lt;br /&gt;the proxy server. Local requests are identified by the lack of a period (.) in&lt;br /&gt;the URI, as in http://webserver/, or access the local server, including&lt;br /&gt;http://localhost, http://loopback, or http://127.0.0.1. When BypassProxyOnLocal&lt;br /&gt;is false, all Internet requests are made through the proxy server.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Here is the WebProxy.IsBypassed source code:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;public bool IsBypassed(Uri host)&lt;br /&gt;{&lt;br /&gt;    GlobalLog.Print("WebProxy#" + ValidationHelper.HashString(this) + "::IsBypassed() destination:" + ValidationHelper.ToString(host));&lt;br /&gt;&lt;br /&gt;    if (host == null)&lt;br /&gt;    {&lt;br /&gt;        throw new ArgumentNullException("host");&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    AutoWebProxyState autoWebProxyState;&lt;br /&gt;    bool result = IsBypassedAuto(host, out autoWebProxyState);&lt;br /&gt;    if (autoWebProxyState==AutoWebProxyState.ExecutionSuccess) {&lt;br /&gt;        return result;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    return IsBypassedManual(host);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private bool IsBypassedManual(Uri host) {&lt;br /&gt;    if (host.IsLoopback) {&lt;br /&gt;        return true; // bypass localhost from using a proxy.&lt;br /&gt;    }&lt;br /&gt;    return (_ProxyAddress==null &amp;amp;&amp;amp; _ProxyHostAddresses==null)  (_BypassOnLocal &amp;amp;&amp;amp; IsLocal(host))  IsMatchInBypassList(host)  IsLocalInProxyHash(host);&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6179682925625902039-6697228754480844189?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/6697228754480844189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/6697228754480844189'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2008/04/bypassproxyonlocal-bug-in-net.html' title='BypassProxyOnLocal - a bug in .Net ?'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-8767470175846289113</id><published>2008-02-05T22:14:00.000Z</published><updated>2008-02-05T22:20:18.175Z</updated><title type='text'>Design patterns</title><content type='html'>I've recently been on a training course with &lt;a href="http://www.developmentor.com/"&gt;http://www.developmentor.com/&lt;/a&gt; it's called &lt;a style="TEXT-DECORATION: none" href="http://www.develop.com/training/course.aspx?id=663"&gt;Code Smarter with Design Patterns in .NET&lt;/a&gt; and can strongly recommend it.&lt;br /&gt;I simply love design patterns, and you should to :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6179682925625902039-8767470175846289113?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/8767470175846289113'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/8767470175846289113'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2008/02/design-patterns.html' title='Design patterns'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-1734479293472429171</id><published>2008-01-28T09:31:00.001Z</published><updated>2008-01-28T09:40:19.333Z</updated><title type='text'>GRC.COM by Steve Gibson</title><content type='html'>&lt;a href="https://www.grc.com/"&gt;https://www.grc.com/&lt;/a&gt; is run by Steve Gibson. He has many great utilities and has a Security Now podcast. I can't recommend them strongly enough.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;GRC "Perfect Passwords" Generator &lt;a href="https://www.grc.com/passwords.htm"&gt;https://www.grc.com/passwords.htm&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Spinrite hard disc recovery and maintenance &lt;a href="http://www.grc.com/spinrite.htm"&gt;http://www.grc.com/spinrite.htm&lt;/a&gt;&lt;/li&gt;&lt;li&gt;SecurityNow podcast with Leo Laporte &lt;a href="http://www.grc.com/securitynow.htm"&gt;http://www.grc.com/securitynow.htm&lt;/a&gt;&lt;/li&gt;&lt;li&gt;ShieldsUP! &lt;a href="https://www.grc.com/x/ne.dll?bh0bkyd2"&gt;https://www.grc.com/x/ne.dll?bh0bkyd2&lt;/a&gt;&lt;/li&gt;&lt;li&gt;SecurAble &lt;a href="http://www.grc.com/securable.htm"&gt;http://www.grc.com/securable.htm&lt;/a&gt;&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/6179682925625902039-1734479293472429171?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/1734479293472429171'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/1734479293472429171'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2008/01/grccom.html' title='GRC.COM by Steve Gibson'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-2045763918571226811</id><published>2008-01-23T09:16:00.000Z</published><updated>2008-02-05T22:13:57.291Z</updated><title type='text'>DHCP Client service causing my PC to go slow</title><content type='html'>Recently I’ve noticed my laptop going quite slow. For example, using Windows explorer and clicking on a folder resulted in a 40 – 60 second wait for the folder to show its contents.&lt;br /&gt;Well, I’ve worked out by stopping the ‘DHCP Client’ service my PC goes like lightening again. I'm also using Windows XP.&lt;br /&gt;&lt;br /&gt;To fix, you need to delete all Printers that are offline, and remove all mapped network drives.&lt;br /&gt;&lt;br /&gt;Why does the ‘DHCP Client’ affect windows explorer? I don’t know, but Microsoft if your reading this, please fix it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6179682925625902039-2045763918571226811?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/2045763918571226811'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/2045763918571226811'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2008/01/dhcp-server-service-causing-my-pc-to-go.html' title='DHCP Client service causing my PC to go slow'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-6179682925625902039.post-2422967446059765047</id><published>2008-01-22T10:08:00.001Z</published><updated>2008-02-25T09:08:52.535Z</updated><title type='text'>What do I use to write software?</title><content type='html'>I started off with Dbase III, then Borland Turbo C for about 5 years, then when Microsoft Visual Studio v1.0 came out, I moved to that.&lt;br /&gt;&lt;br /&gt;I've been using Visual Studio ever since. Coding in C++ and have since moved to C# when that came into existance.&lt;br /&gt;&lt;br /&gt;Do I use component? Yes.&lt;br /&gt;Which ones then?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Telerik &lt;a href="http://www.telerik.com/"&gt;http://www.telerik.com/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Dundas &lt;a href="http://www.dundas.com/"&gt;http://www.dundas.com/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Rebex &lt;a href="http://www.rebex.net/"&gt;http://www.rebex.net/&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;I've also used DevExpress reports, but they peg the CPU to 100% on the webservers when exporting an excel spreadsheet with a lot of data in them, and more often than not, cause a timeout on the ASPX page. So I don't like to use them anymore.&lt;/p&gt;&lt;p&gt;My essential toolkit consists of:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;SVN - Subversion source control &lt;a href="http://subversion.tigris.org/"&gt;http://subversion.tigris.org/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Winrar &lt;a href="http://www.rarlab.com/"&gt;http://www.rarlab.com/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Colour Schemer (web design) &lt;a href="http://www.colorschemer.com/online.html"&gt;http://www.colorschemer.com/online.html&lt;/a&gt;&lt;/li&gt;&lt;li&gt;SQL Prompt &lt;a href="http://www.red-gate.com/"&gt;http://www.red-gate.com/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;ANTS Profiler &lt;a href="http://www.red-gate.com/"&gt;http://www.red-gate.com/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;NUnit &lt;a href="http://www.nunit.org/"&gt;http://www.nunit.org/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Microsoft Visual Studio &lt;a href="http://msdn2.microsoft.com/en-gb/vstudio/default.aspx"&gt;http://msdn2.microsoft.com/en-gb/vstudio/default.aspx&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Microsoft SQL Server &lt;a href="http://www.microsoft.com/sql/default.mspx"&gt;http://www.microsoft.com/sql/default.mspx&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Microsoft Office &lt;a href="http://office.microsoft.com/"&gt;http://office.microsoft.com/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Fiddler &lt;a href="http://www.fiddlertool.com/fiddler/"&gt;http://www.fiddlertool.com/fiddler/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Expresso regex &lt;a href="http://www.ultrapico.com/Expresso.htm"&gt;http://www.ultrapico.com/Expresso.htm&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Hamachi VPN &lt;a href="https://secure.logmein.com/products/hamachi/vpn.asp"&gt;https://secure.logmein.com/products/hamachi/vpn.asp&lt;/a&gt;&lt;/li&gt;&lt;li&gt;FinePrint &lt;a href="http://www.fineprint.com/"&gt;http://www.fineprint.com/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;All snap &lt;a href="http://www.allsnap.org/"&gt;http://www.allsnap.org/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Taskbar shuffle &lt;a href="http://www.freewebs.com/nerdcave/taskbarshuffle.htm"&gt;http://www.freewebs.com/nerdcave/taskbarshuffle.htm&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Spinrite &lt;a href="http://www.grc.com/spinrite.htm"&gt;http://www.grc.com/spinrite.htm&lt;/a&gt;&lt;/li&gt;&lt;li&gt;ReSharper &lt;a href="http://www.jetbrains.com/resharper/"&gt;http://www.jetbrains.com/resharper/&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Recommended websites:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;CodeProject &lt;a href="http://www.codeproject.com/"&gt;http://www.codeproject.com/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;MSDN &lt;a href="http://msdn2.microsoft.com/en-gb/default.aspx"&gt;http://msdn2.microsoft.com/en-gb/default.aspx&lt;/a&gt;&lt;/li&gt;&lt;li&gt;SecurityNow &lt;a href="http://www.grc.com/securitynow.htm"&gt;http://www.grc.com/securitynow.htm&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Sherman's Lagoon &lt;a href="http://www.slagoon.com/cgi-bin/sviewer.pl"&gt;http://www.slagoon.com/cgi-bin/sviewer.pl&lt;/a&gt;&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/6179682925625902039-2422967446059765047?l=simon-hughes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/2422967446059765047'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6179682925625902039/posts/default/2422967446059765047'/><link rel='alternate' type='text/html' href='http://simon-hughes.blogspot.com/2008/01/what-do-i-use-to-write-software.html' title='What do I use to write software?'/><author><name>Simon Hughes</name><uri>http://www.blogger.com/profile/17394832925629583851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_weEyw1YJRuo/SQ8OnXXA5JI/AAAAAAAAAAM/6Uh4eb2cPW4/S220/SimonHughes.jpg'/></author></entry></feed>
