Tips and Tricks
A place to store useful info I don't want to lose



Subscribe to "Tips and Tricks" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.
 

 

 

   I really wish more devs would make the switch.

Over the past few days, I've installed a couple of client applications that were clearly written by devs who run as local administrator on their computers. In both cases, these applications wrote to Program FilesApp Name directory. In both cases, they mistakenly thought that "they" owned that directory. And by "they", I mean the guy who wrote the app thinks that they owned that directory, but that's incorrect. In reality, the administrator who installed their application onto a user's computer owns that directory. And once the user tries to run that application, bam! It blows up in their face.

There's a whole bunch of areas on the computer that are off-limits to regular users, and for good reason. Among them are HKLM, Windows, and Program Files. Remember that keys like HKCR really map to HKLMSoftwareClasses. It is really difficult for devs to build software that runs correctly under restricted accounts (like any account that belongs only to the MachineUsers group) unless they themselves run under such an account. So, please ... make the switch!

There's really nothing that I regularly do during development that I cannot accomplish by running under a regular user account. When I occasionally need to do some administrator-like things, I either temporarily create a new administrator command shell via the runas command, or I log out and log back in as admin to perform those tasks (setting ACL's using Explorer is one of those tasks).

[IUnknown.com: John Lam's Weblog on Software Development]

   Sequential I/O performance.

This morning, I was doing some research on sequential I/O performance, and re-read this excellent research paper published by Leonard Chung and Jim Gray at MSR. One of the interesting security-related performance issue raised in this paper can be found in Section 4.4, concerning file pre-allocation:

"When growing a file, it is important to write it in sequential order. Otherwise Windows writes each block twice: once to zero the "gap" and once to write the actual data when the need write finally is issued".

It is necessary to "zero the gap" to prevent reading data that has not been previously written. Otherwise an attacker would be able to extend a file, and attempt to read the data that was there before. Windows prevents this by zeroing out the bytes in the file to guarantee that 0 is returned when reading data that has not been previously written.

The performance gap is quite severe - write throughput drops by 50% due to the need to write the data twice to disk. Writing to the end of a file does not incur this penalty.

[IUnknown.com: John Lam's Weblog on Software Development]

   Living the dual monitor lifestyle.

I loved the SyncMaster 172T so much that I bought another. And once I got my motherboard problems out of the way, I'm happily running a 32MB ATI AIW RADEON and a 64MB ATI RADEON 7000 PCI dual-monitor setup.

One of the really cool features that ATI provides with their drivers is Hydravision support. It lets me run multiple hardware accelerated virtual desktops (up to 9) and I can switch between desktops using their tray icon utility (in theory I can do this using a keystroke but I can't get it to work). The switch is lightning-fast - much faster than the Virtual Desktop Manager utility found in Windows PowerToys. I find that I now use one desktop for email / news stuff, and another desktop for dev stuff (running full VS.NET full screen and debugging a GUI app on another monitor was the main reason I switched to this setup). I suspect I'll use a third desktop for blogging-related stuff.

Since the 172T is a DVI panel, I can report that there isn't much difference between a DVI and a VGA signal input (the RADEON 7000 only has VGA output), but there is a difference. The text is a tiny bit sharper using DVI, and the whites are whiter - I'm having a hard time trying to make the whites match exactly between the two monitors.

[IUnknown.com: John Lam's Weblog on Software Development]


Click here to visit the Radio UserLand website. © Copyright 2003 Eric Hartwell.
Last update: 3/3/2003; 7:12:28 AM.
This theme is based on the SoundWaves (blue) Manila theme.

February 2003
Sun Mon Tue Wed Thu Fri Sat
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28  
Jan   Mar


"Data! data! data!" he cried impatiently. "I can't make bricks without clay."
— Sherlock Holmes to Dr. Watson in "The Adventure of the Copper Beeches" by Arthur Conan Doyle. 


"I like deadlines," cartoonist Scott Adams once said. "I especially like the whooshing sound they make as they fly by."


"There is nothing like that feeling of spending days and days banging your head against a wall trying to solve a programming problem then suddenly finding that one tiny obscure and seemingly unrelated piece of the puzzle that unlocks the solution. Oh yeah!"

- Chris Maunder, CodeProject Newsletter 28 Jan 2002


"Management at eSnipe, which is me, is also feeling the pain of the 2002 bear market. So rather than pout about it, I bought some stuff on eBay that I really didn’t need, but made me feel better."

- Tom Campbell, president of eSnipe