Getting Object Dependencies via Sql Query - Sql Server

In case you want to get dependencies as Microsoft SQL Server Management Studio shows you but with a script instead of through the management studio gui.

/* all dependencies */
SELECT distinct o.name, o.type_desc, p.name as dependency, p.type_desc as dependency_type_desc
FROM sys.sql_dependencies d
INNER JOIN sys.objects o
    ON d.object_id = o.object_id
INNER JOIN sys.objects p
    ON d.referenced_major_id = p.object_id

/* user table dependencies */
SELECT distinct o.name, o.type_desc, p.name as dependency, p.type_desc as dependency_type_desc
FROM sys.sql_dependencies d
INNER JOIN sys.objects o
    ON d.object_id = o.object_id
INNER JOIN sys.objects p
    ON d.referenced_major_id = p.object_id
and p.type_desc = 'USER_TABLE'

Source:
http://stackoverflow.com/questions/299128/sql-server-dependencies

Enable Gzip Compression IIS 6

Use the adsutil script in C:\Inetpub\AdminScripts\ directory. The following script will enable most common file extentions for gzip/deflate compression. 


cscript.exe adsutil.vbs set W3Svc/Filters/Compression/GZIP/HcFileExtensions "htm" "html" "txt" "ppt" "xls" "xml" "pdf" "xslt" "doc" "xsl" "htc" "js" "css" 

cscript.exe adsutil.vbs set W3Svc/Filters/Compression/DEFLATE/HcFileExtensions "htm" "html" "txt" "ppt" "xls" "xml" "pdf" "xslt" "doc" "xsl" "htc" "js" "css" 

cscript.exe adsutil.vbs set W3Svc/Filters/Compression/GZIP/HcScriptFileExtensions "asp" "dll" "exe" "aspx" "asmx" "ashx" 

cscript.exe adsutil.vbs set W3Svc/Filters/Compression/DEFLATE/HcScriptFileExtensions "asp" "dll" "exe" "aspx" "asmx" 

IISreset.exe /restart 

When Social Media Goes Awry - Toyota Van Fire

Faceboo-toyoto-sienna-fire-1
I just happened upon this little drama on the Toyota Sienna Facebook page.

 
Apparently, a family is claiming their van caught fire in their driveway just a few days after purchase.
 
Heidi Trockels Dunigan Toyota, this is Dr Dunigan, you have your facts inaccurate. The resolution to the mini van was agreed upon Toyota Legal Department and the bank that financied the vehicle. As I was told by the bank that this was the easiest way for the bank and Toyota to come to a resolution. They forgot to include us in the negotations when we have greater than 50 percent equity in the van. Now the paperwork that was delivered from the dealership (the dealership has been awesome in this matter) was three blank pages that I was supposed to sign. Who would in their right mind sign blank papers authorizing who knows what. If this is the resolution or Toyota's standard operating procedures then I have a concern about purchasing another 2011 Sienna. I always thought that the customer comes first but appearently Toyota has taken that position for self protection. A sad day!!!!
 
Heidi Trockels Dunigan The cause has been determined to be a faulty fan wire that may have gotten knicked during manufacturing. So far it appears to be an isolated incident - I hope so. 
 
 Heidi Trockels Dunigan Phil - much more then cleaning off the driveway - there is a big hole in my driveway and half my house was torched! But yes the cause has been determined as stated above. Not to mention that my kids are still freaked out by it - we were not out of the van 2 minutes and then it was totally engulfed in flames...
 
 
What's more interesting to me (besides the obvious questions of safety in light of other recent events) is the social media aspect of this.  Toyota uses Facebook to promote their product.  Customer has problem with said product and posts complaints directly on this Facebook page. Now Toyota has an embarrassing problem on a very popular public web site that it does not control.  I wonder how this will play out.  It would be a great opportunity for Toyota to who it's dedication to customers (again, especially in light of recent events).

Beyond Black Boxes in Software

I've seen/heard object oriented software compared to a black box.  You don't need to know how something happens, you just need to know that it happens.

This is a nice analogy, as far as it goes.  Unfortunately, most software libraries are not well documented.  Even the gold standard Microsoft/Java/Python libraries could be improved.  This isn't a a jab at those technologies, I use them all the time, but even the best could be improved.

In fact, I've downloaded some of the .NET framework so I could see how certain algorithms were implemented. 

Now, to black boxes.  Wouldn't it be better to have crystal boxes?  Where you can clearly see what is happening on the inside, but not be allowed to mess with the guts (unless it's open source of course).  .NET sorta has this.  You can use some kind of reflector to see all the internals of an object.

