« July 2005 | Main | September 2005 »

August 30, 2005

Quicken 2006 upgrade continues trend of mostly reliable data management.

In what seems to have become an annual event, my latest upgrade to Quicken 2006 once again demonstrated the imperfect reliability of the programs data management functions.

Prior to the upgrade, I’ve seen cases of credit card accounts that required balance adjustment transactions where none should have been needed. I just don’t have the patience anymore to track down where the error originated. My experience has been that while it used to occasionally be my fault, back before downloaded transactions became available from most credit card issuers; it’s now most likely a bug in Quicken.

Following the upgrade to Quicken 2006, I once again ran “Super Validation” by holding control+shift down while selecting FileàFile OperationsàValidate. This turned up 8 records that “weren’t in my register” and were deleted.

But it didn’t fix the problem I was having with zombie scheduled transactions that were in my scheduled transactions list in Quicken but which my financial institution disowned knowing anything about (OL-359-A errors). After pushing my way past the brush-off attempt from Quicken online chat tech support, I learned this trick: Hold control down while selecting delete in the scheduled transactions list to delete it unilaterally. Warning! Doing so for a transaction that is still active at your financial institution will leave you with no easy way to delete their record of the transaction. You’ll have to call them to get it straightened out.

 

Ware Brothers Networked Irrigation Controller

After loosing the LCD display on my old sprinkler system controller, I decided to go with a networked replacement.

The Ware Brothers 1016 Controller was completely painless to install. My old system used a master valve and 11 zone valves. Configuring the system to turn the master valve on in conjunction with one or more zone valves was simple.

Three things could be improved in the quick start documentation:

1.      The “power” switch on top of the unit must be switched left to use default startup parameters and switched right to use configured startup parameters.

2.      When entering the initial IP address on the System setup page, it wasn’t immediately clear that I could type over what appears to be static text to change the IP address (must click Save).

3.      Only devices 1 through 9 can be used in conjunction with other devices. I had to swap my master valve with my zone 1 after wiring things up for the first time.

Here are some pictures of the unit.

 

 

 

 

 

 

August 28, 2005

Automating Word, Add-In vs. Template

At its simplest, the problem is to run some code when CTRL-ALT-A is pressed while editing a Microsoft Word 2003 file.

The code that runs wants to be written in C# and it’s purpose is to modify the content and styles of the current document.

In my first solution, I created a Word Add-In (using Visual Studio Tools for Office) and Visual Studio 2003. The Add-In has to register its DLL under the right Office keys to be found by Word. When Word starts, the assembly’s Connect method gets called. It proceeds to install a new toolbar into Word containing a few buttons. It’s easy to connect the Click event of the buttons with the C# code I want to run. Getting the code to run in response to a CTRL-ALT-A is considerably harder.

The first trick was to discover that a macro of the form below will invoke the C# event handler assigned to a toolbar button:

Sub TonesNotesNew()

    Dim cb As CommandBar

    Set cb = Application.CommandBars("TonesNotes")

    Dim cbc As CommandBarButton

    Set cbc = cb.FindControl(Tag:="New")

    cbc.Execute

    cbc.State = msoButtonUp

End Sub

The last piece of plumbing is to assign CTRL-ALT-A to invoke the macro “TonesNotesNew”.

The second time around I implemented the same functionality as a Word template file which is one of the new Visual Studio 2005 beta 2 project templates. The template file now holds the macros, the styles I use for this functionality, and the C# assembly that does the actual work.

 

 

August 26, 2005

Managing Part Libraries With Linked Blocks

I use Rhino3D for mechanical and architectural design work. In general, it’s a very good match for my needs in both power and complexity. Lot’s of power without too much complexity.

Figuring out how to manage part libraries was one area where the documentation and the interface terminology did its best to confuse and muddy the basic functionality.

Here’s how you to create a model of a component that will be re-used, use it in a couple of other designs, and automatically update it in those designs if you make changes to the original model:

1.      Create the component model in its own Rhino document.

2.      In a new Rhino document, choose FileàInsert

3.      Click File… and browse to the component document. Click OK.

4.      Finish with the Insert dialog, setting or defaulting position, and rotation as you like, but leave “Insert as” set to “Block instance”.

That’s it. Don’t get confused by creating blocks yourself (using the Block command) or by the Import command.

To make changes to the component just edit the model in the original file in the normal way and save it. Don’t move the file or change the file name to avoid breaking the link with designs that use the component.

To update a design to use the latest version of a component:

1.      Click EditàBlocksàBlock Manager…

