/// Frank Hagen: Professional Web Developer, C# User, Reformed Über-geek RSS 2.0
# Wednesday, December 12, 2007

I heard a brilliant reason clever generalization for why Socialism, and by extension Communism, will always be doomed to failure:

Have you ever rented a car?  Did you wash it?

Edit:  Commenter inadvertantly reminds me that this is not a reason, but a gross simplification.  I don't discount the hundreds of other reasons and historical proofs for the failure of Marxist states.

Wednesday, December 12, 2007 11:51:15 AM (Eastern Standard Time, UTC-05:00)  #    Comments [2] -
Life | Politics
# Wednesday, November 21, 2007

Someone help me, please.  I don't understand why scalpers are "evil profiteering bastards" and Ticketmaster and the venues are not.  What is wrong with buying any commodity and selling it to someone else at a higher price?  It works well on Wall Street, why not in entertainment.

"Face Value" is a myth.  The value of an object is the price you can assign that object and find a buyer for it.  If I buy a comic book for $1 and sell it to you for $50, then it has a value (to me and you) of $50.  If someone buys 10 tickets to Hannah Montana for $50 each and sells each one for $150 each, what is the value of those tickets?  "But the scalper is not a fan, he should not be able to buy tickets."  Why?  Give me one rational, valid reason.  The scalper is no different than any other commodity broker.  He takes a risk and typically reaps reward; but only if the market will bear it. 

If you don't like the tactics of the scalper, fine!  I don't either.  Don't buy from him.  But know that if you do, you validate his business model, and therefore condone his action.  On the other hand, I guarantee that when it is no longer profitable, rather it becomes unprofitable, the practice WILL cease.  Do not force legislation, do not cry about it.  Stop supporting them, and they will go away.

By the way, the people you should be angry at are the ones who paid $1000 for tickets to Hannah Montana.  Shame on them.

Wednesday, November 21, 2007 2:40:46 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
Rant
# Monday, November 05, 2007

Amazon.com: Fatal Terrain: Books: Dale BrownIn June of this year, Rear Adm. Eugene B. Fluckey died at the age of 93.  I cannot hope to give a proper summary of his career, but to say the summary of it upon his passing caused me to immediately purchase his book chronicling his command of the submarine USS Barb. 

Thunder Below! is slang used in WWII for depth charges and gives us the indication that this book is about submarine warfare.  What we cannot be prepared for is the great storytelling found here.  The USS Barb was the most successful submarine in the US Pacific Fleet during WWII under the command of one man.  This is the story of the Captain and his crew on some of the most daring raids of Japanese shipping, ports, factories and even an attack against a train.  The Barb even pioneered the use of rocketry from submarines.  The official war record reads like a novel and this first person account, accompanied by official American and Japanese documentation, is more exciting than many thrillers.

I started this book because the topic interested me.  I finished this book knowing it would be a permanent part of my library.  I recommend this book to anyone who is interested in first person accounts of WWII, naval engagements, or military history.  I thoroughly enjoyed it from cover to cover and anticipate that I will read it again one day.  Very impressive.  Adm. Fluckey should be recognized by everyone as a true and very real American Hero.

Monday, November 05, 2007 10:57:58 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
Books
# Thursday, November 01, 2007

Paul Tibbets died today at the age of 92.  I would like to honor him for the outstanding way he stood up to critics for what was, to him, and truly was, just another mission. 

Thank you, General Tibbets.  You were, and will always be, an American Hero of the greatest sort.  You stood tall, did your duty, and honored our country with dignity.

Thursday, November 01, 2007 1:29:38 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
History | Military
# Tuesday, October 30, 2007
Here's an extremely useful stub to get data from SQL-Server within a PowerShell script:
$TaskName = "20071029-AllRejectedDuring"
$SqlServer = "SQLDEV01";
$SqlCatalog = "MyData";

# Get the T-SQL Query from .SQL file
$SqlQuery = Get-Content (".\" + $TaskName + ".sql")

#Write-Host ($SqlQuery) -foregroundcolor "gray"

# Setup SQL Connection
$SqlConnection = New-Object System.Data.SqlClient.SqlConnection
$SqlConnection.ConnectionString = "Server = $SqlServer; Database = $SqlCatalog; Integrated Security = True"

# Setup SQL Command
$SqlCmd = New-Object System.Data.SqlClient.SqlCommand
$SqlCmd.CommandText = $SqlQuery
$SqlCmd.Connection = $SqlConnection

# Setup .NET SQLAdapter to execute and fill .NET Dataset
$SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
$SqlAdapter.SelectCommand = $SqlCmd
$DataSet = New-Object System.Data.DataSet

#Execute and Get Row Count
$nRecs = $SqlAdapter.Fill($DataSet)

Write-Host ($nRecs.ToString() + " Records retrieved.") -foregroundcolor "Cyan"
$SqlConnection.Close();

if ($nRecs -gt 0)
{
  # Do Stuff
  $DataSet.Tables[0].Rows[0][0]  #Print first data element
}

The connection is using Integrated Security for simplicity, it wouldn't be difficult to switch to UID/PWD instead.  Also, I put the SQL in a .sql file (flat text) to make life easier; you could also put the statement in the string declaration, if it is a simple query.  PowerShell's Get-Content mechanism makes reading a file very easy.  Also, clean up after yourself, I won't include that here.

UPDATE:  I have posted a full script to export to Excel or XML in a followup post.

Tuesday, October 30, 2007 11:51:30 AM (Eastern Standard Time, UTC-05:00)  #    Comments [2] -
PowerShell | SQL
# Monday, October 29, 2007

If you do any scripting at all in Windows, you should be using PowerShell to do it.  But the first time you do, assuming you've installed it properly is the following:

File C:\DEV\Report.ps1 cannot be loaded because the execution of scripts is
 disabled on this system. Please see "get-help about_signing" for more details.

You have two options:  sign your scripts (you should do this) or take the easy route and change the Execution Policy (do this at your own risk).  If you want to do it the right way, see Scott Hanselman's excellent post on the subject.  If you just want to run ps1 scripts, and are very careful about the source, namely yourself, execute the following command within the PowerShell shell:

Set-ExecutionPolicy RemoteSigned
Monday, October 29, 2007 1:12:35 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
PowerShell
# Friday, October 26, 2007

Here's your reminder that DST is ending again this weekend and you will be losing your free hour everyday.  But Wait!!  Congress moved it this year:  It's actually next week!  Yay!  Another week of free hours.  It a good thing Congress is saving us Time and Money, and more than ever before!

StandardTime.com

Friday, October 26, 2007 11:00:27 AM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] -
Life | Rant | Worse Than Failure
# Wednesday, October 24, 2007

Tiny milestone:  1000 page views at this site!

The number of views to Using since moving to WordPress has exceeded 1000 today.  woot...

Wednesday, October 24, 2007 2:47:44 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] -
Blog
<%--
--%>
Statistics
Total Posts: 189
This Year: 2
This Month: 0
This Week: 0
Comments: 74
Locations of visitors to this page
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2012
Frank W Hagen
Sign In
All Content © 2012, Frank W Hagen
Custom DasBlog theme based on 'Business' by Christoph De Baene