22/11/2007

Script To Create Fixed Width Export Stub File

I'm building an export routine in SSIS and I was forced to create a template text file for the Flat File Destination. I'm sure there are more creative was of doing this, but I decided to go quick and dirty and opened my VBA editor and pounded out the following script. It will setup a fixed width (with row delimiter) column based stub for you to export to.

If you need to change the column widths' than do so by modifying the Array's.

Option Explicit

Sub MakeExportStub()
Dim intCnt As Integer ' create an iterator
Dim intInnerCnt As Integer
Dim intInsertChars As Integer
Dim strPrintLine As String
Dim strEndColWidth As String
Dim OutputFile ' create a long int to hold file pointer
Dim strFilePath As String ' create variable to hold file path info
Dim ROOT_PATH As String
Dim strTableName As String
Dim strColumnNames As Variant
Dim intColumnWidths As Variant

strColumnNames = Array("MASTERID", "FIRSTNAME", _
"LASTNAME", "ADDRESS1", _
"ADDRESS2", "ADDRESS3", "CITY", "ZIPPOSTALCODE")
intColumnWidths = Array(255, 200, 200, 255, 255, 255, 255, 20)

strTableName = "ExportStub"
ROOT_PATH = "C:\PATHTOYOURLOCALFOLDERS\"
strFilePath = ROOT_PATH & strTableName & ".txt" ' assign file path
OutputFile = FreeFile ' get the long for a free file

If Dir(strFilePath, vbNormal) <> "" Then Kill (strFilePath) ' if the filepath exists then kill the existing file
Open strFilePath For Output As #OutputFile ' open the output file


For intCnt = 0 To UBound(strColumnNames)
intInsertChars = CInt(intColumnWidths(intCnt)) - Len(CStr(strColumnNames(intCnt)))
For intInnerCnt = 0 To intInsertChars
strEndColWidth = strEndColWidth & " "
Next intInnerCnt
strPrintLine = strPrintLine & CStr(strColumnNames(intCnt)) & strEndColWidth
strEndColWidth = ""
Next intCnt

Print #OutputFile, strPrintLine & vbCrLf
Close #OutputFile ' THERE SHOULD BE ERROR TRAPPING TO ENSURE THIS IS EXECUTED!

End Sub

Over and Out

20/11/2007

Goodbye Joost => Hello Miro

If you don't have the Miro IPTV application you are missing out. I use to think Joost was pretty cool, but I haven't even started it up since downloading Miro.

There are so many super sweet features that I can't even begin to list them.

I can make this hockey fight search into a channel. I can even search YouTube, DailyMotion, Google Video etc. all from within the player, and them have Miro automatically download the video content to my hard disk for viewing on or offline!

For example, Global TV streams several TV shows off their website using these Video RSS feeds:

Who's smarter than a Canadian Fifth Grader
Heroes
Saturday Night Live

I can add all these Video RSS feeds to Miro and then set Miro up to automatically download new videos.

Further, When I get home at night I have my own customized one hour news video feed mashup from sources all over the world: BBC, Global, MSNBC, CBC, TSN, ESPN, Auzzie Sailing and my nerdy tech shows!

I will be writing more on this nifty application but right now I have to get back to work.

You can download Miro here. Do it or miss out.

Over And Out

14/11/2007

Microsoft and Silverlight @ ZuneOriginals.net

OK Microsoft,

When you release a new technology and you promote it as an alternative to Flash please at least make a little attempt to actually use the technology in one of your production web sites. I can't say much of your continued use of Flash in your production web applications. It's frustrating and it's degrading to your developer base. Do you actually think that any developers will jump on board with the technology when you yourselves don't even use it?

If anyone has any insight in to why the https://zuneoriginals.net site is written in Flash please let me know. I would have thought this project was a great candidate to show off what the Silverlight technology can do with a little Zune 2 demo with HD quality streaming video etc. I guess someone at Microsoft wasn't so keen.