2.      Find the name of the file that defines the component in the list of Block Definitions. You should see the file name as the block name and the complete file path in the “Link File Name” column.

3.      Click Update.

 

So it’s clear that managing part libraries uses blocks indirectly which might get you wondering when would you want to directly create your own blocks and when is it a good idea to put more than one block in a file? Knowing the answer to these questions will keep you from getting wrapped around the axle on part library management.

Create your own blocks directly whenever you expect to have copies of identical geometry. Just use the Block command to turn selected objects into a block definition within your current file. The selected objects are replaced by the first instance of the new block. You can now insert additional instances of the block using the Insert command.

There are two general approaches to making changes to a block you create directly. The quick in-place method and the long-term re-use method.

Quick in-place method for modifying an unlinked (directly created) block:

1.      Select one of the block instances.

2.      Inverse hide everything else.

3.      Explode the block. This turns it back into the object from which it was defined.

4.      Edit the objects normally.

5.      Select the modified objects.

6.      Invoke the Block command (EditàBlocksàCreate Block Definition…) and give it the same name it had before (IMPORTANT).

7.      Click OK and OK to replace existing definition.

Unhide all and you should see all instance of the block updated. Note: If you don’t select the original block base point, every other instance will move.

Long-term re-use method for modifying unlinked (directly created) blocks:

The basic idea is to export the block definition to external file. Then redefine the block definition using the external file to create a linked block situation. Changes to the external file can then be propagated to your original file using the BlockManager’s Update command.

1.      Find the block’s definition in the BlockManager and click Export. Don’t change the file’s name. You can put it in any folder.

2.      Insert the file you just saved, click yes to replace the block definition, insert the new block instance anywhere and immediately delete it.

The result of these two steps is that the block definition is now linked to the external file. Make your changes there, save it, and update the original as needed.

 

August 23, 2005

LoaderLock MDA warning in VS 2005 beta 2

After making some fairly innocuous changes, I started getting the following error dialog during application startup running within the VisualStudio 2005 beta 2 IDE:

LoaderLock was detected

Message: Attempting managed execution inside OS Loader lock. Do not attempt to run managed code inside a DllMain or image initialization function.

See C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\sdk\bin\mdaBoilerplate.exe.mda.config for documentation.

 

Commenting out the code executing at the time of the exception moved it to a new location in the startup code.

I tested the same code built on a second PC with similar general configuration (but obviously many minor differences) and the problem did not occur.

So I followed the instructions in the MSDN help article referenced by the error dialog…

Added this key:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework]

"MDA"="0"

Following this article:

ms-help://MS.VSCC.v80/MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_fxdebug/html/76994ee6-9fa9-4059-b813-26578d24427c.htm

This masks the problem. I don’t know if it was a bug in the detection code or a bug in the initialization code that just happens to skate by if ignored. I suspect the later.

A bit scary.

 

 

Amazing post on startup & shutdown

August 22, 2005

How to convert a hex string to an integer

The MSDN page that tries to answer this question is an absolutely horrible example of how a compact and simple piece of information can be made almost impossible to understand: How to use the Int32.Parse method to convert the string representation of a hexadecimal integer to a decimal integer by using Visual C# .NET

Here is what it should have said:

To convert a hexadecimal string to an integer:

string s = "a0"; // 160 in hexadecimal

int i = int.Parse(s, System.Globalization.NumberStyles.AllowHexSpecifier);

 

NOTE: If the string includes the standard "0x" prefix, a System.FormatException will occur.

 

August 21, 2005

Samsung i730 Evaluation

There are plenty of pictures already out there about Verizon’s current coolest PocketPC phone. Here’s my experience after four days with the phone.

Generally the device works, but the many small annoyances are a continual time drain to live with or work around.

Mechanically the phone is of pleasantly high quality with a few exceptions:

·        The slide mechanism that connects the keyboard with the display has an annoying amount of side to side play.

·        The voice memo button is located right above the volume+ button with almost no tactile cues to differentiate them.

·        The little rubber plugs that hide screws tend to come loose and disappear.

Call quality seems to suffer from the placement of the microphone. I’ve gotten generally negative comments from the people I call. Much of my calling occurs in one bar coverage areas.

The coolest thing by far is how easily I was able to fire up Visual Studio 2005 beta 2 and build and deploy a .NET Compact Framework based application to the phone doing full internet access.

There are however a great many annoyances:

1.      WirelessSync doesn’t seem to be configurable at the folder level. E-mail that never bothered me because I have rules which shunt it off to logging folders caused pop-up notifications with sound effects. If I disable the notification, I lose all e-mail notification. I worked around this problem by moving the logging folders out from under Inbox.

