Just received a Google Analytics invitation code. Analytics now replaces AWstats on The Weblog of Titus Barik as the primary web statistics package. In my opinion, Google thus far has had a mixed bag of product rollouts, so I’m curious to see what Analytics will bring to the table.
There’s also a Google Analytics WordPress Plugin by Matt Labrum, though it isn’t particularly sophisticated. To be fair, it probably doesn’t need to be.
The Amazon Associates Central “build links” feature is cumbersome to use. Fortunately, Amazon supports a simpler and cleaner link format, though it is not well advertised on the Amazon homepage. To use, create a URL like the following:
number is the ISBN or ASIN identifier, and
id is your user affiliate ID. Thus, a link for the book The C Programming Language would transform into:
You can use Eli’s Amazon Link Generator to quickly generate URLs of this form, along with image information. If you’re of the programming sort, take a look at the Services_Amazon package for PHP.
RecordCount is not supported with the default forward-only cursor. The use of RecordCount requires either the use of static or keyset server-side cursors. By default, all records are opened server-side, with
adOpenForwardOnly. The easiest way to change this is to explicitly create a RecordSet object:
rs.Open strSQL, objConn, adOpenStatic, adLockReadOnly
Here, we use
adLockReadOnly. However, for larger data sets, there are superior alternatives to RecordCount; these are presented at the adOpenStatic.com web site. This limitation is also documented on MSDN, though information on ADO RecordCount is harder to find there.
Considering that Microsoft can’t even program Notepad without bugs, it’s no surprise that the rest of the Microsoft product line is as buggy as it is:
- Open up Notepad (not Wordpad, not Word or any other word processor)
- Type in this sentence exactly (without quotes): “this app can break”
- Save the file to your hard drive.
- Close Notepad
- Open the saved file by double clicking it.
Found on WinCustomize. It looks to be a UTF-16 bug of some sort, and there’s more information on it at Aftermarket Pipes.
If you have installed a 32-bit ODBC driver on Microsoft Windows x64, such as psqlODBC, you will find that 32-bit ODBC drivers do not appear in the ODBC Data Source Administrator. To resolve this issue, use
instead of the default program in
system32. This will show all installed 32-bit ODBC drivers. At this point you can use your DSN as you would with any other system.
Given a single table, swapping two columns within that table is quite easy:
SET a = b, b = a;
If instead, we want to swap one field between two rows, for example, the priority of two rows in a prioritized list implemented in the database, the query requires some algebraic tricks:
UPDATE table SET
priority = A + ABS(priority - B)
WHERE priority in (A , B);
where A and B are integer constants such that A < B. This is an interesting interview problem, primarily because the first instinct is to use a
CASE WHEN statement. This problem also arises commonly in many database applications, such as shopping carts and queues.