/// Frank Hagen: Professional Web Developer, C# User, Reformed Über-geek RSS 2.0
# Wednesday, January 02, 2008

I am not a Republican nor a Democrat.  I believe both parties are fundamentally flawed.  But I find it immensely amusing that the Democratic Party is a complete lie.  We do not live in a Democracy, but a Republic!  Think about it....

Wednesday, January 02, 2008 11:17:46 AM (Eastern Standard Time, UTC-05:00)  #    Comments [2] -
Politics
# Monday, December 31, 2007

I do not condone overriding group policies on systems in a corporate network as a general rule.  The policies are setup for a reason and are there to help and protect you.  No, really.

However, sometimes you need to override some to get your job done or sometimes are not appropriate.   For instance, I am a fervent proponent of the locked desktop.  So much so that I reflexively use winkey-L when I get up from my desk.  As a fail-safe, I set my screensaver duration to a ridiculously low value.  Ah, but our networking folks have set group policy that is more lenient and restricted users from modifying it.  So as an admin of my box, I went around the policy and set it back to more aggressive values. 

Now I can defend my position as tightening security as opposed to violating policy, but my actions are still wrong.  The following link is to Mark Russinovich's excellent article on circumventing inconvenient group policies.  Read it at your own risk:

Circumventing Group Policy Settings

Monday, December 31, 2007 10:45:10 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
System
# Saturday, December 29, 2007

Amazon.com: The Time Ships: Books: Stephen BaxterWhen I finished Thunder Below, I realized that I haven't read a Sci-Fi title in a long time and picked up a book co-authored by Ben Bova.  It stunk.  I didn't get more than 100 pages in and dropped it.  I was afraid that since I have read a great many good books with relevance lately, that I was tainted to the irrelevant, namely fiction.   I was wrong.

The Time Ships is a sequel of sorts.  It picks up from The Time Machine, the master work by H.G. Wells.  We follow the further adventures of the Time Traveler as he attempt to return to the time of the Eloi and Morlocks.  But he discovers that time streams are not linear and he cannot return to the future as returning to the past has obliterated that possible future.  Instead he meets a Morlock who is civilized and vastly intelligent, far removed from the Morlocks of Wells imagining.  The remainder of the story involves the Time Traveler's futile attempts to find his place in the Multiplicity, or the whole of possible past and futures.

The main praise I have for this book is this:  Finally someone treats time travel in a way that is not insulting to anyone who knows the least bit of theoretical physics or cosmology.  I really enjoyed this book and will use it as a stepping stone to more of Baxter's works.  Well done, excellently planned and brilliantly executed.  A fine read.

Saturday, December 29, 2007 9:26:20 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
Books
# 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
<%--
--%>
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