Thursday, June 25, 2009

Using SourceGear DiffMerge as the Difference/Merge viewer in SourceSafe 2005

Paul Roub’s blog entry

Visual SourceSafe 2005 is located on the Visual Studio 2005 installation media… and yes it does work with Visual Studio 2008 (which does not include it on the installation media).

Wednesday, June 24, 2009

SQL Split AWK Script

Split the output from SQL Server Management Studio (SSMS) > View > Object Explorer Details > “Script {function|view|procedure} as” into individual files

Note: The current RegEx’s are tailored around the following scripting options (see comments to change):

  • “Include descriptive headers” = true  (this is the default after SSMS 2008 install) – located under:  SSMS > Tools > Options > SQL Server Object Explorer > Scripting > General scripting options)
  • “Schema qualify object names” =  false (NOT the default) - under: … > Object scripting options

Download GAWK.exe for Windows: link1, link2

# example: gawk -f sqlsplit.awk file-to-split.sql

BEGIN {
outfile = "erase_me.sql" #start off with a dummy file to get the ball rolling
IGNORECASE = 1
}

END {
#close off last file
print "grant "grant" on "arr[1]" to public\ngo\n" >>outfile
close(outfile)
}

/\/***** Object:/ {
#upon matcing the "object" comment, close off the previous output file
print "grant "grant" on "arr[1]" to public\ngo\n" >>outfile
close(outfile)

#start up the new one
match($0, /\[(.*)\]/, arr) #change to something like /\[dbo\]\.\[(.*)\]/ if you want “Schema qualify object names” enabled
outfile = arr[1]".sql"
print "--$Author:$\n--$Date:$\n--$Modtime:$\n--$History:$\n" > outfile
}

/^(create) +(proc|function|view)/ {

grant = "execute"
if ($2 == "view") grant = "select"

printf "if not exists(select 1 from sysobjects where name = '"arr[1]"')\n\texec('create "$2" "arr[1] >>outfile

# function is a little trickier because it could be a table or scalar return type requiring slightly different create function signature
if ($2 == "function") {

lines = ""
while((getline line) >0) {
lines = lines line"\n"
match(line, /returns/, a)
if (a[0] != "returns") { continue }

#debug: printf "line = %s, a[0] = %s, a[1] = %s, a[2] = %s, a[3] = %s\n", line, a[0], a[1], a[2], a[3]

match(line, /table/, a)
if (a[0] == "table") {
grant = "select"
print "() returns table as return select 1 as one')" >>outfile }
else print "() returns int begin return 0 end')" >>outfile
break

}
}

#proc/view
else {
print " as select 1 as one')" >>outfile
}

print "GO" >>outfile

sub(/create/, "alter") #change the create to alter
sub(/$/, lines) #tack back on the lines "eaten" to figure out whether function was tabular or scalar
}


{
print >>outfile
}

Monday, June 22, 2009

Unprotect MS Word Document

  • Here’s the gist – fire up Word, open your file, then select Tools > Macro > “Microsoft Script Editor”, you’ll get an HTML view, search for “UnprotectPassword” and change it to all zero’s – voila!
  • I had to un-check IE > Tools > Internet Options > Advanced > Disable Script Debugging (other) to get the MSE menu item in MS Word enabled.
  • MSE exe location on my system (Office 2003) -  C:\Program Files\Microsoft Office\OFFICE11\MSE7.exe

Thursday, June 18, 2009

Portable Media Players

Western Digital (WDAVN00BN)

mainimage

Highlights:

  • $100 street
  • HDMI & Component
  • only 4” x 4” x 1.6”, 0.67 lbs
  • carry case doesn’t come with but looks pretty slick

 

IOGear (GMD2025U120)

Highlights:

  • $120 street w/120GB drive
  • HD is definitely upgradeable (2.5”)
  • “only” component and composite, no HDMI

 

Cirago (CMC1000)

image image

Highlights:

Saturday, June 13, 2009

GPS Receivers

Garmin GPS Models

Here’s the main page for the receiver only products (so called “OEM”)

10x (BlueTooth) - this is the one Andrew and I have

  • I finally got it to work well with my WinXP BlueTooth stack by turning off “AUTO CONNECT” checkbox buried under the BlueTooth virtual serial port properties
  • Andrew has always said it works well with his HP WinCE based hand held
  • Runs on a rechargeable battery so you do have to tether it (with included USB cable) every once in a while to recharge
  • Garmin also included the cigarette lighter power adapter in my package… Pretty sure I wound up with two of these due to a screwed up initial shipment so I have a spare in case you don’t wind up with one… cigarette lighter to mini-usb is kindof a handy thingy to have in general these days… would charge other USB power based stuff like MP3 players etc.
  • $107 retail
  • Garmin GPS 10x Receiver for mobile devices
  • The annoying thing is I managed to find an actual Garmin.com link where it was posted as $50… BUT I DIDN’T SAVE THE DANG LINK <ARG!>
  • Cheapest new street price I’ve seen is around $80 (from reputable vendors like TheNerds.net, etc)
  • eBay has a refurb for $50 at the moment

I still wonder if USB might be slightly easier to deal with than waiting for BlueTooth to connect, especially if you’re primarily using in a static environment like a car and it avoids the rechargeable battery dance so here’s a couple of those…

20x (USB)

  • $70 retail
  • this seems to be the one Garmin “recommends” for their PC oriented mapping products

18x (USB)

  • $85 retail
  • says it’s magnetic to hold onto your dash or something

Mapping Software

Maps

Wednesday, May 27, 2009

Very interesting (old) BBC series by James Burke - tracks the thread of inventions underlying our specialized society

http://www.youtube.com/results?search_type=&search_query=james+burke&aq=f

I’ve watched episodes 1-4 so far… 4 is a pretty good one

Simply starting at the beginning seems good too

Make sure you take advantage of the preconfigured playlists -- look for “(play all)” -- so they queue up and you can watch them straight through w/o having to continually find the next one -- which really takes away from the enjoyment after a while

Search for “james burke episode xxx” to dial in on each bundle if you’re not seeing it from the URL I gave above… there appear to be at least up to 20 episodes

(btw: My buddy Joel turned me on to it… he’s full of nifty idears… here’s a gratuitous plug for his vlog site: http://joelart.blip.tv/)

Friday, May 22, 2009

My Pick for USB to SATA/IDE (2.5”/3.5”) Adaptor

Highlights:

  • Sabrent Brand, Model: USB-DSC5 - $20
  • 2A Power Supply.  I read that at least one other brand, KingWin maybe, only had a 100mA! feed… and that guy was finding that it wasn’t enough juice for a 3.5”er
  • All the cables/adapters you need… SATA power, SATA Data, gee wonder what that real small one 2nd from the left is for??
  • Normal 3 prong PC style power cable… other brands had the fairly standard 2 prong laptop cable which you might find preferable… I live in Germany and it’s easier for me to find the German style wall plug with the 3 prong cables.

As an aside, I’m swinging back to TigerDirect rather than NewEgg for a while… Tiger really screwed some things up for me at their local stores in Chicago so i was carrying a grudge… but i tend to think their mailorder business has always been decent… NewEgg really jacks you on the APO shipping… i’m such a fickle filly.

(NewEgg does tend to have better product images though, so this links to Tiger but image was pulled from NewEgg :)

image

This “Newer Technology” model looks a little “slicker” but is it really worth $10 more?

image