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

Well, the new domain is finally up.  FWHagen.com if you want to see it, but there is nothing there yet.  I purchased the hosting account 2 weeks ago and have yet to have the domain name properly transferred to the provider. 

Many years ago, I decided I wanted to have FWHagen.com for myself, for professional development and personal/family use.  I took a chance on the upstart company GoDaddy when they started out because they were pretty cheap.  I was very pleased with their service, having dealt with Network Solutions for years before at work.  That is until this past week, when I tried to transfer it.  After waiting for several days, I discovered that the account was "locked" to prevent any accidental or unauthorized transfers.  If you have ever transferred a domain before, you know that is a bunch of crap.  I had to personally authorize the transfer, so why the lock?  Because of the subsequent failure to transfer, I have to wait 60 days to try again.  The waiting period is ICANN specified, and I really don't have any logical problems with that, except that GoDaddy now gets to hold it for another 2 months. 

I was able to forward the DNS records over, so it works for now.  And I have a long time left to get the domain settled, as well.  It is just very frustrating to deal with underhanded greed like that.  For the sum of $10/year. 

UPDATE [19:50]:  I was wrong about GoDaddy.com.  On my way home this evening, I got a call directly from them expressing concern about my problems.  Now, here's the thing, I only posted my concerns here.  They took the initiative to track me down and fix the problem.  Well, tracking me down in the sense that I posted my domain name and they called my contact info, which only they have.  Long story short:  I am so impressed with their commitment to personal service that I am cancelling the transfer and will simply use DNS forwarding for my new site, as it works perfectly well.  I will continue to use them as my registrar and will definitely use them in the future whenever I can.  BTW, the 60-day wait is ONLY for sucessful transfers.  It does not apply to failed due to locks or privacy safeguards.  And the $10/yr jab?  Only heightens my impression of them.  They surely spent more than that in time and effort on one measely IT guy's satisfaction.

Tuesday, September 02, 2008 7:55:13 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] -
Blog | Rant
# Thursday, August 21, 2008

I hate seeing a solitary "1" on the bottom of a paged datagrid because the dataset is too short to have more than one page.  You don't really want to turn off paging but suppress the "1" when it is not needed.

Use this code to do just that when binding the grid:

        if (dgEmployee.Items.Count < dgEmployee.PageSize)
            dgEmployee.PagerStyle.Visible = false;
Thursday, August 21, 2008 11:32:25 AM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] -
.NET

I've had it with Cox Cable.  I tried to put up a photo album (all HTML, because they have never allowed scripting) last night, and was informed that my personal webspace exceeded the size limit.  After some digging, I found that they impose a 10MB limit on personal sites.  Their technical support people really dropped the ball there too, cause I could have been sold an upgrade to allow for my home server to publish, but no, that would be too much to ask.  I swear:  the day FiOS is available in my area, I am switching.

So I finally broke down and selected a paid host.  All of my personal and professional hosting will be done from, well, a highly regarded and recommended vendor. 

I will be moving this site to it as well sometime in the future.  Wordpress is very nice, but they will nickel and dime you to death for any customizable features (which is why this site looks so bad) and domain assignments.  Yes, I own a domain and have for years.  It's time to finally put it to use.

Thursday, August 21, 2008 9:33:19 AM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] -
Blog
# Wednesday, July 23, 2008
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.
Wednesday, July 23, 2008 10:55:30 AM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] -
PowerShell | SQL

Earlier, I wrote about getting data from MS-SQL with PowerShell, which is a very useful and powerful thing.  But just displaying data is very limited.  I have a need at work to create extract "reports" for business owners frequently into Excel.  So I have leverage this scripting technique to do the legwork for me.  After many iterations, I have completed the first version of a script that will take a SQL query in a text file and create an Excel file with the results.  All fully automated with time-stamping, archiving of the successful query, and the ability to export XML or CSV as well.

The script is unfortunately only listed as a page on this site because WordPress does not allow posting of non-media files.  You will have to copy the full content and paste it into a text file named QuerySQL.ps1.  One day, I will host this weblog on a real provider in order to have better control (I will accept donations!).  If many folks prefer, I will post it on my personal webspace with my ISP and provide links on request.  And maybe to CodeProject too.

Feel free to use it in anyway you wish.  Please learn from it if you can, or conversely, send me a note on how to improve it.  I would love to get the field-name bolding working among other things.

Wednesday, July 23, 2008 10:29:00 AM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] -
PowerShell | SQL
# Friday, July 18, 2008

Heralded by many to be one of the founding series of modern science fiction, this is the first book of the Lensmen series.  It has been made into games, TV shows, etc, none of which I am familiar with.  So, I thought I'd better get with it and do so.  I picked up an old dime-store copy and got reading.

Triplanetary seems to be a collection of early stories and a novella that sets the stage for the series to come.  The first few stories tell of the fall of Atlantis, the burning of Rome, WWI and WWII, etc.; important events in human history.  They expose an galactic plot between two superpowers at war with one another, although one doesn't know of the others existence, in which Earth and its inhabitants are unknowing pawns.  The final novella is about 3 Terrans captured by space pirates, escape, then by a vastly advance fish alien civilization, which, of course, are able to escape from again.  Fortunately, Terran military scientists are able to quickly reverse engineer the fish alien's vastly superior technology in only a few weeks (days?), and built a super-battleship capable of defeating the aliens very civilization.