You'd still have the open closed principle (open for extension, closed for modification).  I think Python is close to this ideal.  You can play with objects in the interpreter.  You can also get your hands on the source.

Black boxes sounds good in theory.  However, in practice, I'd prefer a nice transparent crystal box.  

Including Unit Test Code in Classes

Why don't we include unit tests _inside_ a class?  The test would be exposed via a _Testable_ interface.  Methods would include RunTests() and return a object reporting success or failure.

While reading a post about testing, I had an epiphany of sorts.  Instead of making all private methods public _just_ to facilitate testing, why not make an interface that supports testing.  Much like electrical equipment that ships with a self test mode, the test could be run "in the field" to make sure it works OK.

There are some small issues to figure out.  Which testing framework do you support?  Does the extra test code bloat the production code?  However, I wonder if this wouldn't solve a lot of problems causes because the test is separate from the code.  Especially unit code testing which is by definition very closely tied to the code under test.

Do you see any other problems with this approach?  Is this a good idea or not?

New Phone - HTC Incredible

Wow, what a surprise.  This phone is great.  When you've been in the tech game awhile, you get so used to over-promised under-delivered crap that when something does what it claims, you are amazed.

I am amazed.  This phone works well for email, text, camera and even making phone calls.  Navigation works well.  Web browsing is surprisingly easy.  (Why is is easier to surf the web on my phone than on my computer?)

I just need a decent case.  I'm looking for a sleeve that isn't too bulky, just enough to protect the screen when not in use.  Looks like I may have order the Nexus One sleeve from HTC. (please comment if you have a suggestion).

I've spent a week with the phone.  Still discovering features.  Haven't even started hacking on it yet.  

mpc-hc or why is free software better than paid?

My Dell Zino came with PowerDVD.  PowerDVD does upscaling, which is nice, however, it was using so much of the cpu that the little fan on the Zino was cranking away.  Very annoying.

So I tried Windows Media Player.  It used less CPU but it doesn't upscale (at least I couldn't see how to do it).

So I downloaded the trusty mpc-hc (which I always end up using as my media player).  So far it's upscaling fine with pretty decent (low) cpu usage.  

So again, why would you pay for something (PowerDVD) when a better product is available for free?

I don't mind paying for software, but when it's not as good as the open/free stuff, I don't see the point.

Writing Advice for Engineers

How to make engineers write concisely with sentences? By combining journalism with the technical report format. In a newspaper article, the paragraphs are ordered by importance, so that the reader can stop reading the article at whatever point they lose interest, knowing that the part they have read was more important than the part left unread.

State your message in one sentence. That is your title. Write one paragraph justifying the message. That is your abstract. Circle each phrase in the abstract that needs clarification or more context. Write a paragraph or two for each such phrase. That is the body of your report. Identify each sentence in the body that needs clarification and write a paragraph or two in the appendix. Include your contact information for readers who require further detail.

-- William A. Wood , September 8, 2005

http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0001yB

Adding DVD Shrink to Autorun in Windows 7 64 bit

Click here to download:
DVDShrink_Autoplay.reg (0 Bytes)

If you ant to add DVD Shrink to the Autorun menu in Windows, here's a link:

http://www.dvdshrink.info/autoplay.php

This works fine for the 32 bit versions of Windows but I needed a 64 bit version.

Here it is.  Works for me on Windows 7 64 bit Ultimate.  Your Mileage May Vary.

WARNING: as with any registry change, you should back up your registry before applying this.
Use at your own risk. You've been warned..

Recursive Minutes to Days, Hours, Minutes in C# (Humanize Time)

If you need to convert a lump sum of minutes into something a little easer for humans (people) to read then here it is:

Comments welcome.

private static string MinutesToHumanTime(int minutes)
{
        const int MINUTES_IN_DAY = 60 * 24;

        if (minutes >= MINUTES_IN_DAY)
        {
                var days_as_string = (minutes / MINUTES_IN_DAY).ToString() + " days ";

                return days_as_string + MinutesToHumanTime(minutes % MINUTES_IN_DAY);
        }
        else if (minutes >= 60)
        {
                var hours_as_string = (minutes / 60).ToString() + " hours ";

                return hours_as_string + MinutesToHumanTime(minutes % 60);
        }
        else
        {
                return minutes.ToString() + " minutes ";
        }
}

About

[Insert Witty Saying Here]