2.      Junk mail that I never see in my desktop Inbox seems to avoid the rule engine sometimes and winds up on the phone, where it seems to persist indefinitely. No work around exists for this. So e-mail notification has to be turned off.

3.      There’s an enable/disable ActiveSync on the WirelessSyncàSetupàActiveSync Setup form that took a while to find and completely prevented ActiveSync from connecting at first.

4.      There’s a general lack of consistency across the user interfaces which makes it hard to locate appropriate settings. Like where do you go to keep the backlight on after dialing a phone call that requires entering a password? Backlight, Phone, or Power?

5.      The remote control application won’t let you re-learn a button, or delete and re-add a button, or even just add new buttons to an existing layout. You also can’t change labels or device names. It’s a very limited toy application.

6.      Can’t run maps.google.com on either Picsel browser or IE Portable in Windows Mobile 2003. Not that much of a surprise since Java applets are no doubt not supported. But for some reason, some sites, like Flikr.com, can’t be browsed by Picsel. Though IE did work on the site. For some reason the requests get routed to a generic Yahoo picture services page.

7.      Trying to install Microsoft Reader for Pocket PC version 2.4 took much too long to get working. I bought a single title from amazon.com, downloaded it and placed it in my active sync pocket pc files folder. It seems to have gotten all wrapped up around the initial configuration of reader, possibly a switch from wi-fi to USB connection to ActiveSync. First ActiveSync failed with errors. Then it would not connect. Now it reports “2 items not synchronized” and still it spins. How long does it take to transfer less than a MB over USB 2.0? Minutes later the sync fails.
Leaving the system in its cradle overnight, then pressing the reset button for 30 seconds in the morning seems to have restored syncing and not cleared my Outlook data or installed programs. ActiveSync 4.0 seems to have issues with Wi-Fi.

8.      Using Microsoft Reader on a 240x320 screen is generally annoying. There’s so little text per-page that you’re constantly tapping next page. So far, it makes it hard to stay in the flow of the story.

9.      SafeStore seems under documented. I’m guessing it’s a bit of flash memory built in, as opposed to RAM which isn’t safe. And as I found out in #12, it holds all user settings in addition to having a little space left over for backups, saving notes, or anything else that you might normally put on an SD card.

10.  Why can’t I add my password to my voicemail speed dial to get one button access to my messages? You can create a new number under a contact with two commas between your mobile number and the password plus sharp sign. Assign it to a speed dial other than “1”. The same trick doesn’t work for the hard coded voicemail speed dial.

11.  Why does the touch pad interface go away in phone mode? It gets replaced by a single graphic telling you to use the numeric key pad. But you also lose access to “call history” and “speed dial” buttons, forcing you to close the slider if you wanted these options, then reopen it if you want to type again… Of course you can’t do that if you’ve elected to have closing the keyboard terminate the call.

12.  Somehow I got into a mode after I place a call such that where it says “Verizon Wireless” (above the phone number display area) gets replaced by the words “Emergency call only” and an Exit button. What’s with that? So I find a “Reset All Phone Settings” button within the phone options dialog. It requires a password. After a few guesses it turns out to be the last four of my mobile phone number. Sure go for it. “Reformating SafeStore…” What? What does that have to do with phone settings…. Unless it’s the same flash memory used for all persistent device settings. And when the interface says “phone settings” they really mean “device settings”… After a quick wireless sync, mostly back to where I was. And remarkably the “Emergency call only” behavior is gone… Speed dial settings are gone. As are all user setting changes.

13.  Started out thinking I had to use “Files” synchronization in ActiveSync to move data files onto the device. After finding the “explore” function and seeing that I can drill down into the file system on the device by starting at My Computer, it becomes clear that “Files” synchronization is more about synching files modified during offline access. Why is it that it wants to make the root of the shared files “T My Documents” when I renamed my device from “Pocket_PC” to something else that only starts with a “T”.

14.  Well trying to copy and paste this word document between my desktop and \My Documents\Personal on my Pocket PC caused Windows Explorer to crash on my PC and has wiped out all the folders besides Templates on the Pocket PC. Wahoo. This happened consistently over three attempts. “Simple” word files work fine. This one includes some office automation stuff that may be responsible for the crashes. Whatever it is, the ActiveSync conversion process chokes on it.

15.  On the likelihood of the Samsung i730 being upgraded to Windows Mobile 2005: The senior sales associate at my local Verizon store summed it up simply: “The phones have what they have, they don’t tend to get upgraded. We come out with a new phone instead.”

