| Henry's profileUtterances on Software E...PhotosBlogLists | Help |
|
August 17 The type '<class name>' is made of several partial classes in the same filePractical Software Masochism™ has hit a new bottom: http://msdn.microsoft.com/en-us/library/bb129230.aspx Some errors are not likely to happen. I mean, why on earth would someone try to create multiple partial class declarations in the same file? http://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=sourceanalysis SA1201: ElementsMustAppearInTheCorrectOrder
Well, I guess I have to use multiple files then. But I’m not sure how that could possibly
August 09 Want to be a manager in the software business?Look at this video with Scott Hanselman and Chris Sells. Keep in mind also that this is about Microsoft and not some company where software isn’t the heart and soul of most things they do. Then, think again. July 20 A final utterance on Software Engineering?If I ever want the title of this blog to mean something, I have to link to this (via Jeff Atwood and Ward Bell). Now, for me, although I admire Tom DeMarco for his once clear vision about running software projects, Software Engineering was never much about project management, but more about the behavior and methods that distinguish a well-trained, proudly professional team of for-profit software developers from a cohort of hobbyists or programmers-by-chance. This is where I see the danger of Tom DeMarco’s essay – it may be used by the cheaters to justify hasty methodologies and it is a slap in the face of Clean Code and similar schools of thought. It’s a fairly audacious thing to say
right after forsaking any method of confirming it. I wonder how the developers of “Notepad” live with that. July 08 Virtually ThereThe presentations of the Norwegian Developers Conference are online. No, they’re not all in Norwegian. In fact, the magnificent line-up of speakers rivals that of other conferences. Waiting for TechEd content to become freely available may be less reasonable. June 27 Windows 7 and what it is notNow that we have prices, it is clear that RC1 is probably the thing and not a lot if anything is going to change for RTM. So, I guess I have to live with the small and big nuisances, everybody else does not seem to have. Nobody seems to have an ASUS P5B-E and encounter the extremely loud audio click during startup and “shutdown” or notice that it doesn’t appear to be able to completely shutdown the motherboard and power supply. There is all the fuzz about how it is faster and uses less memory than its predecessor, that more apps and devices are working and that XP Mode and RAIL are the greatest things since sliced bread. Really? The greatest thing is that the next Windows version can now run a legacy app in an entire virtual machine on the old platform? And “integration” is something like a shortcut that opens a window over a Remote Desktop? C’mon! I really thought that application virtualization was aimed at a much, much tighter integration and that Microsoft actually had the smarts to pull this off within its own new Windows operating system, instead of coming up with a duct-taped Virtual PC. Is the new system architecture really both that different and at the same time so non-extensible that an application cannot be more seamlessly virtualized? And do I really have to go and manage the XP Mode VPC like another machine, that is Microsoft Updates, Firewall, Virus Scan? And what do I get for this? Just a shortcut in the start menu. And I had so high hopes for the Compatibility property page. Well, for one thing, it is great that I can run 32bit-only applications for out-of-support USB devices on a 64-bit host. But there is no automatic startup, no automatic attach of USB devices and no real integration, with themes, with common registry settings, notifications or seamless access to the host file system, e.g. the user documents folder. Why don’t I get what “Windows-on-Windows” really stands for? And all those nice “shims”? How’s that gonna integrate? And for us poor chaps in the EU there isn’t even an upgrade path. As far as I know, Virtual PC doesn’t provide “Convert PC to virtual machine” in the same way that VMware does. Windows 7 may be the best Windows Microsoft has made to date. But it is a far cry from the perfection the hype suggests. It simply works better than Windows Vista because Microsoft and more of the other software and hardware vendors had sufficient time to get their act together for the adaption (or workaround) of the security features, multi-core machines, and even 64-bit. But the stuff that is really broken in Windows Vista and Server 2008, say the out-of-their-freaking-mind “Event Viewer”, that didn’t change for “7” in any way. June 19 OracleClient has left the buildingFor someone simple like me, Microsoft’s announcement regarding the sunset of System.Data.OracleClient is sobering news. While it seems to fit into the company’s recent activities regarding monopoly abuse claims, it is a harsh turn against loyal users for a couple of reasons:
Obviously, I’m exaggerating. The pragmatic developer is barely holding it’s laughing that I was using Microsoft’s API in the first place. Everything will be manageable and will Just Work. The implementation from Oracle will be alright and more than sufficient for the insanely simple stuff that was possible with the anyway limited OracleClient, so support will not be needed. And I should be so happy I have more choices now. May 14 Got shims?Get out of that metal shop and head over to download.microsoft.com! Download details: Managing Shims in an Enterprise Another take on something I’d like to call “virtualization” for the purpose of application compatibility. Together with Windows XP Mode, it looks like there is some tough tackling of the issue by the folks in Redmond. Somehow it must be possible to bring this all together seamlessly. May 07 Directory Object PickerNote to self: http://search.live.com/results.aspx?q=%22Directory+Object+Picker%22
Represents the "Select User" dialog shown when "Browse" is clicked to specify users for services, COM+ applications or access control lists. It offers all functionality to let the user browse Active Directory for certain objects.
There is already a wrapper on CodePlex (adui), see search results. April 24 Slaying the Virtual Memory Monster (If help for a problem someone has, juice it I should)Just after the OutOfMemory monster raised it's head, was slayed and is now believed to have vanished in the test lab, Tess posted a link to a great graphical address space analysis tool that can actually visualize the cut that mscomctl.ocx and it's followers tear through my virtual memory blanket. However, I wish there would be a better and standard way to integrate such great graphical tools with the debugger. A single picture says more than thousand lines of obscure command line responses. April 22 Slaying the Virtual Memory Monster (Dynamic-Link Library Relocation Edition)I started something. There seemed to be a memory monster in my process and I wanted to find it.
To investigate who was pulling the blanket, I looked at the allocated virtual addresses with the wonderful windbg extension command "!address". However, this leads to information overflow and is generally of little use for this stage of my analysis. But it indicates the problem could be rooted in the address space fragmentation caused by the loaded modules. I fed the output of "lm" into Excel to calculate the room between the load addresses. And there it was, my monster: Monster, thy name is MSCOMCTL.OCX, summoned by an innocuous legacy (i.e. VB6) library. It breaks apart my pristine address space into pieces. I wonder why that is, let's dumpbin ... Dump of file C:\Windows\syswow64\mscomctl.ocx
PE signature found
File Type: DLL
FILE HEADER VALUES
14C machine (x86)
4 number of sections
3F2F1329 time date stamp Tue Aug 05 04:15:05 2003
0 file pointer to symbol table
0 number of symbols
E0 size of optional header
2302 characteristics
Executable
32 bit word machine
Debug information stripped
DLL
OPTIONAL HEADER VALUES
10B magic # (PE32)
5.02 linker version
ACA00 size of code
56C00 size of initialized data
0 size of uninitialized data
89D8 entry point (275889D8)
1000 base of code
A7000 base of data
27580000 image base (27580000 to 27685FFF)
Somebody disobeyed the ancient proposals of rebasing Win32 DLLs. Maybe because in 2003 no machine with more than 512MB of RAM would be running VB6 code? "Optimizing" module load addresses was a great performance skill back in the days, when CPU cycles were scarce and jumping around in mapped memory hurt even more. Today, nobody could probably care less. Since Microsoft owns and signs MSCOMCTL.OCX, I cannot do the old rebase trick and let the app modify the file itself, which would be utterly stupid anyway. But, there is no version of LoadLibrary, that would allow me to "unforce" the image base address.
So what can I do?
SYMPTOM: Premature fragmentation of the address space. CAUSE: Some modules are linked with arbitrary, inappropriate load addresses. RESOLUTION: Block the respective address ranges as early as possible, but only temporarily using VirtualAlloc(...,...,MEM_RESERVE, ...) and VirtualFree(..., MEM_RELEASE). This works only for modules that are loaded late in the game, most likely through delay-loading, JIT compilation or COM activation.
Let's see where this will leaves us ... April 21 Slaying the Virtual Memory Monster (Large Object Heap Fragmentation Edition)If you're interested in the equivalence of Stephen King's "It" in the world of software programming, have a look at ReedR's Slaying the Virtual Memory Monster post. It's really scary. This week I'm starting to face a similar monster and that is However, just like "It" lurking in sewers and dark waters, my monster hides behind the 3rd-party curtain, in the disguise of the Microsoft Report Viewer Redistributable controls.
SYMPTOM: After displaying a couple of large server reports, where "large" means many Custom Report Items, i.e. bitmaps, rendering fails with "Exception of type System.OutOfMemoryException was thrown." Investigation shows the exception occurs on the client: 0:017> !CLRStack -p
OS Thread Id: 0x1bc (17)
ESP EIP
0f71ea54 7c90e514 [HelperMethodFrame: 0f71ea54]
0f71eac0 792ec8d0 System.IO.MemoryStream.set_Capacity(Int32)
PARAMETERS:
this = 0x11b50308
value = 0x10384000
0f71ead4 792ec868 System.IO.MemoryStream.EnsureCapacity(Int32)
PARAMETERS:
this = <no data>
value = <no data>
0f71eae0 792ec7b6 System.IO.MemoryStream.Write(Byte[], Int32, Int32)
PARAMETERS:
this = 0x11b50308
buffer = 0x11b6d45c
offset = 0x00000000
count = 0x0000fe53
0f71eb10 09c4a8d3 Microsoft.Reporting.WinForms.ServerReport.ServerUrlRequest(Boolean, System.String, System.IO.Stream, System.String ByRef, System.String ByRef)
PARAMETERS:
this = <no data>
isAbortable = <no data>
url = <no data>
outputStream = 0x11b50308
mimeType = <no data>
fileNameExtension = <no data>
0f71eb54 09c4a72a Microsoft.Reporting.WinForms.ServerReport.InternalRender(Boolean, System.String, System.String, System.Collections.Specialized.NameValueCollection, System.IO.Stream, System.String ByRef, System.String ByRef)
PARAMETERS:
this = 0x0d7a956c
isAbortable = <no data>
format = <no data>
deviceInfo = <no data>
urlAccessParameters = <no data>
reportStream = <no data>
mimeType = <no data>
fileNameExtension = <no data>
CAUSE: The process' address space is fragmented to the point that a large object (byte[272121856]) cannot be allocated because the longest contiguous block is just little over 120 MB. 0:017> !address -summary
-------------------- Usage SUMMARY --------------------------
TotSize ( KB) Pct(Tots) Pct(Busy) Usage
37942000 ( 910600) : 43.42% 80.68% : RegionUsageIsVAD
3b1b8000 ( 968416) : 46.18% 00.00% : RegionUsageFree
ab10000 ( 175168) : 08.35% 15.52% : RegionUsageImage
1300000 ( 19456) : 00.93% 01.72% : RegionUsageStack
13000 ( 76) : 00.00% 00.01% : RegionUsageTeb
16d0000 ( 23360) : 01.11% 02.07% : RegionUsageHeap
0 ( 0) : 00.00% 00.00% : RegionUsagePageHeap
1000 ( 4) : 00.00% 00.00% : RegionUsagePeb
1000 ( 4) : 00.00% 00.00% : RegionUsageProcessParametrs
1000 ( 4) : 00.00% 00.00% : RegionUsageEnvironmentBlock
Tot: 7fff0000 (2097088 KB) Busy: 44e38000 (1128672 KB)
-------------------- Type SUMMARY --------------------------
TotSize ( KB) Pct(Tots) Usage
3b1b8000 ( 968416) : 46.18% : <free>
cda4000 ( 210576) : 10.04% : MEM_IMAGE
13e0000 ( 20352) : 00.97% : MEM_MAPPED
36cb4000 ( 897744) : 42.81% : MEM_PRIVATE
-------------------- State SUMMARY --------------------------
TotSize ( KB) Pct(Tots) Usage
3cf34000 ( 998608) : 47.62% : MEM_COMMIT
3b1b8000 ( 968416) : 46.18% : MEM_FREE
7f04000 ( 130064) : 06.20% : MEM_RESERVE
Largest free region: Base 45fd0000 - Size 07e20000 (129152 KB)
RESOLUTION: I'm not in control of the many byte arrays used to read the various streams that make up a rendered report. However, I shall endeavor a thorough investigation into all the chunks that stain my memory blanket to see how I would possibly be able to contain the same. To be continued ... April 18 Cannot use Information Card (Windows CardSpace) with myOpenID in Internet Explorer 8If you’re one of the two people using Windows CardSpace with myOpenID and recently updated to IE8, you may have to switch to “Compatibility View” on the myOpenID login page to be able to log in. Google has it, other services using Information Card, such as Windows Azure have had similar problems. March 07 HTC Touch Pro ROM Update? Not worth the hassle.HTC recently published ROM update 5.05.407.1 GER for the HTC Touch Pro. Some of the issues I wanted to have fixed were
Oh, I shouldn’t have. None of the issues are solved. I even lost some functionality because without restoring the Sprite Backup, not all my settings are there and with restoring it, mail accounts and Touch Flo music player no longer work. Not speaking of the time that stupid Sprite Backup spends backing up files that have been synchronized with the desktop anyway.
The device is still painfully slow. It takes about one minute before I can enter the device PIN and another 30 seconds before the phone PIN is accepted and another minute until TouchFlo starts and again over 30 seconds to start Opera and the home page.
Opera and the connection failures got even worse. And zooming in and out when filling in framed web forms is clearly not what this version of Opera was built for (or tested against).
Of course will it trim itself on demand, but in the battle against HTC’s “task” manager precious CPU cycles are wasted which definitely are not invested in actually playing music. I’m not sure if it is this what causes the 5 to 10 seconds delay between songs, but something is. With the same SD card I did not have similar problems on the previous ROM version.
The static noise and failing speaker is actually an electromechanical problem, some sort of a cold soldering connection, I guess. If I squeeze the lower body a little, I can actually make the speaker play something. Time to test-drive the marvelous HTC customer support. The update procedure is a two-hours-or-more pain in neck, in particular the need to backup and restore and the quality of the results of that. First, if all Windows Mobile software could agree on where to store user settings, backup and migration would be way easier. Second, why can’t HTC include a backup solution that is suited for it’s device software setup and provide updated guidance with its updates? And last, why is ActiveSync so stupid that it can’t tell an updated device from a new one? And with all these fancy configuration and management interfaces for service providers, why can’t any of those be used by professional backup software? HTC is already busy marketing the next generation devices, so I guess that, just shy of one year after go-to-market this update is going to be the last we here about the Touch Pro from it’s makers. Time will tell if Android is ahead in this respect or if it is bound to repeat the mistakes of its foregoers. And we will be able to see if it’s Microsoft or HTC’s challenged software department that’s causing grieve on the people that spend several days of time and labor buying and configuring their devices. Given that there is now more choice and diversity in the high-price smartphone space, I may be not motivated to invest in HTC next time I’m shopping around. December 04 How can I even begin to think about building great software, when ...... even after countless usability studies the well-organized, well-managed, well-budgeted, well-staffed, well-skilled and well-trained Microsoft Office team does things like this:
I just wanted to see the current paragraph's style somewhere in the UI, but I don't have a WUXGA monitor at my disposal. And no, I didn't figure out how to stack the panes vertically. Quality software is a pipe-dream. Even those that think about it (at all and) more than everyone else get it wrong. November 06 Keeping the pace[This is an older post that didn't make it due to complications with Microsoft Live Spaces I don't want to go into.] Microsoft is speeding up. A Visual Studio 2010 and .NET Framework 4.0 CTP is available, just in time for the PDC. I'm wondering how folks are following. 1a. Migrate development, test and production environments to Vista/W2K8. 1b. Investigate 64-bit issues (interop & unmanaged). 2. Employ .NET 3.0 features: WPF, WCF, WF, click-once, smart clients, 3rd-party add-ons. 3. Investigate into Silverlight, 3rd-party add-ons. 4. Adopt .NET 3.5 language features. 5. Adopt .NET 3.5 frameworks: client application, MVC, data services, 3rd-party add-ons. 6. Parallelism and Concurrency. 7. Investigate, evaluate, and buy cloud services [from various vendors]. All that while you're actually conservatively evolving the software products you're selling to your customers which eventually must pay the bills for ALL the time you're working. And while trying to keep a healthy work-life balance. Unreal. November 04 Guideline ideas for using Cursor.Current and UseWaitCursorIn the .NET Framework System.Windows.Forms namespace, there are many ways to set cursors:
CONSIDER indicating activity of an operation by showing the wait cursor. This provides feedback to the user that the operation started and is still in progress. This should be included by default in all UI event handlers, because the duration of an operation depends on many factors outside of the programmer's control, e.g. file access over the network. DO NOT use the Cursor property to signal a long-running application. This property should be used only to change the cursor to indicate the action that is currently available for the control, e.g. a hand (for panning) or I-beam (to edit text). DO use Cursor.Current = Cursor.WaitCursor before you're starting a long-running operation that does not involve user interface changes and the cursor should change immediately. The cursor will be reset automatically as soon as the current thread returns to it's message loop. DO set UseWaitCursor to true when the target control, form, or, most commonly, the entire application execute a possibly long-running operation that involves one or more user interface changes or intermediate windows such as a progress dialog, or operations that indicate progress and completion using events. Note, that the cursor is not changed until the thread returns to the message loop. Note, that new forms do not inherit the UseWaitCursors value from Application. October 16 Engineering Windows 7Usually I link to the more interesting stuff I read using my link blogfeed on Bloglines. Today, however, I want to make an exception because I find it useful to give an interesting read a more prominent appearance and also document that I read it. The Engineering Windows 7 blog is a blog by Windows Executives responsible for the development of Windows 7. They talk about interesting, controversial and subtle issues that affect the design of the platform. And they usually let their people speak, about usability, user account control, search, window management. But yesterday's post about how Windows was and is actually developed is outstanding for a "company" blog. Apart from the fact that anybody involved in software development management should read it and compare it to their own beliefs and processes (if just for dismissing it for good reasons), it shows that Microsoft is actually willing to talk about everything, IMHO a great step towards transparency. Now, question is, is that a good thing? It can't hurt, can it? September 15 First weekend with the HTC Touch ProAs soon as my beloved TyTN got into it's third year, HTC seems to have pulled support for it. There are no downloads on the support page anymore, or any links to FAQ or the like. But, they released the German edition of the shiny Touch Pro, which is like the successor of the successor of the TyTN. Back then I did have too many problems with the Hermes to give the Kaiser a try. Now was the time for "Raphael". The most compelling reasons:
Additional advertised features
I wanted to wait with a post about it until I have nice pictures and more technical specs, but then again, who cares?
It is a brilliant piece of contemporary mobile hardware and pushes the boundaries of today's phones and PDAs, as much as did the TyTN when it came out two years ago.
Hardware design, including but not limited to the unpacking experience, is marvelous and worlds apart from the somewhat "technical" design of the TyTN. The metal body gives a feeling of value and high-quality. The keyboard opens with a snap that conveys a notion of strong, reliable mechanics. All of it's keys in the five rows are easily accessible, even for those with fleshy fingers. Key press feedback is firm and reliable. Even the stylus is stylish, long enough to hold, in one piece and not a telescopic fiddle-stick as the TyTN's. SIM card, battery and microSDHC cards fit easily in their sockets under the back cover, which opens (and closes) easily, unlikely to fall of. (Take this, TyTN!) Battery life is acceptable, even on the first days. About 6 hours WLAN straight, and the usual overnight recharge is sufficient.
So, use a Touch Pro if you want to impress folks with a shiny black smartphone with a crystal clear display and a complete keyboard.
But, and there's got to be a but with all today's hardware, don't let them actually use it.
The upside is, so far I didn't encounter hardware problems such as unreliable reception. Well, the camera is still not living up to a year 2000 2 megapixel digicam, but hey, it's a phone, right? Who'd use a PDA for landscape pictures anyway? And the FM radio with RDS? Works well when you try only your neighborhood radio station. (You need the headset as an antenna. Don't ask me how to use an AD2P headset in this case. And no, it doesn't support RDS in the sense that it would sort stations by name or actually switch to the best frequency.)
But my major discomfort is the software, again. It fails to address a significant problem that results from the incredibly high resolution on such a small screen: navigation, in particular the difference between scrolling, zooming, selecting and activating items in the user interface, all with usually nothing more than your thumb. The Touch Pro has "TouchFLO™ 3D", a Today screen replacement by HTC that should give you access to the most frequently used features and settings. It is also used to start Opera as the Internet browser of choice. But a touch screen lives and dies with instant feedback and this it doesn't have. Even more, as soon as you dig a little deeper, Windows Mobile get's thru and breaks the TouchFLO navigation abstractions. Mix-in Opera, with yet a different touch screen interface, which is in itself also changing with the definition of the rendered web page and depending on whether you are working in a new tab or not. The major competitor for the Touch Pro has an easier game in this field as all software is from a single hand and 3rd-party software is more restricted and controlled in their capabilities, so scrolling, zooming, selecting and activating is more seamless between applications. The real downside of the Touch Pro is it's extended key set (or the lack thereof), i.e. the switches you want to use when you choose to get a more precise control of navigation. The TyTN had a jog dial (with a poor «activate» function, however), six function keys, (Power, Communication Manager, Voice Control, Camera, Mail, Internet), four command keys (Left menu, Right menu, Talk, End) and the 4-way navigation with OK/Enter. Many of those keys were quite configurable regarding which functions they invoke on long or short press. The Touch Pro has a Power button, Volume Up, Volume Down, and the front area with Home, Back, Talk and End as well as a touch sensitive navigation control, all of which are not really configurable, or wouldn't make much sense to do so. Unfortunately, the pressure points of the navigation keys are not clearly separated. I find it particularly difficult to press "Down" with the Touch Pro in landscape with the keyboard open, e.g. to enter text into a web form with several fields. In 7 of 10 tries I hit "Talk", which opens the telephone application. More often than not, Opera will not continue to run in the background and I can't easily switch back to the previous page, zoom level and position I managed to achieve. But this is something I'm sure my fingers will get used to and in no time will I not want to ever go back to the TyTN again, as I already do when looking at it's "grainy" display. (I'll keep using the TyTN as a navigation device with Bluetooth GPS and TomTom Navigator 6. It would be too much hassle to try and register Tom Tom on the Touch Pro, but that's another story.) So, the wish list for software updates for the Touch Pro is not huge, but nevertheless longer than none.
So what do I say about the Touch Pro? Isn't it nice! You should get one, too. No need to hurry, though. And it's so sweet, you gotta love it. Despite the bitchy touch screen navigation. September 02 Top 10 Questions to AskIn case you ever run out of questions (when buying your next PC or laptop):
July 26 The project location is not trustedSYMPTOM:
When opening a project file, Visual Studio displays a warning message "The project location is not trusted:".
CAUSE:
The project file or its location will not receive FullTrust and may not be executed correctly, or at all.
REASON:
RESOLUTION:
|
|
|