GQLPlus: Oracle SQLPlus on Crack.

It has always bugged me that the Oracle SQLPlus prompt on Windows allowed you to use the up arrow to repeat (and most often used to fix) the previous command but for some reason this functionality is lost with the Linux version.  That is until now.

I started to Google around to see how to turn this functionality on and that when I found the Holy Grail of SQL prompts; GQLPLus.  ”The difference between gqlplus and sqlplus is command-line editing and history, plus table-name and column-name completion.”

After downloading the gzip you can either compile the code your self, which didn’t work for me or just take the easy route and use the pre-complied binary located int he Linux folder of the gzip file.  I copied this binary to the /usr/local/bin folder for easy access.

You can download the source and binaries from the GQLPlus sourceforge page

Gif Stopper :: Chrome Extension

I love a good animated gif and most the time I just view them and move on. But now that I have joined Google Plus, animated gif have turned into an eye sore.  Okay, they’re only annoying when you are trying to read something and there is elephant that keeps bouncing up and down on a trampoline.  So I decided to do something about it.

Introducing my latest Google Chrome extension:  The Gif Stopper.  This will stop an animated gif in its tracks by just pressing the escape key.

Okay, I can’t take total credit for it.  The bread and butter of the extension what written by Johan Sundström and he posted it on userscripts.org.  I just turned it into a Chrome Extension.  The code for the extension including Johan’s code is posted on my github page.

Enjoy.

Google+

Well I broke down and joined another social network, Google Plus.

Come follow me.

How-To: Install KDE’s kate Text Editor in Fedora 15

The Fedora Project has moved the kate text editor (KDE’s version of the Windows application Notepad++ IMHO) to the kdesdk package. So if are like me and really need this application here is how to install it:

# yum install kdesdk

That’s it, now code away.

Get the (Fedora/Ubuntu) Linux Nvidia Driver to Work With a Dell E6420/6520

If you are experiencing issues getting the proprietary Linux Nvidia driver to load on a Dell E6420/E6520 laptop ( I am sure there are other Makes and Models that have have this issue ) then here is your fix:

Go into the BIOS and under the Video section uncheck (disable) the Optimus option.

It doesn’t matter what distribution you are using this will fix it assuming you already have the driver installed properly. If you need help doing that then just use Google to find the correct How-To guide, there are hundreds for each distro.

That’s it, such a simple fix to a frustrating issue.

2010-11 NHL Roster by Birth Location

I was at lunch a few weeks ago at a sports bar with several co-workers and started discussing sports with one of our developers.   Our discussion led to the question about how the NHL consisted of players from so many different countries compared to other US based sports.  When I got back to work I did a couple of Google searches looking to see if someone already had that information for me.  But the search didn’t turn up any results (at least not for this year ).  But it did lead the the NHL.com website that had all the information about the players but it was displayed in a HTML table that span over 30 webpages.  This is where being a programmer pays off.

I decided to write a quick script to parse out this data and place it in an CSV file.  I was going to write it in Python but since I was in Windows I decided to to just use my favorite Windows scripting language, AutoIT.  Below you will find the complete script that I used to loop through the 3o webpages on NHL.com and grab the contents of the 2010-11 players bio table.

#include <Array.au3>
#include <IE.au3>
#include <File.au3>
 
$csvFile = "c:\temp\players.csv"
 
for $i = 1 to 30
 
	$ieObject = _IECreate ("http://www.nhl.com/ice/app?service=page&page=playerstats&fetchKey=20112ALLAASAll&viewName=bios&sort=player.birthCountryAbbrev&pg=" & $i)
 
	$table = _IETableGetCollection ($ieObject, 3)
	$aTableData = _IETableWriteToArray ($table, True)
 
	FileOpen($csvFile, 1);
	For $r = 1 to UBound($aTableData,1) - 1
 
		For $c = 0 to UBound($aTableData,2) - 1
			FileWrite ($csvFile, """" & StringStripWS($aTableData[$r][$c], 3) & """")
			if $c = 18 Then
				FileWrite ($csvFile, @CRLF)
			Else
				FileWrite ($csvFile, ",")
			EndIf
 
		Next
 
	Next
 
Next

Note: This doesn’t do any error checking.

I then imported the data to a MySQL database and ran couple of PHP scripts againts the data to get these results.

Here is the number of players in the NHL broken down by birth country.

Country the NHL players were born in.

AUT: 3 BLR: 3 BRA: 1
BRN: 1 CAN: 482 CHE: 3
CZE: 39 DEU: 10 DNK: 6
FIN: 22 FRA: 1 ITA: 1
JPN: 1 KAZ: 1 LTU: 1
LVA: 4 NOR: 2 POL: 1
RUS: 26 SVK: 12 SVN: 2
SWE: 54 UKR: 4 USA: 211

Another stat that I though would be interesting was to find out what state the US born NHL players came from. So here it is:
State that US born NHL player where born in.

AK: 6 CA: 8 CO: 3
CT: 8 DE: 1 FL: 1
IL: 10 IN: 2 MA: 17
MD: 1 MI: 34 MN: 41
MO: 3 NC: 2 ND: 3
NE: 1 NH: 3 NJ: 4
NY: 33 OH: 2 PA: 14
TX: 1 UT: 1 WA: 2
WI: 10