Posted by Ed:
I’ve been discovering SQL Server 2005 lately, and today I came across my first moment of elation for this product. This may be old news for many developers out there, but I went to create a stored procedure and the following code was automatically generated for me. Here’s the auto generated code:
– ================================================
– Template generated from Template Explorer using:
– Create Procedure (New Menu).SQL
–
– Use the Specify Values for Template Parameters
– command (Ctrl-Shift-M) to fill in the parameter
– values below.
–
– This block of comments will not be included in
– the definition of the procedure.
– ================================================
SET
ANSI_NULLS
ON
GO
SET
QUOTED_IDENTIFIER
ON
GO
– =============================================
– Author: <Author,,Name>
– Create date: <Create Date,,>
– Description: <Description,,>
– =============================================
CREATE
PROCEDURE
<Procedure_Name,
sysname, ProcedureName>
– Add the parameters for the stored procedure here
<@Param1,
sysname, @p1>
<Datatype_For_Param1,
,
int>
=
<Default_Value_For_Param1,
, 0>,
<@Param2,
sysname, @p2>
<Datatype_For_Param2,
,
int>
=
<Default_Value_For_Param2,
, 0>
AS
BEGIN
– SET NOCOUNT ON added to prevent extra result sets from
– interfering with SELECT statements.
SET
NOCOUNT
ON;
– Insert statements for procedure here
SELECT
<@Param1,
sysname, @p1>,
<@Param2,
sysname, @p2>
END
GO
Normally I would go through some pain to generate this myself, but SQL Server 2005 gives you a great user interface for filling this information for you after hitting Ctrl-Shift-M. Here’s a screen shot of that:

I found this to be the most amazing thing and wanted to share it with the world. Some day’s it’s the little things that make me happy.
I’ve been fiddling with a vb.net app that will download a youtube video by passing it the youtube.com url. I’ve put it all in a zip file with a compiled copy.
| Command Line Help |
getyoutube /url [youtube url] [/fmt [format]] [/file [filepath]]
Avaliable Formats:
/fmt 5 = .flv 320x240
/fmt 6 = .flv 480x360
/fmt 13 = .3gp 176x144
/fmt 17 = .mp4 176x144
/fmt 18 = .mp4 480x360 (default)
*Note: Taken from Google Video Formats
|
[Download]
Here’s how it works.
There is a special url that will allow you to download any youtube video.
| http://www.youtube.com/get_video?fmt=[Format Integer]&video_id=[Video ID]&t=[Video Hash] |
So to make it work you need three pieces of information. The first two are easy.
[Format Integer]
This is one of these integers: 5, 6, 13, 17, 18. Look at the top of the post for what they mean.
[Video ID]
This is the querystring info in the url. For this Youtube url, http://youtube.com/watch?v=uSodXW85tFQ, the Video id = uSodXW85tFQ.
[Video Hash]
This one is a bit tricky and requires you to read the html source to find it. Search for “fullscreenUrl” which should be somewhere around line 75. In that long url that is being assigned to the fullscreenUrl variable there is a querystring parameter “t”. That parameter holds the Video Hash.
| Example: |
var fullscreenUrl = ‘/watch_fullscreen?fs=1&q=media.home&BASE_YT_URL=http%3A%2F%2Fyoutube.com%2F
&vq=None&sourceid=ys&video_id=uSodXW85tFQ&l=401&sk=LjlS9dT7DJ37MlsVIRq-UuU0f5kv6zGQC
&fmt_map=&t=OEgsToPDskJLyXIyicQoyTtHoIfQsWOu&hl=en&plid=AAROPIZ1iLx275xpAAAAIAAQAAA&title=media.home RSS reader’; |
Troubleshooting issues is an art form that is at first glance all based on experience. The idea is that if you’ve seen the problem before, then you can fix it easily. This mentality is what keeps people from being able to fix problems correctly. I believe that troubleshooting comes down to breaking things into little bits and examining each part individually. Here are my top 5 rules of troubleshooting problems
- If you didn’t change anything and the problem goes away, then you didn’t fix the problem. It will return. If you can repeat a problem, then it can be fixed. Try to find a way to repeat the problem safely. Intermittent problems are always the worst to diagnose, so do what you need to do in order to reduce the randomness.
- Break it down into little manageable pieces. sometimes we get overwhelmed with the complexity that nothing gets fixed. Try to isolate each individual portion of the problem to make it easier to work with.
- If something has been working well and then stops working, find out what changed. This sounds obvious, but it really is true. Ask the question "What’s different? What changed?" Don’t just dive into your own code (the code that you know is fully tested and was working correctly), examine all exterior factors to determine the root cause.
- Listen, really pay attention to what is going on. Sometimes you will notice things that you never thought of before.
- Don’t panic. We all remember this saying from The Hitchhikers guide to the galaxy, but it really holds true. When you panic, you start to make incorrect decisions.
Have you ever been in a situation where your hard drive is full, yet you don’t really know why? Ever want to just figure our quickly what files are taking up the most space? How about a directory that has thousands of very small files collectively taking up a ton of space on your hard drive and you didn’t even know it? Those questions can all be answered with my favorite utility WinDirStat. This application examines your drive (hard drive, usb drive, etc) and gives you a color coded visual representation of your entire drives contents. The user interface is intuitive and without instruction you can figure out how to find the offending files and remove them. It does not require a setup package, so it easily runs from a usb stick. It’s originally a port from a Linux application called KDirStat. Give it a try and let us know what you think.