Tuesday, January 25, 2005

EMS Professional Software and Specialty Services

Looking for a copy of old software manuals, or the install disks themselves? Check out EMS Old Software Exchange from here.

Also links to shareware, IQ testing, survival publishiing and build-it-yourself reading primer templates.

A golden find, thanks to Dave Bernard via the ProFox list.

Friday, January 21, 2005

Sleep Fox

Put VFP in a minimum resource wait state, but still pay attention to the internal event loop:


PROCEDURE DoSleep
LPARAMETERS tnSeconds
LOCAL lnSeconds
DECLARE Sleep IN WIN32API integer

lnSeconds = SECONDS()
DO WHILE SECONDS() - m.lnSeconds <> m.tnSeconds
    SLEEP(m.tnSeconds*100)
    DOEVENTS
ENDDO
CLEAR DLL SLEEP


Thanks to late night buddy
Garrett who has a recent post on using SourceGear Vault with VFP Project Manager. The single user version is free (as in beer).

Thursday, January 20, 2005

Named References in VFP-SQL

VFP allows us to use named references for fieldnames, tablenames, filenames, etc with its various commands. But, not always with the SQL sub-language...

This works:

REPLACE ALL (crsUpdates.FieldName) ;
    WITH (crsUpdates.NewValue);
    FOR PrimaryKey = (crsUpdates.PK)

but not this:

UPDATE table1;
    SET (crsUpdates.FieldName) = (crsUpdates.NewValue) ;
    WHERE table1.PrimaryKey = (crsUpdates.PK)

or any of these...

UPDATE table1 ;
    SET &crsUpdates..FieldName = (crsUpdates.NewValue) ;
    WHERE table1.PrimaryKey = (crsUpdates.pk)

UPDATE table1 ;
    SET EVALUATE(crsUpdates.FieldName) = (crsUpdates.NewValue) ;
    WHERE table1.PrimaryKey = (crsUpdates.pk)

However, if you hard-code the SET field, it works:

UPDATE table1 ;
    SET MyField = (crsUpdates.NewValue) ;
    WHERE table1.PrimaryKey = (crsUpdates.pk)

I'm sure it's been this way forever -- I've just don't recall running across it before.

Thursday, January 13, 2005

Joel on Software at Crossroads, Tues Jan 18th

Joel on Software Dinner: Bellevue WA Jan 18th

"I'm planning to come to Seattle in January to speak at an Amazon.com developer's conference. While I'm there, I thought it would be fun to meet some readers over dinner, so if you're going to be in the area, I hope you will be able to come!

I suggest we meet at the food court at the Crossroads Mall, at 7:30 PM Tuesday, January 18th, 2005."

Monday, January 10, 2005

Automating Telnet with Expect

As long as Telnet has been around, I was suprised to find that there is no native way to automate it.

I need a process on a Wintel box to access a TSX system remotely and kick off a process. Manually I can Telnet to the box, provide user/pass and then start the process. But when trying to automate the process I find there is no native way to respond to a password prompt from Telnet.

Enter "Expect". Written for *nix in TCL there is a port that runs on Wintel. The documentation is a bit sketchy, but I got it to work.

You can call Expect with -f and provide an input file. The input file for the whole process looks like this:


spawn telnet 1.0.2.24
expect "Logon please:"
send "myusername\r"
expect "Password:"
send "mypassword\r"
expect "32sys>"
set timeout 1000
send "c:\\bin\\myscript\r"
expect "32sys"


The \r is the return control, notice double back-slash for the directory name. The package comes with TCL source and its own version of telnet. The expect "32sys" lines have expect looking for the command line prompt.

Whatever you are calling on the remote side should have limited output, when working with TSX I get a minimum of 2 lines of control characters that look like garbage. Originally the remote process was reporting progress on exporting data... this made for too much information for Expect to ... well, expect.

Wednesday, January 05, 2005

Execscript kicks the Lama's ass

Andrew Ross-MacNeil turned me on to some interesting ideas with EXECSCRIPT at Devcon this year. I've always had a little program to set hot keys to clear my environment , build a project, ala Tom Rettig's CA.prg.

Writing conditional code from execution in a hotkey was always a bit limiting, but with EXECSCRIPT this is no longer true!



ON KEY LABEL f5 EXECSCRIPT ;
( ;
[ CLOSE ALL ] + CHR(10) + ;
[ CLEAR ALL ] + CHR(10) + ;
[ CLEAR ] + CHR(10) + ;
[ SET SYSMENU TO DEFAULT ] + CHR(10) + ;
[ BUILD APP myapp FROM myapp RECOMPILE ] + CHR(10) + ;
[ IF FILE("myapp.err") ] + CHR(10) + ;
[ MODIFY FILE myapp.err NOWAIT ] + CHR(10) + ;
[ ELSE ] + CHR(10) + ;
[ DO myapp ] + CHR(10) + ;
[ ENDIF ] ;
)

Tuesday, January 04, 2005

Visual FoxPro 9 Goes Gold / BetaNews babbles on incoherently...

A weak article with bad information about VFP9 release here.

Some mention of the extended report writer and …
“…FoxPro 9.0… embeds SQL in the FoxPro language, and is more extensible, allowing developers to introduce code that benefits their end user applications.”

How about the *native* SQL syntax has been extended to include virtually unlimited tables, joins, sub-queries and unions; projections, derived tables and enhanced correlation support?

How about new data types, new index types, enhanced data adaptors for cursors and xml?

How about more granular control on how tables are opened, records are refreshed, transactions are implemented?

How about Rushmore enhancements (especially the late breaking improvements to query optimization)?

How about language additions like CAST() and ICASE()?


If you’re gonna try to write an article based on a press release, at least get it fact checked.


Of course, the comments add salt to the wounds…1 Comment on the article entitled "Fox is Dead", then 4 comments on that comment defending the product.

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.

Wednesday, November 24, 2004

Windows Installer Appears Every Time I Start an Application


I've run into this more than once, here is a an "unsupported" work around. Annoyances.org is a repository of such things...

Thanks to Tristan of ProFox.

Tuesday, November 23, 2004

Construx: Construx Estimate

"Construx Estimate contributes to project success by helping improve your software estimation capabilities. Estimate leverages a blend of proven estimation models to predict effort, budget, and schedule for your project based on size estimates. Estimate comes calibrated with industry data, but is most powerful when calibrated with your organization's data.
As part of our mission to advance the art and science of commercial software engineering, we provide Construx Estimate™ version 2.0 free of charge with a limited license."

Construx is the group that Steve McConnell (of Code Complete) runs. Great book, interesting tool. Thanks Boudewijn Lutgerink.

Monday, November 22, 2004

Firefox Extensions

Everybody knows how cool FireFox is... I've been addicted to tabbed browsing since Mozilla first introduced it. FireFox doesn't stop at just the browser... check out the extentions!

First -- if you love tabbed browsing, check out the Tabbrowswer Extentions. Great control over how tabs load and save. You can have all tabs come back up after a crash or even shutdown...

BlogThis! is like the Blogger link you get in the Google Toolbar...

FlashGot lets you pull down multiple files from a webpage in one move...

FoxyTunes lets you control Media Player, WinAmp, REAL, etc from a small controller in the browser status bar...

Oh... and a native behavior for FireFox... if you are on a site that supports RSS feeds, you should see a small orange icon in the bottom right hand corner of the screen. Click on it, and you'll create a bookmark that pulls the RSS feeds. Save the bookmark under the BookMarks ToolBar Folder and when you click on the link, you'll see the last several feeds from the site... too cool!

-dta