Let Your Agent Do The Legwork
by Karen Kenworthy
Click Here to see a
21 KB bitmap image of artwork
which goes with this article, entitled:
Just Tell Me When
EVER WISH YOU had a personal assistant? Someone to wash your car, run your errands, handle your correspondence, defrag and back up your hard disk?
Well, you may never be able to have a human assistant, but a software assistant is another matter. It can't wash your car or run errands, but it can perform those boring, time-consuming computer tasks we all hate. You come away with a more reliable and efficient computer, and more time to devote to important tasks, like that monthly report that's always a month behind.
These handy programs, called agents, act on your behalf, performing routine tasks with little or no human intervention. Some sort e-mail; others silently optimize and repair your hard disk. Tomorrow's agents may even videotape your favorite TV shows or order groceries.
To learn more about agents, let's spend some time with the Microsoft System Agent. It's part of Microsoft Plus for Windows 95 (also known as the Plus Pack), an eclectic collection of add-ons for Windows 95.
The Microsoft System Agent, affectionately known as SAGE, is a fancy scheduler a program that runs other programs at specific times or under certain conditions. SAGE can run any Windows or DOS program, including batch files. But it works best when it's controlling programs designed to work with the agent.
Windows 95 comes with two such programs: Disk Defragmenter and ScanDisk for Windows. The Plus Pack adds two more. Microsoft Recompressor performs extra compression if you're using the Plus Pack's DriveSpace 3 compression software, and Low Disk Space Alarm Monitor warns you when the amount of free space on a disk falls below a specified level. Look for other vendors to release SAGE-optimized programs.
Click Here to see a
31 KB bitmap image of artwork
which goes with this article, entitled:
Get Yourself an Agent
Get Yourself an Agent shows SAGE's main window, which appears when you double-click on the SAGE icon. You'll find it in \Windows\Start Menu\Programs\ Accessories\System Tools. The window lists tasks to be performed. The first column describes the task and the second indicates when it's scheduled to run. The remaining columns provide information about the success (or failure) of each program's most recent run.
Adding or changing a task is easy. First select Schedule a New Program or Change Schedule from SAGE's Program menu. You'll then see a dialog like the one shown at the bottom of the sidebar. This window allows you to make five entries:
If the program accepts command-line parameters, you can enter those, too, after the program's name. If you've selected one of the SAGE-optimized programs from the Program drop-down list box, the Settings button is enabled. This button runs the program you're scheduling and allows you to change its settings. These settings will be in effect the next time SAGE runs the program.
For instance, you may want to tell ScanDisk to suppress its summary screen if it finds no errors. That way it won't interrupt you with periodic messages saying there's nothing wrong with your disk right now. To do that, tell SAGE you want to change ScanDisk's schedule, then click the Settings button. When the Scheduled Settings for ScanDisk window appears, click its button labeled Advanced. Finally, click the option button labeled "Only if errors found" in the Display summary option group.
Now that you've told SAGE what to do, tell it when to do it. Start by clicking the When to Run button. You'll then see a dialog with the heading Change schedule of ScanDisk for Windows (see Just Tell Me When). Its Run and Start at option groups give you a range of choices. Together they allow you to specify exactly when, and how often, the program will run.
The Run option group gives you seven choices. If you select Once, the first line of the Start at group changes to allow you to specify the starting hour, minute, month, day and year. If you select Hourly, the Start at group includes an entry that specifies the number of minutes past the hour the program should start.
If you choose Daily, you can specify not only individual days of the week, but the hour and minute of the day. When you select Weekly, SAGE allows you to specify the time of day, and the day of the week, the program will start. Select Monthly to run programs at a particular time of the day and day of the month. If you specify At Startup, the program runs whenever Windows 95 starts.
Finally, the When Idle option tells SAGE to run the program only when your computer isn't doing any other useful work. This option is especially helpful when you're running low-priority tasks that noticeably slow down the computer if they run alongside other tasks.
You may be wondering how you can tell if a computer is idle. After all, even the hardest working among us don't type and flick our mouse constantly. We all take breaks to collect our thoughts or answer the phone. You may not think of your computer as being idle during these little breaks. You usually think of idle time as longer periods of inactivity, such as lunchtime or overnight.
That's why SAGE's designers allow you to specify a time, in the "Wait until I haven't used my computer for X minutes" entry shown in Just Tell Me When." Each time you stop typing and moving your mouse, a countdown begins. Any keystroke or mouse event interrupts the countdown, causing it to start over. But if your computer keyboard and mouse are dormant for the specified amount of time, your computer is pronounced officially idle and any tasks scheduled for the next idle moment begin.
You must specify the idle countdown time if you've asked SAGE to run a task When Idle. But you can also specify the countdown time if you've requested that tasks be run at a set time, such as daily or weekly. In that case, SAGE will start the program at the first idle moment after the specified time.
SAGE also allows you to control what happens to your program if you suddenly start using it while an idle-time program is running. As you can see in "Just Tell Me When," SAGE can stop the program or allow it to keep running. If you ask SAGE to start the program, you can also allow it to resume the program after 10 additional idle minutes.
SAGE does some of its best work at night not because it needs the cover of darkness, but because some of the programs it runs may slow down the computer or interfere with normal operations.
Asking SAGE to run a program at night is simple. But leaving a computer running overnight makes many people uneasy. Some folks wonder if they'll wear out their computers more quickly.
That fear is mostly unwarranted. Monitors have a limited life, and you should turn them off if your computer will be unattended for a long time. But most other components are not adversely affected by running 24 hours a day.
Electronic components, such as RAM and CPU chips, are much more susceptible to damage during the power surges that occur when they're first activated. But once they've run for a few minutes and reach a stable operating temperature, they rarely fail. Mechanical parts, such as fan and hard-disk motors, also suffer their worst wear during the first few moments of operation. During that time, lubrication is not properly distributed, so parts are most susceptible to friction damage.
Running a computer continuously does, however, exacerbate power fluctuations one common computer problem. Power outages and surges can cause your computer to hang or reboot, and can even damage circuits. These can strike at any time, but the more your computer runs the more likely it is to be a victim.
Fortunately, simple, inexpensive solutions to power problems abound. Surge suppressors, which cost just a few dollars, protect your equipment from high-voltage spikes. To protect your system from power outages, install an uninterruptible power supply (UPS). This gadget contains a battery that powers your computer when the local power company fails. For less than $300, you can buy a UPS that can power your computer for 15 to 30 minutes of total blackout.
Be sure to buy a UPS that includes built-in surge suppression. If you don't, you must install a surge suppressor between the UPS and the wall outlet. Installing a surge suppressor between the UPS and the computer will dramatically reduce the time the UPS can keep your computer alive during outages.
That's because the voltage levels a UPS produces are not as perfect as the sine waves electric utilities produce. Instead, they're an approximation of sine waves, with sharp edges that surge suppressors mistake for dangerous sudden voltage changes. In response, an improperly installed surge suppressor absorbs and wastes much of the UPS-generated power. So make sure you do it right, and you'll be able to sleep soundly through the night.
Karen Kenworthy is the author of Visual Basic for Applications, Revealed! (Prima Publishing, 1994). She also manages the WINDOWS Magazine forums on America Online and CompuServe. To find her E-Mail ID Click Here
Click Here to see a
16 KB bitmap image of artwork
which goes with this article, entitled:
It's Easier Than It Sounds
Click Here to see a
20 KB bitmap image of artwork
which goes with this article, entitled:
What an Upgrade!
by John D. Ruley
I'M WRITING THIS column from a half-unpacked home office in Modesto, Calif. My fiance, a physician, just took a job with a busy pediatric practice in Modesto, so we loaded up the car and headed west. I'm telling you this to explain how I came to spend two weeks on the road running NT 4.0 on a notebook system (a Zenith Z-Noteflex 486 with 16MB of RAM).
NT 4.0, as I explained last month, is what you get when you add Microsoft's Windows 95-style "shell preview" to NT 3.51. Space and time didn't permit me to say much more than "it's cool," so this month, I'll expand on that. I'll tell you whether you should try NT 4.0 (definitely), whether you should use it instead of NT 3.51 (maybe) and provide some hints for making life with it a bit easier.
Taking NT 4.0 on the road was risky, but I wanted to spend what computer playtime I had looking at the new shell. Given the notebook's limited hard disk space, I couldn't take both new and old applications. So I took a deep breath and loaded the Microsoft Office 95 preview version. I found only one serious bug (don't try to run Office 95's Shortcut Bar with NT), and had no trouble with it during the two-week trip.
I also made a surprising discovery: Microsoft's talk about how much easier it is to use the new shell isn't just hype. On our second day on the road, my fiance, Kate, realized she forgot a stack of 3-by-5 cards for our wedding invitation list. I talked her into trying Windows' Cardfile applet. She's spent some time in Windows (and is an absolute shark at Minesweeper), but she's always been a little uncomfortable with Program Manager and File Manager. The new shell, particularly the taskbar and Start menu, made an enormous difference. She had an easier time starting and stopping applications and was better able to navigate the file system. I was impressed.
So the new shell is great for users like Kate and for using simple applications like Cardfile and the card game Free Cell.
But that's not all it's good for. My vacation experience told me the new shell is a huge improvement over its predecessor so much so that I don't intend to go back, even though the preview version has its share of bugs. It makes using the system much easier. Take launching an application, for example. Using the old shell, I'd have to find the Program Manager group containing the program's icon and double-click on it. That sounds easy, and it is when you have only a few groups, but I have more than a dozen. Finding the right one can be a real chore. With the new shell, you click on the Start menu's Programs item, and up pops a submenu listing all groups. Click on the group (or just move the mouse over it) and you get a submenu listing programs. Just click on the program to launch it. If you use a program constantly (as I do my word processor), you can add a top-level icon for it to the Start menu, making things even easier.
Once you launch a program, you'll see a button in the taskbar at the bottom of the screen (its default location you can move it if you like). If you multitask, this offers an alternative to Alt+Tab for switching among applications. Just continue to click on the button until you see the application you want. If the application hangs, right-click on its button to bring up a Context menu and select Close.
The Start menu and taskbar alone make the new shell a huge improvement. Add graphical network browsing, a Macintosh trash-can-style Recycle Bin that lets you fish things out (which partly addresses my long-standing complaint about NT's lack of undelete functionality) and synchronizable Briefcase directories for mobile users, and you have a major upgrade.
If you've been wondering whether to try the shell preview, my advice is an unqualified yes. The changes to NT are not just cosmetic they'll also make you more productive. Living in the shell full time, however, is risky.
Microsoft doesn't recommend the current version for production use. I've had good luck with it, but others have reported problems. They range from severe crashes to applications that refuse to work. These include most Windows 95 applications because the new common dialog code they depend on is missing, as well as beta copies of Visual Basic 4.0 (see Programming Windows) and the NT version of Microsoft Systems Diagnostics. I haven't yet heard of it causing a blue-screen, but you never know.
Fortunately, the batch file you use to install the preview can also be used to remove it. So if you try the shell and run into a problem, it doesn't take much to get back to plain vanilla NT 3.51.
I'd better correct something I said last month. You can get Windows 95's WordPad application to run with NT using the preview shell at least, according to several America Online users. But the procedure involves copying several system files from Windows 95 to NT, and I wonder what side effects this might have. Because Office 95 includes a more powerful word processor than WordPad, I've decided not to bother.
Part of my rationale for moving to the West Coast was to be closer to Silicon Valley, home of many computer companies. My first week there Microsoft invited me to a briefing (although it's not based in the valley, it certainly has a presence there).
The company wanted to brief me on SQL Server 6.0 (see What an Upgrade). This is a major upgrade to Microsoft's flagship database. It includes features like replication support, an OLE interface, Structured Query Language (SQL) database functions and a new set of administration tools that Microsoft code-named Starfighter.
What I found most newsworthy were the performance figures. Using SQL Server 6.0 on a four-processor DEC AlphaServer, Microsoft is claiming 2,700 transactions per second on the standard Transaction Processing Council (TPC) "C" benchmark. If that result holds up (like all TPC tests, it has to be audited), it will be the highest performance ever attained by a PC database.
The implications are tremendous. Performance in thousands of transactions per second is the domain of mainframe computers, not of souped-up PCs. And although a four-CPU Alpha isn't exactly a run-of-the-mill server, it costs less than a mainframe.
Before you get too excited, remember NT still lacks a few features generally found in mainframes. The most serious of these missing features is per-user chargeback accounting. Servers in the thousand-transaction class are typically used by thousands of people, and tracking which users are making the heaviest demands on the machine is essential. Until NT offers such capabilities (and other essential features, like redundant clustering and per-user disk quotas), it won't be a serious contender in the mainframe world.
Will Gee, our technical associate, was loose on the Internet hunting Easter eggs and came back with a doozie. To see it, run Control Panel/Desktop, select the 3D Text (OpenGL) screen saver and click on the Setup button. When the 3D Text Setup dialog appears, type I Love NT into the Text field. The results are pretty funny, and Deep Dark tells me those really are the names of Microsoft's key NT developers and testers.
If you're trying out the NT 4.0 shell, I have a tip for you. You can start 16-bit applications, such as Microsoft Mail Remote, in a separate session by editing their taskbar properties. Click on the Start button and select Settings/Taskbar. The Taskbar Properties dialog will appear. Select the Start Menu Programs tab and click on the Advanced button. That will bring up an Explorer view of the Start menu. Find the program you want, right-click on it to bring up its Context menu and then select Properties from that menu. Select the Shortcut tab on the resulting Property sheet, and in the middle of the tab you'll find a Run in Separate Memory Space check box. Fortunately, this process isn't as complicated as it may appear (see It's Easier Than It Sounds ).
This month's book is actually a magazine supplement: Scientific American's The Computer in the 21st Century special issue. It's a thought-provoking preview of tomorrow's computers by Internet inventor Vinton Cerf, MIT media lab director Nicholas Negroponte and vice president Al Gore, among others. At $3.95, it's a bargain.
John D. Ruley is WINDOWS Magazine's editor-at-large and NT columnist. To find his E-Mail ID Click Here
Some folks make their own luck.
By John D. Ruley
Why did my source need to meet me in Reno, I wondered, as I walked past the rows of slot machines in the Flamingo Hilton and almost past him. There he was, Mariners' cap pulled down over his eyes, feeding nickels to a one-armed bandit.
"Cashed in a stock option?" I asked.
He looked up quickly, then back down. "Nah, just a little research." He pulled a dog-eared copy of James Gleick's Chaos from his pocket. "Some people like roulette. For me, it's the slots."
I examined Deep more closely. The characters in Gleick's book used, among other things, a computer built into the sole of a shoe. Deep's moth-eaten Keds looked clean, but I noticed some odd bumps under his cap, and what looked like wires leading to an earphone.
"This is supposed to be a game of chance, Deep," I said, disapprovingly.
"Hey, some of us have to make our own luck," he replied. "Anyway, it's not like I'm cheating just playing the percentages."
"With a little help."
"So? Isn't that what technology's for?"
I couldn't argue with that, so I changed the subject. "I see you guys in the NT group finally wised up and delivered a Windows 95-style shell."
Deep grunted. "Yeah, and it sure took some doing."
"Writing the code?"
"No. We didn't write that code. We got it from the Windows 95 group and recompiled it using Unicode for NT. The tough part was getting permission to release it. We've had people running the shell since last year, but management didn't want us to ship it. They were afraid it would slow up Cairo. You won't believe what we had to do."
"Tell me," I said, clicking on the concealed tape recorder in my pocket.
Deep leaned over and dropped his voice to a whisper. "We snuck the NEWSHELL directory onto the July Microsoft Developers Network CD. The idea was people would get the CD and find the shell. When management found out, we'd say, `Oops, it was all a mistake!' But that didn't work out."
"Yeah, I know. There were rumors about it online more than a month before you shipped the CDs."
"Rumors, my hide," Deep snarled. "We released a few copies for beta test, and one of the testers took it to show his user group. The turkey showed it off to about 50 people. They liked it so much, management finally gave us the go-ahead."
"So what's the next step?" I asked.
"We have to finish a couple pieces like the new common dialog code and add support for stuff like compression. Then we can do an update for people trying the preview. For a full-up new version, we need to add some other features like Unimodem support. If we're lucky ..."
Deep was interrupted by a jingling sound as the slot machine dumped nickels all over the floor. He looked up, wire protruding from his electronic baseball cap. "As I was saying, if we're lucky, we should be able to ship next spring."
I clicked off the recorder and walked away, thinking some people make their own luck.
Three Cheers For the Revolution
Click Here to see a
23 KB bitmap image of artwork
which goes with this article, entitled:
The Software Pyramid
by Martin Heller
BROTHERS AND SISTERS, a revolution is in the making, and it's being hastened by Visual Basic 4.0. Its cause is so just, I was compelled to cast aside the new shell preview of Windows NT 3.51.
In the beginning, I was quite excited about this NT preview. This is the Windows 95-style interface we've been asking for since the summer of 1994. Unfortunately, after trying it, I had to revert to the standard Windows NT interface. Although the shell preview looked great, it had bugs. And no matter how much I like the new interface, I use a computer for applications not for the system and critical applications and tools just didn't work right with the new shell. (John Ruley, on the other hand, loved it. See the NT column in this issue.)
A beta 32-bit version of Visual Basic (VB) 4.0 was one tool that had trouble with the new shell preview. This new version of VB 4.0 is so revolutionary, I decided I'd sooner ditch the new shell than give it up. VB 4.0 not only makes OLE controls useful, it also makes creating OLE automation and in-process servers much easier. Let me put this product in perspective.
I'll start with the short summary for you VB mavens. With one major exception, all the enhancements you wished for are in VB 4.0. The exception is native compiled code. VB still generates threaded p-code. Both 16- and 32-bit flavors come in a single package, and the enhanced language allows for conditional compilation. VB 4.0 now uses the Visual Basic, Applications Edition (VBA) 2.0 language engine, which is backward-compatible with VB 3.0 and the VBA 1.0 engine shipped in Excel 5.0 and Project 4.0. It also makes it easier to program OLE automation objects.
The 16-bit VB 4.0 environment supports both OLE and VBX controls; the 32-bit version supports only OLE controls (simply because 32-bit VBX controls don't exist). VB 4.0 automatically converts your old applications to use OLE if you wish, at least for controls shipped with VB.
The transition to the OLE control has provided what we might euphemistically call an opportunity. Third-party vendors have made a good business of selling VBX controls over the past few years, and most VB developers have no firm timetable for upgrading to VB 4.0. Microsoft has been pushing these vendors to switch to OLE controls for more than a year. Now, they have a market for them.
In an ideal world, a vendor would decide when to switch from VBX to OLE controls, and that vendor would never have to look back. In the real world, users will demand enhancements to VBX controls. No matter how compelling the reason for upgrading to a new technology, there are always users who resist change.
One prominent vendor, Sheridan Software Systems (516-753-0985), took an innovative approach to the VBX/OLE control problem, which it dubbed Sheridan Reusable Components. By reimplementing the base functionality OLE controls use in its own support library, Sheridan produced VBX controls from the same code base used to create OLE controls. The innovation may not deserve all the hype Sheridan wants for it, but it's a clean way to proceed. The first product to use this technology is Calendar Widgets, which will be followed quickly by Designer Widgets 2.0.
Sheridan isn't the only vendor trying to score in the OLE control game. Judging by trade-show demonstrations and by the controls shipped with VB 4.0, most major VBX vendors have stayed in the loop, whatever the cost of development time.
Using OLE controls is only part of the OLE picture for VB 4.0. You can now build OLE automation objects with VB, both standalone executable and in-process servers (DLLs). This means you can build components with VB, not just use components. That, my friends, represents a dramatic change in the big picture.
The Windows software development world, like many things, has formed a pyramid. System developers, who sit at the top of the tier, write in assembly language or in C. Some say C has all the disadvantages of assembly language. Component developers write primarily in C or C++, although partisans of Pascal, Ada, Modula, Forth and LISP still flourish in specialized communities. Application developers write in one of those languages, in Visual Basic, PowerBuilder, Xbase, or some other language or database package (Clarion, Paradox, Rbase and so on). Integrators and power users write macros and scripts, primarily by pointing and clicking, and sometimes the macros are in VBA.
VB 4.0 will soon change this scheme. VB used to be primarily for the third tier, but it now serves the second through fourth tiers. It serves the second tier by allowing component development, and it serves the fourth by its compatibility with embedded VBA.
That's a compelling story, but it ignores the alternatives. The most promising alternative is Borland Delphi, an enhanced, visual, object-oriented Pascal with great database support and fast native compiled code.
I have to believe somewhere in darkest Scotts Valley a Borland team is hard at work on a 32-bit Delphi with beefed-up OLE component development tools unless Borland's much-publicized business slide has driven all its competent developers elsewhere, which I doubt.
The enlarged scope for VB is clearly an encroachment into what used to be C and C++ territory. That's not to say C and C++ developers are an endangered species. Competition is not necessarily fatal. But perhaps our ecological niche is changing.
For instance, one big criticism C programmers used to level at VB was that it was difficult to use in a team project. It just didn't integrate well with source code control systems. VB 4.0 fixes that. All versions support an open interface for add-ins, including source code control. And the VB Enterprise Edition comes with Microsoft SourceSafe, which seems to be a usable, visual, network-aware, project-oriented source code control system.
VB? In large teams? What's the meaning of all this? The short answer is Microsoft wants you to adopt its grandiose three-tiered enterprise software strategy, in which applications depend on user services (roughly analogous to the traditional client), business services (a "new" category embodying business rules and the like) and data services (roughly analogous to the traditional server). I have a hard time keeping a straight face when I hear Microsoft product managers explain how they understand the needs of large corporations. I've seen raw fear and unabashed hatred in IS managers' eyes at the mere mention of Microsoft. On the other hand, Microsoft does have a good story to tell.
It's an even better story when you realize VB 4.0 not only supports OLE components, it allows the components to run remotely. The VB 4.0 Enterprise Edition includes everything you need to write applications that run distributed across a network.
If that's not enough, how about full support for enterprise SQL databases with SQL pass-through? How about a native database engine with programmable security and relations, plus cascading updates and deletes? I won't say Microsoft has gone mainstream with its database stuff, but it's actually talking in terms of DDL and DML. This is scary. Some of the database technology in VB 4.0, such as Rushmore query optimization, was obviously cross-fertilized with FoxBASE. Yet other parts of it would make a mainframe DB2 programmer feel almost at home.
Martin Heller is a revolutionary at heart. Brothers and sisters can reach him at mheller@cmp.com.