Calculating Distances in Microsoft SQL Server

One feature of almost every modern commercial website is the location finder. Enter in a search address, and site displays the closest locations to it with the distances (as the crow flies).

I ran into a couple of peculiar bugs trying to calculate distances in SQL. Floating point math is never easy, and these are the issues I faced using our Microsoft SQL Server database.

See more ...

Last Updated: Tue, 14 Feb 2017

Perl DBI Issue With iSeries AS400 Returning Null Columns on 64-bit Linux

We’re having an issue with database queries to the iSeries AS400 through Perl using DBI and DBD::ODBC. The issue occurs when the SQL statement contains an outer join and the query returns rows with NULL columns:

my $sql_query = qq|select PRSK01, PSTA15
                    from TESTHA.POLMAST
                    left join TESTHA.P15POLDP
                    on POLC01 = PPOL15 where POLC01 = 003950136|;

# Execute the sql query
my $sth = $dbh->prepare( $sql_query )
                    or die $sql_query, "
\n", $DBI::errstr; my $data = $dbh->selectall_arrayref( $sth, {Columns=>{}}, @sql_data ) or die $sql_query, "
\n", $sth->errstr;

The error returned is:

DBD::ODBC::db selectall_arrayref failed: st_fetch/SQLFetch (long truncated
DBI attribute LongTruncOk not set and/or LongReadLen too small) (SQL-HY000)

See more ...

Last Updated: Wed, 08 Aug 2012

Del.icio.us Complete Firefox Plugin for Firefox 4.x+

I love del.icio.us (or the Yahoo’ed, dummied-down delicious.com) to manage my bookmarks. Unfortunately, the Firefox extension I’m used to using, del.icio.us Complete, is no longer supported, and thus doesn’t work with the latest versions of Firefox.

This is my hacked version of the Delicious Complete extension, which allows it to run in version 4.0 or later. Please note: consider the extension beta software. It works fine for me on Ubuntu and Windows XP, but I haven’t done extensive testing. Please let me know if you have any issues.

Download and Install Del.icio.us Complete

Thanks to verymurklins for providing the original hack for version 3.0

Last Updated: Sat, 24 Mar 2012