16.  After resetting the phone, the pairing with my Jabra 250 headset was lost. Pressing the main button on the headset brings up the “enter pass key” form, but no passkey I’ve tried (0000, 1234, last four of phone) succeed in registering the device. No errors are displayed either. It turns out you have to hold the power on the headset for 6 seconds to a steady blue light, then start on the phone under the Bluetooth devices interface. Click on New… and have the phone try to find the headset. Doing it any other way seems like it should work, but it doesn’t.

17.  Voice recognition using a Jabra 250v headset in a Honda CRV at highway speeds is very unreliable. Too much background noise it seems. Voice recognition in quite conditions is fine. Signal strength between the headset and phone isn’t good enough to walk around a room without carrying the phone. The volume of the voice recognition prompts is often much too soft. It’s volume is probably a combination of the headset volume with one of the two independent volume settings for the i730. With all three at their highest setting, the prompts are still soft in the car.

18.  Despite setting the backlight settings to aggressively favor being on, I’m constantly frustrated by the display being dark and not responding to screen taps. It typically takes the press of one of the main action buttons to re-illuminate the backlight. Very annoying when on a call and being asked to “press 2 for…”. The keyboard does work in these situations but getting it out is often not the most convenient thing to do.

19.  There’s no easy indication of remaining battery life or of new voice mails. Battery level can be seen by pressing the launcher button and looking at its toolbar. The voicemail icon gets lost in a small balloon icon that must be manually expanded to see a number of icons that don’t fit on the small screen.

20.  Unlike every cell phone I’ve owned, it is not a substitute for a watch. Much too hard to quickly tell what time it is. Have to press the phone’s talk button to bring up the phone interface. There’s a tiny clock in the upper right corner. To see the date you have to press the main “back” button (not to be confused with all the other back buttons which are specific to individual programs) to get to the Today screen, for which there isn’t a hard button.

21.  Muting the microphone during a phone call requires a very careful screen press with your finger or stylus.

22.  The various “Today” themes also control the darkness of horizontal stripes that appear on the messaging interface. Some themes produce stripes that are so dark they make the text impossible to read on the right side of the screen. There doesn’t seem to be a way to turn off just this part of the theme. “Forest” is particularly bad in this respect.

23.  The speed of the EVDO service is not remarkable. Browsing ordinary web pages is very slow compared to the desktop broadband experience. There seems to be a connection handshake required before each new page which noticeably slows down browsing. Using a WiFi connection works better. Tried several times to download video clips from the Windows Media site without success.

 

 

August 13, 2005

Publishing ASP .NET 2.0 to Windows XP Pro

On a newly configured Windows XP Professional system, the following steps may help you configure it to accept ASP .NET 2.0 applications published from a remote machine:

1.      Add IIS with FrontPage Server Extensions to the Windows XP configuration using the Add/Remove Windows Components tab on the Add or Remove Programs control panel.

2.      Run “C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215>aspnet_regiis –i” if unsure about ASP .NET integration with IIS.

3.      Check that the IUSR_<machine_name> and IWAM_<machine_name> accounts have access to the IIS wwwroot folder (typically c:\Inetpub\wwwroot). IUSR_ at least requires read & execute access.

a.       If Windows XP is using simple file sharing, you may not see the Security tab in the folder Properties dialog and won’t be able to set individual NTFS account access permissions. Uncheck the “Use simple file sharing” folder option (Explorer à Tools à Folder Options à View tab).

4.      Make sure any specific pages you’re trying to access have anonymous access enabled for them (Administrative ToolsàInternet Information Services à Default Web Site à Properties à Directory Security à Edit… à Anonymous access checked.

5.      If the Windows XP Firewall is enabled, create an exception for HTTP. Advanced à Local Area Connection à Settings… à Web Server à Edit (if needed) make sure machine name or IP is correct. Machine name is fine even if access is via IP address (or presumably DNS).

At this point you should be able to use the Visual Studio 2005 beta 2’s Build à Publish. Use an http:// path to the web app’s remote root.

 

August 08, 2005

Generating Patch Files for MSI Setup Files

Building an installer for just about anything with dotNET produces a multi-megabyte setup file which contains mostly dead-weight in terms of original content.

I found myself wanting to avoid transferring these large files each time I made a small update to a program on a remote PC, so I went looking for a compact and simple patch generating tool.

I ended up finding bsdiff.exe and bspatch.exe which require bzip2.exe. Lean, mean, and exactly what I wanted.