Is Silverlight a pipe dream? Will Microsoft even use it in their production implementations? Or is Flash just that much better? You tell me! Would you ever use it?

Over and Out

07/11/2007

PLEASE READ! IT WAS ON GOOD MORNING AMERICA & TODAY SHOW

OK Internet Morons. If one of my friends ever sends this email to me again I think I may seriously lose it. Bill Gates IS NOT PAYING MONEY TO SPAM PEOPLE!!! Bill Gates is a very generous man, but sweet baby J.C., come on people.

I don't know what is worse, the fact that some people are so stupid they actually think Microsoft will pay them out, or that some people are so desperate for cash that they become so stupid. Regardless, it's amazing how money talks - or should I say, how people will do the dumbest things for money.

I enjoy debunking these ridiculous forwared'd emails. I enjoy it when smart people make themselves look so dumb when the prospect of making a couple bucks comes along. I could make a slanderous claim here but I won't.

So for all of those idiot friends of mine, who have just made me aware to either their pitiful financial situation, or to their complete and utter idiocy; Here is your sign:


^
I'm Stupid


Print it out, hang it on your neck, and next time I come across you in a bar I won't offer to buy you a drink, nor will I pry your brain for a shred of original insight. Further, don't forward me junk, and don't forward junk at all. I guarantee you some other moron will just forward it to me and I will see your email in the forwared'd spam mail harvesting list and harass you for it. But the same person to my knowledge sent this out more than once after I busted her for it (but didn't copy me the second time - dah, I got the next forward). What an idiot!

"This isn't real, it wasn't written up in USA Today (other than in articles about Internet hoaxes), Microsoft and AOL aren't running a tracked "e-mail beta test" with Bill Gates paying people for participating, and Intel and AOL aren't merging. The bottom line is that no matter which incarnation of this silliness one receives, the principle is the same: there's still no free lunch, and big companies aren't going to hand out fabulous vacations, $1000 bills, free trendy clothes, new computers, cases of candies, wads of cash, or new cars just because someone with a functioning Internet connection does them the favor of forwarding an e-mail. Though at first blush, participating in such pie-in-the-sky wishfulness appears perfectly harmless, such participation only serves to clog up already overtaxed resources. Oh yes, it does one other thing: it gives the idjits who cooked up these frauds a great big laugh at your expense."

I just don't understand how such a simple Google search couldn't inform these people to this hoax. It has been going on for 10 years!!!

"Opps I just forwarded this e-mail to about 12 people and I've been waiting for my check to come in the mail. The person that e-mailed me said please read cause it was on Good Morning America. I figured if it had been on Good Morning America it must be true. I didn't know thanks for telling me." - here's your sign Stupid
"No offence, but you can't seriously tell me that you think Bill Gates wold pay for spamming."
"Here's a good hint - if it seems to good to be true, it normally is."
''There's a sucker born every minute."
"Jeez, people's stupidity is only matched by their greed."
"I've been dying for years to write one of these things just to get off on knowing that idiots everywhere were passing it on." - here's your sign Stupid
"I don't think most of us know enough people stupid enough to fall for it to make it worthwhile." - I didn't either, but then again, I've got this email so many times I don't even need to read the body any more.
"It is fascinating, isn't it? I've wondered myself, what is that little tic in the brains of people who have this need to get you to pass on chain e-mails? It bugs the heck out of me. I'm not talking about the scams that involve money (which are naturally offensive because they actually cause harm), I'm talking about e-mails like the one Alison mentions here, where they simply want to see you pass it on. Do the people sending the e-mails out need validation in their lives so badly? Does it ease some insecurity if they can get you to do what they say? It reminds me of a child pointing behind you to make your turn around and then singing "Made you look! Made you look!""
Over And Out

Powerset - Powerlabs free Invites Here

If you want an invite to the Powerset Powerlabs beta please leave your email in some sort of obvious encryption below and I will send you an invite.

Also, be warned, sailing in Hurricanes is a ton of work!

Over And Out