<?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-1724922567321347478</id><updated>2012-02-16T04:31:31.708-07:00</updated><category term='C#'/><category term='MSSQL'/><category term='Visual Studio'/><category term='excel'/><category term='SEO'/><category term='Admin stuff'/><category term='SSL'/><category term='Windows'/><category term='S3'/><category term='IIS'/><category term='ASP.NET'/><category term='Serialization'/><category term='DOS'/><title type='text'>Cold Black Coffee</title><subtitle type='html'>My daily struggles as a developer.  Questions, answers, and expressions of frustration.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.coldblackcoffee.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724922567321347478/posts/default'/><link rel='alternate' type='text/html' href='http://www.coldblackcoffee.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Steve Suhr</name><uri>http://www.blogger.com/profile/17498749449948903375</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_8a2r3FLyl6g/S3bWrWtnrJI/AAAAAAAAAOs/VFa1rg2ITcI/S220/20243_827382676383_6221562_45755001_2988426_n.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>15</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1724922567321347478.post-7338915486467769788</id><published>2010-06-05T13:49:00.005-07:00</published><updated>2010-06-05T14:00:59.484-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>Visual Studio 2008 Renaming Bug</title><content type='html'>I'm a big fan of the renaming feature in visual studio.  You can right click on any variable in your code and select Refactor -&gt; Rename.  Then rename the variable once and all other references are updated.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Except I like to inject code right into my .aspx pages instead of the code behind files sometimes.  The syntax for that is:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&amp;lt;% Response.Write(SOME C# CODE); %&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The rename functionality won't find these references in the .aspx files.  Instead I get a compile error and can then rename the remaining references easily enough.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It seems like this should be fixable.  The fix might hurt the performance of the renaming feature a little bit but I think it would be worth it.  Does anyone know if this is already fixed in VS 2010?&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1724922567321347478-7338915486467769788?l=www.coldblackcoffee.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.coldblackcoffee.com/feeds/7338915486467769788/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.coldblackcoffee.com/2010/06/visual-studio-2008-renaming-bug.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724922567321347478/posts/default/7338915486467769788'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724922567321347478/posts/default/7338915486467769788'/><link rel='alternate' type='text/html' href='http://www.coldblackcoffee.com/2010/06/visual-studio-2008-renaming-bug.html' title='Visual Studio 2008 Renaming Bug'/><author><name>Steve Suhr</name><uri>http://www.blogger.com/profile/17498749449948903375</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_8a2r3FLyl6g/S3bWrWtnrJI/AAAAAAAAAOs/VFa1rg2ITcI/S220/20243_827382676383_6221562_45755001_2988426_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724922567321347478.post-7341692189185775866</id><published>2010-06-05T11:32:00.004-07:00</published><updated>2010-06-05T12:16:58.951-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><title type='text'>SSL Hell - Multiple web servers in a cluster</title><content type='html'>I was following the instructions that GoDaddy provided to &lt;a href="http://help.godaddy.com/topic/742/article/4875"&gt;install an new SSL cert on IIS6&lt;/a&gt;.  These instructions cover how to get up and running on one web server, but they don't detail how to export the cert to other web servers.  The site I was working on had several in a cluster.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So I thought I'd detail what worked for me.  The trick is to export the cert to a .pfx file.  Note: the steps below are intended to be followed after you've already set up the certificate on the first web server.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To do this, first start with the certifcates snap-in all set up.  GoDaddy's instructions for this are pasted below:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Click the &lt;strong&gt;Start &lt;/strong&gt;menu and click &lt;strong&gt;Run...&lt;/strong&gt;. Type &lt;strong&gt;mmc&lt;/strong&gt; in the Run window and click &lt;strong&gt;OK&lt;/strong&gt; to start the Microsoft Management Console (MMC).&lt;/li&gt;&lt;li&gt;In the Management Console, select &lt;strong&gt;File&lt;/strong&gt; then &lt;strong&gt;Add/Remove Snap In&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;In the &lt;strong&gt;Add or Remove Snap-ins&lt;/strong&gt; dialog, click the &lt;strong&gt;Add&lt;/strong&gt; button and then select &lt;strong&gt;Certificates&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Choose &lt;strong&gt;Computer Account&lt;/strong&gt; then click &lt;strong&gt;Next&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Choose &lt;strong&gt;Local Computer&lt;/strong&gt;, then click &lt;strong&gt;Finish&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Close the &lt;strong&gt;Add or Remove Snap-ins&lt;/strong&gt; dialog and click &lt;strong&gt;OK&lt;/strong&gt; to return to the main MMC window. &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now you're ready to export:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Browse to Personal -&gt; Certificates.  &lt;/li&gt;&lt;li&gt;Right click the certificate you need to export in the right hand window and select "All Tasks" -&gt; Export ...&lt;/li&gt;&lt;li&gt;Click Next on the first meaningless page of the wizard&lt;/li&gt;&lt;li&gt;Select "Yes, export the private key" and click Next&lt;/li&gt;&lt;li&gt;Leave the default selected (just "enable strong protection" checked) and click Next&lt;/li&gt;&lt;li&gt;type in some password that you won't forget and click Next&lt;/li&gt;&lt;li&gt;Browse to a location to export and click Next&lt;/li&gt;&lt;li&gt;Click Finish&lt;/li&gt;&lt;/ul&gt;It is important that you do specify a password for everything to go smoothly.  Now for the importing:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Copy the .pfx file to an additional web server&lt;/li&gt;&lt;li&gt;get the certificates snap-in up on the new server (same as instructions above)&lt;/li&gt;&lt;li&gt;Under Personal -&gt; Certificates right click the folder and select "All Tasks" -&gt; Import ...&lt;/li&gt;&lt;li&gt;browse to the pfx file (will need to change the "File of Type" drop down in order to see it)&lt;/li&gt;&lt;li&gt;click Next through the wizard, leaving the other defaults.&lt;/li&gt;&lt;li&gt;Don't forget to import the intermediate certificate!  That is the same as the first web server.&lt;/li&gt;&lt;/ul&gt;That is it.  Now in IIS you can go specify that cert.  You won't be responding to a CSR (certificate signing request) like the first time.  You'll just be choosing an existing certificate.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1724922567321347478-7341692189185775866?l=www.coldblackcoffee.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.coldblackcoffee.com/feeds/7341692189185775866/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.coldblackcoffee.com/2010/06/ssl-hell-multiple-web-servers-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724922567321347478/posts/default/7341692189185775866'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724922567321347478/posts/default/7341692189185775866'/><link rel='alternate' type='text/html' href='http://www.coldblackcoffee.com/2010/06/ssl-hell-multiple-web-servers-in.html' title='SSL Hell - Multiple web servers in a cluster'/><author><name>Steve Suhr</name><uri>http://www.blogger.com/profile/17498749449948903375</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_8a2r3FLyl6g/S3bWrWtnrJI/AAAAAAAAAOs/VFa1rg2ITcI/S220/20243_827382676383_6221562_45755001_2988426_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724922567321347478.post-6986059295950533328</id><published>2010-03-16T14:19:00.005-07:00</published><updated>2010-03-16T14:33:05.002-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='MSSQL'/><title type='text'>Query is fast in management studio but hangs from Console App</title><content type='html'>&lt;div&gt;I'm going to include my little narrative of how I troubleshot this issue.  But first let me just get the answer out there.  You need to include this at the start of your stored procedure:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;code&gt;set arithabort on&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;My troubleshooting story is also pretty concise I guess.  I used SQL Server Profiler to see what my app was doing differently from management studio.  The actual call was identical, but any .NET MSSQL connection calls a bunch of set commands before it does anything.  The entire list I found is below:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;code&gt;&lt;div&gt;set quoted_identifier on&lt;/div&gt;&lt;div&gt;set arithabort off&lt;/div&gt;&lt;div&gt;set numeric_roundabort off&lt;/div&gt;&lt;div&gt;set ansi_warnings on&lt;/div&gt;&lt;div&gt;set ansi_padding on&lt;/div&gt;&lt;div&gt;set ansi_nulls on&lt;/div&gt;&lt;div&gt;set concat_null_yields_null on&lt;/div&gt;&lt;div&gt;set cursor_close_on_commit off&lt;/div&gt;&lt;div&gt;set implicit_transactions off&lt;/div&gt;&lt;div&gt;set language us_english&lt;/div&gt;&lt;div&gt;set dateformat mdy&lt;/div&gt;&lt;div&gt;set datefirst 7&lt;/div&gt;&lt;div&gt;set transaction isolation level read committed&lt;/div&gt;&lt;/code&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;By starting with a fresh query editor window and adding in these set commands one at a time I found the culprit pretty quickly.  Then I just set the property the way I want it inside the proc to override the damage the connection from .NET causes.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;StackOverflow was also really helpful in two posts.  One focusing on the &lt;a href="http://stackoverflow.com/questions/769128/sqldataadapter-fill-timeout-underlying-sproc-returns-quickly"&gt;SqlDataAdapter&lt;/a&gt; and another that was more generally about &lt;a href="http://stackoverflow.com/questions/801909/why-is-some-sql-query-much-slower-when-used-with-sqlcommand"&gt;SqlCommand&lt;/a&gt;.  Just go help vote up the answer that this post is consistent with.  Unless you find otherwise, then let me know.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;What would be nice is being able to control which set commands are issued from my app.  I've found nothing on how to do this.  If you find something please share!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1724922567321347478-6986059295950533328?l=www.coldblackcoffee.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.coldblackcoffee.com/feeds/6986059295950533328/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.coldblackcoffee.com/2010/03/query-is-fast-in-management-studio-but.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724922567321347478/posts/default/6986059295950533328'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724922567321347478/posts/default/6986059295950533328'/><link rel='alternate' type='text/html' href='http://www.coldblackcoffee.com/2010/03/query-is-fast-in-management-studio-but.html' title='Query is fast in management studio but hangs from Console App'/><author><name>Steve Suhr</name><uri>http://www.blogger.com/profile/17498749449948903375</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_8a2r3FLyl6g/S3bWrWtnrJI/AAAAAAAAAOs/VFa1rg2ITcI/S220/20243_827382676383_6221562_45755001_2988426_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724922567321347478.post-3890990730099487962</id><published>2010-03-02T21:10:00.014-07:00</published><updated>2010-03-11T22:00:48.833-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MSSQL'/><title type='text'>Automated Speed Monitoring with MSSQL</title><content type='html'>&lt;h2&gt;What? Why?&lt;/h2&gt;&lt;br /&gt;I'm in the web data extraction business.  That means I'm often writing hundreds of thousands of rows to a table over the course of days.  Well when you're dependent on a third party website for your data, a lot can go wrong over the course of days.  So I started formulating my own table monitoring solutions.&lt;br /&gt;&lt;br /&gt;At first I would just periodically do a SELECT * here and a SELECT count(*) there to get by.  But when a weekend goes by and on Monday morning you're 10K rows short, you want to know if things just slowed down a little or if everything broke sometime Sunday night.  My solution is to automate my little SELECTs to happen on a regular schedule and then store themselves in a log table.  By comparing the latest row as I insert I can do an on the fly rate calculation as well.  Sound useful?  The details follow ...&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;How.&lt;/h2&gt;&lt;br /&gt;First I needed a log table.  I made something like:&lt;div&gt;&lt;br /&gt;&lt;code&gt;CREATE TABLE [dbo].[SpeedLog](&lt;br /&gt;[Count] [int] NULL,&lt;br /&gt;[Timestamp] [datetime] NULL,&lt;br /&gt;[PerHour] [int] NULL,&lt;br /&gt;[PerDay] [int] NULL&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Next I made a view that produces a new row to insert into this table.  I find it handy to have this logic isolated in its own view rather than having an enormous insert statement,&lt;br /&gt;&lt;br /&gt;&lt;code&gt;CREATE VIEW [dbo].[vw_Status]&lt;br /&gt;as&lt;br /&gt;SELECT&lt;br /&gt;count(*) as [Count]&lt;br /&gt;, CURRENT_TIMESTAMP as [Timestamp]&lt;br /&gt;, (count(*)-MAX(lRow.UrlSnapShotsCount))/DATEDIFF(hour, MAX(lRow.[Timestamp]), CURRENT_TIMESTAMP) [PerHour]&lt;br /&gt;, (count(*)-MAX(lRow.UrlSnapShotsCount))/DATEDIFF(hour, MAX(lRow.[Timestamp]), CURRENT_TIMESTAMP)*24 [PerDay]&lt;br /&gt;FROM MyGrowingTable u&lt;br /&gt;LEFT JOIN&lt;br /&gt;(SELECT a.[Count], b.[Timestamp], a.PerHour, a.PerDay FROM SpeedLog a&lt;br /&gt;INNER JOIN (SELECT MAX([Timestamp]) [Timestamp] FROM SpeedLog) b ON a.[Timestamp] = b.[Timestamp]) lRow&lt;br /&gt;ON 1=1&lt;/code&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;/code&gt;That is a bit much to throw at anyone all at once.  To abstract it a little in pseudo code I'm saying:&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;code&gt;&lt;div&gt;&lt;div&gt;SELECT CurrentCount, (y2-y1)/(x2-x1) as PerHour, PerHour*24 as PerDay&lt;/div&gt;&lt;div&gt;FROM MyGrowingTable&lt;/div&gt;&lt;div&gt;LEFT JOIN (the most recently inserted row of my log table) lRow&lt;/div&gt;&lt;div&gt;ON 1=1&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/code&gt;&lt;div&gt;Since my lRow sub query only returns one row ever I can get away with a 1=1 ON clause and still have one row as a result.  It is important to do a LEFT join to lRow so that a first row with no rate info can be inserted.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now I just need to insert on some regular schedule.  I do this via a SQL Server Agent Job.  If you've never used one of those before don't worry.  It is a point and click affair within Management Studio.  You just have to make sure you have SQL Server Agent running as its own service.  Then you can add a new job with one task within it that runs:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;code&gt;&lt;div&gt;INSERT INTO SpeedLog&lt;/div&gt;&lt;div&gt;SELECT * FROM vw_Status&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/code&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Since the logic is in the view, you can tweak things without having to dive into the Agent Job every time.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;h2&gt;Where next?&lt;/h2&gt;&lt;/div&gt;&lt;div&gt;count(*) is a pretty simple measure of a table.  For your own purposes maybe you want to track the average number of rows where some column is null.  That would be no problem.  You could track as many metrics as you wanted by just adding more and more columns to the log table and your view.  More complex rate analysis could be done on the entire log table as well.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As with every solution I create.  It seems like a problem other people must have run into and solved already.  I think I'm just bad at finding solutions.  If you have something else to tackle this problem please share!&lt;/div&gt;&lt;/div&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/1724922567321347478-3890990730099487962?l=www.coldblackcoffee.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.coldblackcoffee.com/feeds/3890990730099487962/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.coldblackcoffee.com/2010/03/automated-speed-monitoring-with-mssql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724922567321347478/posts/default/3890990730099487962'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724922567321347478/posts/default/3890990730099487962'/><link rel='alternate' type='text/html' href='http://www.coldblackcoffee.com/2010/03/automated-speed-monitoring-with-mssql.html' title='Automated Speed Monitoring with MSSQL'/><author><name>Steve Suhr</name><uri>http://www.blogger.com/profile/17498749449948903375</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_8a2r3FLyl6g/S3bWrWtnrJI/AAAAAAAAAOs/VFa1rg2ITcI/S220/20243_827382676383_6221562_45755001_2988426_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724922567321347478.post-1606667490249272353</id><published>2010-02-24T11:35:00.007-07:00</published><updated>2010-03-02T21:51:20.942-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Load HttpModule! Load!  HttpModules in App_Code.</title><content type='html'>I've done HttpModules in separate assemblies and don't remember integration being too tricky.  But when I was just writing one within the App_Code of the same site I was having all sorts of issues.  I think I found some common gotchas related to HttpModules.&lt;br /&gt;&lt;br /&gt;First, my module was not loading but I didn't even get an error page.  I was able to get useful errors by switching the App Pool of the site to "Classic .NET AppPool" from the "DefaultAppPool".  Turns out this did more than give me error messages, when all was finished I had to have this classic app pool for the module to work.  Thanks to lucky abhishek for &lt;a href="http://luckyabhishek.blogspot.com/2009/06/http-module-not-loading-in-iis.html"&gt;figuring out the app pool problem first&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Once I was seeing errors I first found that I had other modules in a parent site that could not load. In IIS web.config settings from parent sites are inherited by sites in any virtual sub directories.  So I was loading other HttpModules that I didn't care about in this sub site.  I fixed this with a quick&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&amp;lt;remove name="NameOfModuleIDontHave" /&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;in the HttpModules section of the web.config in order to straighten that out.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Last I just had to figure out why I "could not load type MYTYPE".  Turns out for the type I was using the namespace instead of the class name qualified with the namespace.  In other words in my web.config I had &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&amp;lt;add type="ParentNamespace.SubNamespace" name="MyClassName" /&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;instead of &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&amp;lt;add type="ParentNamespace.SubNamespace.MyClassName" name="MyClassName" /&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As a side note.  After I got this working I found for my purposes that the name attribute doesn't mean anything.  I can change it to whatever and my sample HttpModule still works.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;One last thing I found was that the type attribute above is usually of the form path,assembly.  When you're using a class in App_Code you can use the text "App_code" as the assembly if you want to be a little more clear.  So this also works:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&amp;lt;add type="ParentNamespace.SubNamespace.MyClassName,App_code" name="MyClassName" /&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But in my case it didn't seem to be required.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For reference, this is the &lt;a href="http://www.csharpfriends.com/articles/getarticle.aspx?articleid=268"&gt;skeleton HttpModule&lt;/a&gt; I was trying to load.&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/1724922567321347478-1606667490249272353?l=www.coldblackcoffee.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.coldblackcoffee.com/feeds/1606667490249272353/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.coldblackcoffee.com/2010/02/load-httpmodule-load-httpmodules-in.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724922567321347478/posts/default/1606667490249272353'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724922567321347478/posts/default/1606667490249272353'/><link rel='alternate' type='text/html' href='http://www.coldblackcoffee.com/2010/02/load-httpmodule-load-httpmodules-in.html' title='Load HttpModule! Load!  HttpModules in App_Code.'/><author><name>Steve Suhr</name><uri>http://www.blogger.com/profile/17498749449948903375</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_8a2r3FLyl6g/S3bWrWtnrJI/AAAAAAAAAOs/VFa1rg2ITcI/S220/20243_827382676383_6221562_45755001_2988426_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724922567321347478.post-8527869748206142821</id><published>2010-02-19T13:22:00.005-07:00</published><updated>2010-02-19T14:26:32.633-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><title type='text'>The Custom Windows Toolbar - Underrated.</title><content type='html'>It is one of those features that never gets any hype.  Much like the quick launch bar, windows allows you to add your own custom taskbar toolbars.  Just &lt;div&gt; &lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;- right click the taskbar&lt;/div&gt;&lt;div&gt; - Toolbars -&gt; New Toolbar&lt;/div&gt;&lt;div&gt; - Point to a folder and you're all set.&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;This video really spells out &lt;a href="http://lifehacker.com/273847/create-a-custom-windows-taskbar-toolbar"&gt;how to create a custom toolbar&lt;/a&gt;.  Below is a shot of mine at the moment.&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_8a2r3FLyl6g/S370VZxSDeI/AAAAAAAAAPQ/vBQdvIZDK28/s1600-h/customtoolbars.png"&gt;&lt;img style="margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 283px;" src="http://4.bp.blogspot.com/_8a2r3FLyl6g/S370VZxSDeI/AAAAAAAAAPQ/vBQdvIZDK28/s320/customtoolbars.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5440054048442158562" /&gt;&lt;/a&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;There is virtually no limit to the number of shortcuts.  Sub folders are supported to allow for some simple grouping within a toolbar.  It makes for a much better experience than the raw directory trees I usually have to think about navigating. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;Only recently has it dawned on me how to use these toolbars to really save me some time.  If you're a developer you may find these ideas useful if you haven't already implemented something similar.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Visual Studio&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I'm always working on different solutions in visual studio.  So many so that the "Start Page" no longer is that useful (even after tricking it to show me more recently opened solutions).  Plus, I hate having extra tabs open.  So the first thing I do after using the start page is close it. Well if you click a shortcut to a solution file no start page opens!  Ha ha, finally I've thwarted that useless tab and its "developer news" that I never read.  Instead I have my "vs" toolbar.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Command Prompts&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;All of those visual studio solutions usually have a console application or two in them.  When I want to revisit these my directory navigating gets even crazier thanks to the /bin/Debug directories that are created by default.  My solution is to create batch files of the form &lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;cmd /k cd "C:\My Solutions\My Project\bin\Debug"&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;I talk about this idea in another post &lt;a href="http://www.coldblackcoffee.com/2010/02/windows-symbolic-link-equivalent-but.html"&gt;here&lt;/a&gt;.  The end result is my "cmd" toolbar which opens up a command prompt at whatever starting directory I want.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Remote Desktops&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I am constantly hoping on and off of machines for work.  My rdp toolbar beats the snot out of Start -&gt; All programs -&gt; Accessories -&gt; remote desktop connection.  Instead I have a saved rdp for each machine one click away.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Other Ideas&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;NUnit&lt;/div&gt;&lt;div&gt;I don't do a ton of NUnit testing but I should.  A little looking around shows that nunit-gui takes command line args.  You could create shortcuts to your common test fixtures.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Multiple homepages&lt;/div&gt;&lt;div&gt;You can pass a url to the command line of most browsers.  So you can have shortcuts to multiple sites in a toolbar.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I'm sure there are even more obvious uses that I've not thought of.  Please share what you've come up with.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1724922567321347478-8527869748206142821?l=www.coldblackcoffee.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.coldblackcoffee.com/feeds/8527869748206142821/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.coldblackcoffee.com/2010/02/custom-windows-toolbar-underrated.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724922567321347478/posts/default/8527869748206142821'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724922567321347478/posts/default/8527869748206142821'/><link rel='alternate' type='text/html' href='http://www.coldblackcoffee.com/2010/02/custom-windows-toolbar-underrated.html' title='The Custom Windows Toolbar - Underrated.'/><author><name>Steve Suhr</name><uri>http://www.blogger.com/profile/17498749449948903375</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_8a2r3FLyl6g/S3bWrWtnrJI/AAAAAAAAAOs/VFa1rg2ITcI/S220/20243_827382676383_6221562_45755001_2988426_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_8a2r3FLyl6g/S370VZxSDeI/AAAAAAAAAPQ/vBQdvIZDK28/s72-c/customtoolbars.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724922567321347478.post-2693883186349347173</id><published>2010-02-17T07:55:00.007-07:00</published><updated>2010-02-17T08:49:02.655-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DOS'/><title type='text'>Windows Symbolic Link Equivalent - But ghetto and not at all</title><content type='html'>Say you want to create a directory that points to another directory.  For example something in your home directory that point to a long and convoluted path that you often have to go down.  In Linux the answer is pretty easy, the ln command.  Here is a &lt;a href="https://www.linuxquestions.org/questions/linux-newbie-8/creating-virtual-links-135808/"&gt;decent forum post on using the ln command&lt;/a&gt;.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But I'm bound to the world of Microsoft.  There must be some DOS equivalent right?  Well a little Googling found me a discussion on &lt;a href="http://answers.google.com/answers/threadview?id=341355"&gt;junctions&lt;/a&gt;.  My take away is that they aren't quite the same thing, and they aren't well documented.  So instead I took an approach that I feel a little bit more comfortable with.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;What I ended up settling on was creating some batch files in my home directory with contents similar to&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;cd "C:\Some\Long\Directory\Path"&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;Ghetto right?  But for me the combo of &lt;/div&gt;&lt;div&gt; - Windows Key + R&lt;/div&gt;&lt;div&gt; - "cmd" + Enter&lt;/div&gt;&lt;div&gt; - MyBatFile Enter&lt;/div&gt;&lt;div&gt;is all I need.  With a little tab completing it is quite fast.  Before I was getting pretty fast at tab completing through my entire long directory name, so this is a definite improvement from how I was operating.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You could also make shortcuts on the desktop or in a custom toolbar off the start menu of the form&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;cmd /k cd "C:\My\Dir"&lt;/blockquote&gt;if you like a little point and click in your life.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Finally you could get all of your shortcuts in your PATH environment variable.  Then you could jump around without having be in your home directory.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I know this isn't a very impressive tip.  I guess what I'm really just conveying a more philosophical lesson.  Sometimes quick and dirty is the way to go.  Especially when it is saving time on something as simple as directory navigating.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1724922567321347478-2693883186349347173?l=www.coldblackcoffee.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.coldblackcoffee.com/feeds/2693883186349347173/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.coldblackcoffee.com/2010/02/windows-symbolic-link-equivalent-but.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724922567321347478/posts/default/2693883186349347173'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724922567321347478/posts/default/2693883186349347173'/><link rel='alternate' type='text/html' href='http://www.coldblackcoffee.com/2010/02/windows-symbolic-link-equivalent-but.html' title='Windows Symbolic Link Equivalent - But ghetto and not at all'/><author><name>Steve Suhr</name><uri>http://www.blogger.com/profile/17498749449948903375</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_8a2r3FLyl6g/S3bWrWtnrJI/AAAAAAAAAOs/VFa1rg2ITcI/S220/20243_827382676383_6221562_45755001_2988426_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724922567321347478.post-2837597901541606551</id><published>2010-02-09T10:11:00.002-07:00</published><updated>2010-02-09T10:33:07.239-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MSSQL'/><title type='text'>How to document MSSQL. Metadata vs Comment Headers</title><content type='html'>I've been a fan for a long time of creating a new stored procedure the MSSQL Management Studio way.  &lt;div&gt;&lt;ul&gt;&lt;li&gt;Right click the "Stored Procedures" folder in the object explorer on the left.  Select "New Stored Procedure"&lt;/li&gt;&lt;li&gt;Use Ctrl+Shift+M to fill in the comment header with bunches of meaningful values&lt;/li&gt;&lt;li&gt;Be on my merry way creating my proc&lt;/li&gt;&lt;/ul&gt;Later when I script the proc as a Create/Alter, I get my header back.  Works fine for me.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But what about table and view comment headers?  They don't seem to exist, although if you script a view as an alter you can inject some comments into the definition.  It seems like maybe what I should be doing with my tables is outlined here, &lt;a href="http://msdn.microsoft.com/en-us/library/cc966384.aspx"&gt;Managing Metadata&lt;/a&gt;.  Basically you can add in metadata via the "Extended Properties" of any table.  But my comment headers don't automatically appear as metadata and the metadata I enter doesn't get reflected into my comment headers.  So how do I just add in descriptions to all of my database objects?  I just want to a little documenting at the most basic level.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I found all sorts of elaborate ways of using metadata in enterprise applications.  But it doesn't seem to be designed for the simple ways I'm trying to use it.  How do you document your database objects?  Am I going about this all the wrong way?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1724922567321347478-2837597901541606551?l=www.coldblackcoffee.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.coldblackcoffee.com/feeds/2837597901541606551/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.coldblackcoffee.com/2010/02/how-to-document-mssql-metadata-vs.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724922567321347478/posts/default/2837597901541606551'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724922567321347478/posts/default/2837597901541606551'/><link rel='alternate' type='text/html' href='http://www.coldblackcoffee.com/2010/02/how-to-document-mssql-metadata-vs.html' title='How to document MSSQL. Metadata vs Comment Headers'/><author><name>Steve Suhr</name><uri>http://www.blogger.com/profile/17498749449948903375</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_8a2r3FLyl6g/S3bWrWtnrJI/AAAAAAAAAOs/VFa1rg2ITcI/S220/20243_827382676383_6221562_45755001_2988426_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724922567321347478.post-6381933564569222020</id><published>2009-08-22T08:43:00.004-07:00</published><updated>2010-03-02T21:50:32.727-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='excel'/><category scheme='http://www.blogger.com/atom/ns#' term='MSSQL'/><title type='text'>Excel Date. Excel Time. But what about DateTime?</title><content type='html'>I just ran into a beef I have with Excel.  But let me start by saying that I've never claimed to be an excel guru.  I know a bunch of things that the average excel user doesn't.  Nutty things that a non-developer likely wouldn't run into or care about.  But as for analytics and number crunching, I always end up turning to MSSQL.  It kills me because I know I use queries in relational databases all the time when an excel spreadsheet should be sufficient.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I have been monitoring the progress of some process in a haphazard, sanity checking sort of way.  I ended up with two columns of data, the first is a timestamp, the second is an integer.  I just want to see how quickly my integer is growing over time.  So the most basic check would be:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;(x1-x2)/(datetime1-datetime2)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But I can't find the existence of a datetime in excel.  I only see a Date and then a Time.  So for the denominator of the above forumula I'm now faced with&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;(date1-date2)*24 + time1-time2&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This is assuming date1-date2 yeilds days as an integer and time1-time2 yeilds hours.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I never got any further in excel.  I just wrote a query like so:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;SELECT (1874797-1856322)/DATEDIFF(hour, CAST('2009-08-21 15:18:35.913' as DATETIME), CAST('2009-08-22 08:25:42.837' as DATETIME))&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1086/hour ... done!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In retrospect, in excel it would have been faster for me to make a graph from my data points, add a trend line, then put a few points into that formula.  From there I could get the rate I was looking for.  This is me, the excel non-guru.  Let me know of any good links that might enlighten me of other methods.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1724922567321347478-6381933564569222020?l=www.coldblackcoffee.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.coldblackcoffee.com/feeds/6381933564569222020/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.coldblackcoffee.com/2009/08/excel-date-excel-time-but-what-about.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724922567321347478/posts/default/6381933564569222020'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724922567321347478/posts/default/6381933564569222020'/><link rel='alternate' type='text/html' href='http://www.coldblackcoffee.com/2009/08/excel-date-excel-time-but-what-about.html' title='Excel Date. Excel Time. But what about DateTime?'/><author><name>Steve Suhr</name><uri>http://www.blogger.com/profile/17498749449948903375</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_8a2r3FLyl6g/S3bWrWtnrJI/AAAAAAAAAOs/VFa1rg2ITcI/S220/20243_827382676383_6221562_45755001_2988426_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724922567321347478.post-5671810748629589373</id><published>2009-06-02T20:50:00.006-07:00</published><updated>2009-06-02T21:18:10.528-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MSSQL'/><title type='text'>MSSQL uniqueidentifier: Why no aggregates?</title><content type='html'>Say you have an MSSQL table with one column.  It is of the type uniqueidentifier, which is a &lt;a href="http://en.wikipedia.org/wiki/Globally_Unique_Identifier"&gt;Guid&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;This works:&lt;br /&gt;SELECT count(*) FROM myTable&lt;br /&gt;&lt;br /&gt;This Doesn't:&lt;br /&gt;SELECT count(myCol) FROM myTable&lt;br /&gt;&lt;br /&gt;In order to get this to work you have to do something like:&lt;br /&gt;SELECT count(CAST(myCol as varchar(36))) FROM myTable&lt;br /&gt;&lt;br /&gt;This solution and some variants I &lt;a href="http://www.devx.com/tips/Tip/14505"&gt;found&lt;/a&gt; &lt;a href="http://www.daveclayton.info/2009/03/mssql-aggregate-on-uniqueidentifier.html"&gt;in&lt;/a&gt; a &lt;a href="http://www.mydatabasesupport.com/forums/sqlserver-faq/227703-how-do-i-aggregate-uniqueidentifier-data-why-so-difficu.html"&gt;number&lt;/a&gt; of &lt;a href="http://www.eggheadcafe.com/forumarchives/sqlservernewusers/nov2005/post24245327.asp"&gt;places&lt;/a&gt;, while I was searching for the answer to another question.  Why?&lt;br /&gt;&lt;br /&gt;Why?  Because you can't apply any aggregate function to a uniqueidentifier.  The error message told me so.  But why can't you do that!?  Surely Microsoft could have it act like a varchar just to provide some default behavior.  There must be some deeper philisophical reason.&lt;br /&gt;&lt;br /&gt;I had to search around.  I was only able to find &lt;a href="http://doc.ddart.net/mssql/sql70/ca-co_21.htm"&gt;this&lt;/a&gt;, indicating that the text, image, and ntext types also can't do aggregates.  BUT I CANNOT FIND A REAL REASON.  So someone please help.&lt;br /&gt;&lt;br /&gt;I can understand limiting some aggregates, but count()?  Makes me long for PERL, where there is always if nothing else a default behavior.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1724922567321347478-5671810748629589373?l=www.coldblackcoffee.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.coldblackcoffee.com/feeds/5671810748629589373/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.coldblackcoffee.com/2009/06/mssql-uniqueidentifier-why-no.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724922567321347478/posts/default/5671810748629589373'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724922567321347478/posts/default/5671810748629589373'/><link rel='alternate' type='text/html' href='http://www.coldblackcoffee.com/2009/06/mssql-uniqueidentifier-why-no.html' title='MSSQL uniqueidentifier: Why no aggregates?'/><author><name>Steve Suhr</name><uri>http://www.blogger.com/profile/17498749449948903375</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_8a2r3FLyl6g/S3bWrWtnrJI/AAAAAAAAAOs/VFa1rg2ITcI/S220/20243_827382676383_6221562_45755001_2988426_n.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724922567321347478.post-3129405824033088320</id><published>2009-06-02T20:17:00.007-07:00</published><updated>2010-03-02T21:50:03.757-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Admin stuff'/><title type='text'>PsExec! Run things remotely</title><content type='html'>PsExec saved me a ton of time (if I had found it sooner it would have saved me much much more).  Let me cut to the important part before I ramble.  Here is all the usage info I needed from &lt;a href="http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx"&gt;PsExec&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;PsExec [\\computer] cmd [arguments]&lt;br /&gt;&lt;br /&gt;The complete usage is really:&lt;br /&gt;&lt;br /&gt;&lt;strong style="font-weight: normal;"&gt;psexec [\\computer[,computer2[,...] | @file][-u user [-p psswd]][-n s][-l][-s|-e][-x][-i [session]][-c [-f|-v]][-w directory][-d][-&lt;priority&gt;][-a n,n,... ] cmd [arguments]&lt;/priority&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;So simple!  I'm embarrassed to say what I tried before this.  Anyways, here I go ...&lt;br /&gt;My first thought was to quickly (ha!) create a web service to do what I wanted.  I use this type of thinking all the time.  Usually churning out a little administrative website or web service gets the job done.  But I learned that creating a web service that wraps this particular exe was a HUGE pain.  I tried everything but could not give IIS the proper permissions to execute it.&lt;br /&gt;&lt;br /&gt;Then I tried impersonation to get the program to run.  Has anyone ever used impersonation without hating their life?  Really I'm curious.  For me when impersonation seems like a solution, it means I need to stop and rethink things because impersonation is never the answer for me.&lt;br /&gt;&lt;br /&gt;Finally, psexec came my way.  I had the luxury of being on the same network as the other machines I was trying to manage.  What kills me is that I had used psKill before (another tool in the appropriately names PsTools download).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1724922567321347478-3129405824033088320?l=www.coldblackcoffee.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.coldblackcoffee.com/feeds/3129405824033088320/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.coldblackcoffee.com/2009/06/psexec-run-things-remotely.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724922567321347478/posts/default/3129405824033088320'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724922567321347478/posts/default/3129405824033088320'/><link rel='alternate' type='text/html' href='http://www.coldblackcoffee.com/2009/06/psexec-run-things-remotely.html' title='PsExec! Run things remotely'/><author><name>Steve Suhr</name><uri>http://www.blogger.com/profile/17498749449948903375</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_8a2r3FLyl6g/S3bWrWtnrJI/AAAAAAAAAOs/VFa1rg2ITcI/S220/20243_827382676383_6221562_45755001_2988426_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724922567321347478.post-6827193857763561160</id><published>2009-05-17T13:41:00.000-07:00</published><updated>2009-05-18T08:43:49.874-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SEO'/><title type='text'>The domain name is very powerful in SEO</title><content type='html'>I found my domain ranking under all three of these searches today&lt;br /&gt;&lt;br /&gt;coldblackcoffee.com - not that surprising&lt;br /&gt;coldblackcoffee - also not crazy&lt;br /&gt;cold black coffee - WHAT?!&lt;br /&gt;&lt;br /&gt;I was pretty impressed with myself for ranking on what seemed like a decent keyword when I remembered I had not done any SEO optimization yet.  In fact, my blog should have still been sandboxed.  I'm not sure how Google found it. &lt;br /&gt;&lt;br /&gt;So I can only conclude that the name of your domain is extremely powerful for ranking on those keywords that are similar to it.  Now, the title of my blog's main page is the same as the domain name, so that is pretty huge too.  But I also rank on this:&lt;br /&gt;&lt;br /&gt;co ldbl ackcof fee&lt;br /&gt;&lt;br /&gt;So I think Google is concatenating every search together and just looking for domain names that match.  It seems to be an SEO shortcut for a small number of keywords.  So don't do what I did, and buy a domain that sounds neat but really isn't relevant to your blog at all.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1724922567321347478-6827193857763561160?l=www.coldblackcoffee.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.coldblackcoffee.com/feeds/6827193857763561160/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.coldblackcoffee.com/2009/05/domain-name-is-very-powerful-in-seo.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724922567321347478/posts/default/6827193857763561160'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724922567321347478/posts/default/6827193857763561160'/><link rel='alternate' type='text/html' href='http://www.coldblackcoffee.com/2009/05/domain-name-is-very-powerful-in-seo.html' title='The domain name is very powerful in SEO'/><author><name>Steve Suhr</name><uri>http://www.blogger.com/profile/17498749449948903375</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_8a2r3FLyl6g/S3bWrWtnrJI/AAAAAAAAAOs/VFa1rg2ITcI/S220/20243_827382676383_6221562_45755001_2988426_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724922567321347478.post-4685904810556181899</id><published>2009-05-12T10:45:00.002-07:00</published><updated>2010-03-02T21:48:02.200-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Serialization'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>I Failed to Serialize the Encoding Class</title><content type='html'>I got the error, &lt;span style="font-weight: bold;"&gt;"The specified type is abstract"&lt;/span&gt;, when trying to serialize a class with a property of type Encoding (I was just tweaking existing XML).  &lt;a href="http://msdn.microsoft.com/en-us/library/system.text.encoding.aspx"&gt;A quick look at MSDN&lt;/a&gt; confirms that the Encoding class is indeed abstract.&lt;br /&gt;&lt;br /&gt;I almost accepted the fact that you couldn't serialize abstract classes until I remembered running into this issue before.  You can!  You just need the &lt;a href="http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlincludeattribute.aspx"&gt;XmlInclude attribute&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt; [XmlInclude(typeof(InheritingClass1))]&lt;br /&gt; [XmlInclude(typeof(InheritingClass2))]&lt;br /&gt; public abstract class MyAbstractClass&lt;br /&gt; ... rest of class declaration&lt;br /&gt;&lt;br /&gt;Then in the XML you can&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt; &amp;lt;MyAbstractClassPropertyName xsi:type="InheritingClass1"&amp;gt;&lt;br /&gt; ...&lt;br /&gt;&lt;br /&gt;&lt;a href="http://unboxedsolutions.com/sean/archive/2004/07/17/249.aspx"&gt;Unboxed Solutions has a nice article on it&lt;/a&gt; that shows the serialization code.&lt;br /&gt;&lt;br /&gt;I tried using an XmlSerializer myself to create the XML and I got this error&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;The type System.Text.UTF8Encoding was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known statically.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;This means that in .NET they didn't bother with an XmlInclude attribute on the Encoding class for UTF8?  Is it not "known statically"? I'm pretty sure it is!&lt;br /&gt;&lt;br /&gt;So I give up.  I'm going to use an enum for different encodings and then map that to the actual type that should be serializable in the first place.  Anybody figure out a better way?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1724922567321347478-4685904810556181899?l=www.coldblackcoffee.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.coldblackcoffee.com/feeds/4685904810556181899/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.coldblackcoffee.com/2009/05/i-failed-to-serialize-encoding-class.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724922567321347478/posts/default/4685904810556181899'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724922567321347478/posts/default/4685904810556181899'/><link rel='alternate' type='text/html' href='http://www.coldblackcoffee.com/2009/05/i-failed-to-serialize-encoding-class.html' title='I Failed to Serialize the Encoding Class'/><author><name>Steve Suhr</name><uri>http://www.blogger.com/profile/17498749449948903375</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_8a2r3FLyl6g/S3bWrWtnrJI/AAAAAAAAAOs/VFa1rg2ITcI/S220/20243_827382676383_6221562_45755001_2988426_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724922567321347478.post-7208813090671470786</id><published>2009-05-11T14:03:00.003-07:00</published><updated>2010-03-02T21:49:23.352-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>C# needs a cross platform GetHashCode method</title><content type='html'>Here was my thought process.  I need to get a hash of a string, which hashing algorithm should I use?  Eh, I'll just use .NET's GetHashCode method and run with it.  It should be fast and easy and that is what I'm after right now.  The .NET framework is so lovely for rapid development and this will be another perfect example.&lt;br /&gt;&lt;br /&gt;WRONG!  As I soon found, the GetHashCode method &lt;a href="http://stackoverflow.com/questions/53086/can-i-depend-on-the-values-of-gethashcode-to-be-consistent"&gt;can and does vary&lt;/a&gt; from .NET version to .NET version and also from platform to platform.&lt;br /&gt;&lt;br /&gt;My mistake was persisting these hash codes to a database.  You know ... to use as a key for some value, like a normal person might use a hash.  But I had both 32 and 64 bit machines accessing the same database and they were coming up with different hash codes for the same value.&lt;br /&gt;&lt;br /&gt;Before I go too much further, Let me say that I get the need to optimize and evolve a hashing algorithm over time.  I have no issue with that.  But how about giving us some overload that uses a cross platform version.  For me it is far more useful to be able to persist my hashes than to have it optimized to the point where I can only use the hash codes for in memory stuff.&lt;br /&gt;&lt;br /&gt;So for piece of mind I'm probably going to keep my own libraries for hashing.  I'd like to use System.Security.Cryptography for this purpose.  &lt;a href="http://blog.brezovsky.net/en-text-2.html"&gt;It seems easy enough&lt;/a&gt;.  But can I trust this library to not have its implementation changed as well?  Now I'm spooked.  Maybe instead I should own the code all the way down to the bitwise ORs.  Better safe than sorry.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1724922567321347478-7208813090671470786?l=www.coldblackcoffee.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.coldblackcoffee.com/feeds/7208813090671470786/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.coldblackcoffee.com/2009/05/c-needs-cross-platform-gethashcode.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724922567321347478/posts/default/7208813090671470786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724922567321347478/posts/default/7208813090671470786'/><link rel='alternate' type='text/html' href='http://www.coldblackcoffee.com/2009/05/c-needs-cross-platform-gethashcode.html' title='C# needs a cross platform GetHashCode method'/><author><name>Steve Suhr</name><uri>http://www.blogger.com/profile/17498749449948903375</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_8a2r3FLyl6g/S3bWrWtnrJI/AAAAAAAAAOs/VFa1rg2ITcI/S220/20243_827382676383_6221562_45755001_2988426_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1724922567321347478.post-4073437617117930191</id><published>2009-05-11T12:49:00.002-07:00</published><updated>2010-03-02T21:48:59.624-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='S3'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Character set issues with Amazon S3</title><content type='html'>Recently for my job I've had to start working with some wacky (to me) European characters and they've worked their way into some XML files that I'm storing in S3.  Now, when I put the files into S3 things seem ok because I'm doing that via some other linux command line tool that I didn't write.  But when I retrieve the file with my C# code I run into trouble.&lt;br /&gt;&lt;br /&gt;For example, instead of the German character "ß" I get "A?".  Using HTTP Analyzer I saw something similar coming back, but instead of ?s I saw random nonsense characters.  Most importantly I saw 2 characters where I wanted one.  ENCODING!!&lt;br /&gt;&lt;br /&gt;Now for most HTTP request stuff I've had luck with this:&lt;br /&gt;&lt;br /&gt;    public static string GulpInputStreamAsString(HttpWebResponse response)&lt;br /&gt;    {&lt;br /&gt;string text = string.Empty;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;  Encoding responseEncoding = Encoding.GetEncoding(response.CharacterSet);&lt;/span&gt;&lt;br /&gt;using (StreamReader sr = new StreamReader(response.GetResponseStream(), responseEncoding))&lt;br /&gt;           {&lt;br /&gt;                 text = sr.ReadToEnd();&lt;br /&gt;           }&lt;br /&gt;           return text;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;But apparently S3's REST API isn't giving me a character set so instead I just had to do some guess and test and found that this works:&lt;br /&gt;&lt;br /&gt;    public static string GulpInputStreamAsString(HttpWebResponse response)&lt;br /&gt;    {&lt;br /&gt;        string text = string.Empty;&lt;br /&gt;        &lt;span style="font-weight: bold;"&gt;Encoding responseEncoding = Encoding.UTF8; //seems to work with German&lt;/span&gt;&lt;br /&gt;        using (StreamReader sr = new StreamReader(response.GetResponseStream(), responseEncoding))&lt;br /&gt;        {&lt;br /&gt;            text = sr.ReadToEnd();&lt;br /&gt;        }&lt;br /&gt;        return text;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I'm not sure who is responsible for making these encoding things less painful.  You'll never be able to trust every web server, so it seems like C#'s System.Net library should have some auto detecting encoding functionality.  Heck, maybe it already does.  Am I missing something?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1724922567321347478-4073437617117930191?l=www.coldblackcoffee.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.coldblackcoffee.com/feeds/4073437617117930191/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.coldblackcoffee.com/2009/05/character-set-issues-with-amazon-s3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1724922567321347478/posts/default/4073437617117930191'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1724922567321347478/posts/default/4073437617117930191'/><link rel='alternate' type='text/html' href='http://www.coldblackcoffee.com/2009/05/character-set-issues-with-amazon-s3.html' title='Character set issues with Amazon S3'/><author><name>Steve Suhr</name><uri>http://www.blogger.com/profile/17498749449948903375</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_8a2r3FLyl6g/S3bWrWtnrJI/AAAAAAAAAOs/VFa1rg2ITcI/S220/20243_827382676383_6221562_45755001_2988426_n.jpg'/></author><thr:total>0</thr:total></entry></feed>