Yes, this is early sci-fi.  Pulp fiction, et al.  And I probably would offend the leet geeks, but I thought this book was terrible.  Maybe this was a fan-service book to set the series, but I felt the characters were flat and trite; I didn't care what happened to them at all.  The swooning girl, the incredibly capable hero with a tender spot for our frail damsel, the military leaders with single-minded faith in our hero to the point of having no contingencies, all make for great plot indeed.  Maybe I have been led to expect too much, but Burroughs, Howard, Asimov, Clarke and the others have done so, and in surrounding time frames.  So, I won't find out if the rest of the series is any good.  I just don't care.  Indeed, I can't even be bothered to find cover art for this post.

Friday, July 18, 2008 10:49:02 AM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] -
Books
# Sunday, June 15, 2008

Dale BrownRecommended by another of my ex-Navy friends, I have just completed my 3rd read of this book.  I first read it in 1996, and have considered it one of the most important books I have ever read.  I love combat books written from the point of view of the man in the trenches; this is the one that started it all.  I prize my copy so highly that I will not lend it to anyone.

Company Commander is the experiences of Captain Charles MacDonald, US Army, from the fighting at the Siegfried Line to the end of fighting of World War II.  He is put in command of I Company as a replacement for the previous CO killed during their last engagement.  His baptism of fire during the Wehrmacht's last offensive at the battlements is a stunning introduction to the front.  Mac works us through his fears and nervousness as a new commander and gives us witness to the elation of survival in the trenches.

This book is one of the most memorable I have read about combat infantrymen in WWII.  I dare say it may be one of the most important I have ever read.  Although I have no way of knowing its accuracy, I suspect that the frank portrayal of the front-line infantryman is the reason for the gripping read.  Ironically, he has also captured the long stretches of boredom followed by the frantic moments of utter panic.  Yet the slow areas are more a relief than they are dull passages.  The only complaint I might have is the near complete absence of any technologic detail of the weaponry used, although that is more than made up for by the detailed analysis of the order of battle used during the conflict.  If you have any interest in infantry combat in WWII, this is a must-read book.

Sunday, June 15, 2008 9:18:34 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] -
Books
# Wednesday, May 21, 2008

There has been a lot of talk in the channels lately about the Quad Core CPUs lately.  Most of it has been along the lines regarding most applications only use 1 or 2 cores so the others sit idle.  Others say that in the future, that will change, but why spend the extra money on the purchase and in the cost of the power until then.  Essentially, expert opinion is that it is a waste of money.

I am not an expert.  I am, however, a professional developer and a experienced computer user (~30 years) that owns a Q6600 Core2Quad CPU.  My experience is that, indeed, while playing games, I probably see no performance increase over 2 cores.  Unless at the same time I am encoding video or audio, downloading something, or a myriad of other things that I do all the time.  With my last CPU, granted it was "only" a Prescott, I had to stop all other tasks, and frequently services, to play a heavy game, or to encode audio, or other high-priority tasks.  With the Q6600, I don't ever have to do that anymore.  My system will hum along, no matter how many things I have going on at once.  And to me, that is the advantage of the 4 cores.  Be realistic, how many things do you have running at the same time?

Also, I have seen many applications utilize more than one core at a time.  Almost all games I play use at least two.  Or more specifically, the ATI video driver uses more than one for itself, effectively offloading much of its performance cost to idle cores.  LAME only uses one, but I can now run up to 4 instances.  Or more to the point, I can rip and encode simultaneously, which gets high-quality CD ripping down to under 3 minutes for me.  And the H.264 video encoder I use pegs all four cores.

If the Q6600 was twice as much as the E6600 was when I bought it, I would have agreed that it was not worth it, but it was only $40 to $50 (~25%) more expensive.  And the G0 series chip only uses a bit more power (90W?), so yes, it is more expensive to run, but Vista S-states minimize that somewhat.  In my opinion, quad core CPUs are a must for the power user today.   While the benefit isn't 2X over a dual core, I believe that one day it will be.  I don't make these statements as a defense of my purchase, I made the purchase because I really believe that it is true.  The main reason I waited to upgrade my system was to delay until Intel dropped the price from the $500+ level to $279 so I could afford to buy one.

I cannot tell you how much Nehalem excites me.  I wish I could afford to get one, but there is no way that I am going to be buying a new mobo and memory any time soon.  I may buy a newer Core2Quad on the 45nm die for power and speed reasons, but the Q6600 is an incredible chip.

Wednesday, May 21, 2008 9:37:06 AM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] -
System
<%--
--%>
Statistics
Total Posts: 186
This Year: 0
This Month: 0
This Week: 0
Comments: 72
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 2010
Frank W Hagen
Sign In
All Content © 2010, Frank W Hagen
Custom DasBlog theme based on 'Business' by Christoph De Baene