Thursday, December 23, 2004

VFP: Change DSN Database on the fly

So I had to do some import work, using both SPT and Remote Views (which means a connection pointed to a DSN). Needed away to easily switch between databases.

It goes a little something like this...


*-- Flavor SERVER, UID and PWD to taste.
*-- Change server name in SetDataBase proc as well
#DEFINE C_CONNECT_SQL "DRIVER=SQL Server;SERVER=MyServer;UID=me;PWD=*;DATABASE="
#DEFINE HKEY_LOCAL_MACHINE -2147483646 && BITSET(0,31)+2
LOCAL lnConn && connection handle for SPT

SetDataBase("LIVE", @lnConn)

* do some stuff to LIVE data

SetDataBase("STAGE", @lnConn)

* do some stuff to STAGE data

*********************************************************
PROCEDURE SetDataBase(tcDatabase, tnConnection)
* Set connection handle to current database
tnConnection=SQLSTRINGCONNECT(C_CONNECT_SQL + m.tcDatabase )
* change DSN to current database
lcRegFile = HOME()+"samples\classes\registry.prg"
SET PROCEDURE TO (m.lcRegFile)
oReg = CREATEOBJECT("Registry")
oReg.SetRegKey("DataBase",m.tcDatabase ,;
"SOFTWARE\ODBC\ODBC.INI\MyServer",;
HKEY_LOCAL_MACHINE)
SET PROCEDURE TO
RETURN m.tnConnection
ENDPROC


sorry about the wrapping... this template isn't very code friendly...

Wednesday, December 22, 2004

100 programmers are lined up in a row by an assassin...

answers to technical interview questions

I was asked this question several months ago when I interviewed for a full-time gig at Microsoft. There were only 10 in the room, and I figured out how to save 6... but the best solution is much simpler than I imagined...

Thanks to John Donaghy for the link!

Monday, December 20, 2004

A Taste of XQuery for the DBA

A Taste of XQuery for the DBA

Eric McMullen has a good article on XPath in SQL 2005. XPath is the way to query XML data sets -- it's been well integrated into the next version of SQL Server.

VFP9 ships!

December 2004 - Letter from the Editor

WoHoo!

Mad props to the team, you guys did an amazing job!

Really large datasets in VFP

FoxPro Advisor :: The Ultimate Power & Speed of VFP


This article has been around for awhile, but it just surfaced in conversation recently. VFP is being used for the "Euro Tunnel". The data requirements for this application include 128 GB of data. Yes, VFP has a 2GB per table limit (not going to change), but this article points out how you can work around this limitation.

Monday, December 13, 2004

New Google trick

Well, new to me. Google Suggests type in a few characters and wait... (or hit the down arrow if you must...)

Friday, December 10, 2004

RF exposure FCC

I need a new cell phone, considering Bluetooth so I can have a wireless headset. Came across this:

"Tests for SAR are conducted using standard operating positions specified by the FCC with the phone transmitting at its highest certified power level in all tested frequency bands. Although the SAR is determined at the highest certified power level, the actual SAR level of the phone while operation can be well below the maximum value. This is because the phone is designed to operate at multiple power levels so as to use only the power required to each the network. In general, the closer you are to a wireless base station antenna, the lower the power output. Before a phone model is available for sale to the public, it must be tested and certified to the FCC that it does not exceed the limit established by the government-adopted requirement for safe exposure. The tests are performed in positions and locations (e.g., at the ear and worn on the body) as required by the FCC for each model. (Body-worn measurements may differ among phone models, depending upon available accessories and FCC requirements). While there may be differences between the SAR levels of various phones and at various positions, they all meet the government requirement for safe exposure.

For body worn operation, to maintain compliance with FCC RF exposure guidelines, use only accessories that contain no metallic components and provide a separation distance of 15mm (0.6 inches) to the body. Use of other accessories may violate FCC RF exposure guidelines and should be avoided."

Boot Camp - Mashing for Beginners

Great tutorial on "Mashing" -- puting two songs on top of each other. Includes Mackie's currently "Free" editor.

Tuesday, December 07, 2004

IBM Sells PC Business for $1.75 Billion

Well, maybe this means the Transnote could make a comeback.