Welcome to McFunley.com Sign in | Join | Faq

Development  RSS

  Mostly complaints about Visual Basic.
Well, if you use emacs long enough, eventually you realize that you have tens of thousands of lines of elisp lying around. I'm making a modest effort to dig myself out of this mess and what useful tidbits there are I will share with the world. Here is Read More
So here's my method for determining whether or not a particular platform is worthwhile. I ask myself, "how would David Letterman summarize this?" I know this doesn't seem very scientific, but it's a mask I have years of experience wearing. Trust me on Read More
So I wrote this replacement version of Condition using the native posix support. Event and Semaphore are both written in terms of Condition, so you can use this as a fast route to getting native versions of those synchronization primitives. (Note, though, Read More
Some people sing carols every XXX-mas, I get bored and write the Mandelbrot Set program in whatever my favorite language happens to be that year. I thought the brevity of the output this year (Haskell) was kinda neat. import Graphics.UI.GLUTimport Control.Monadimport Read More
Although I haven't found this to be necessary nearly as often as Windbg was for me on Windows, it's still somewhat handy to be able to look at a Python daemon or multithreaded program in GDB. I've had to set this up a few times now, and I've forgotten Read More
That site I have been working on in semi-secret for the last six or eight months is now live. Here it is:http://feedeachother.comExplanations, walkthroughs, etc. can all be found there.Most of the credit for this thing really goes to Udi Falkson, one Read More
Hey, by the way, the last post is likely to be my last Windows-oriented post for the forseeable future. I have recently quit the financial sector and will be starting a fantastically cool new job here in a few weeks. I no longer have a Windows machine Read More
Here's a problem:You have an application that's hanging permanently or temporarily.The hang does not occur in any synchronization code that you have written yourself.You are writing a windows forms application, or any kind of application using COM interop. Read More
Don Box says:As a WPF user, I spend at least as much time reading and writing XAML as I do reading/writing C# code that does WPF-isms. I do spend a lot of time in C#, but little of it is WPF specific, which arguably is one of the strengths of WPF’s data/content Read More
I suppose I finally had enough of the carpal tunnel caused by typing '\' to delimit directories (yes, powershell helps a little, but not enough). Or, I decided I knew enough about Windows for now and needed to branch out.Or maybe I was just in a rut.Well, Read More
I figured this was worth a shot.I am:Someone that has been hacking since childhood.Someone that has spent most of his Saturday doing problems in a Haskell textbook for fun.Someone that thinks programming is very similar to art, if one is sufficiently Read More
I hate you guys. Seriously, drop dead.SERVICE_NAME: ati hotkey poller        TYPE               : 110  WIN32_OWN_PROCESS                                   Read More
Sometimes I think my quest to get my functional programming skills up to snuff is turning me into a raving lunatic. I keep writing code that inflicts physical pain when kept to myself. Here's a fresh cut and paste out of my emacs:applyAll [] = idapplyAll Read More
Only a small fraction of Windows Python programmers use emacs. I am a bit distressed that your article implies that Emacs is a pre-requisite for Python on Windows. Nothing could be further from the truth! "Yes, tragically, you will have to learn emacs Read More
Update: someone informs me that there's an eclipse plugin, which seems obvious in retrospect. I stand by this since I think emacs is a better editor, but, for those who don't know emacs that surely makes more sense.----Another update: see here.----I have Read More
I wrote a small program that generates xml from a type library. The type library can be a .tlb, or embedded as a resource in a PE (.dll, .ocx, .exe, etc).The source can be downloaded from here, or you can view it online here. It doesn't grab everything Read More
This site has been silent for quite a while. My lame excuse for this is as follows.Sometime around the beginning of the summer I started trying to learn functional programming in earnest. I had some exposure to this in school (ML, if I remember correctly), Read More
I got a chance to mess around with the Concurrency and Coordination Runtime (CCR) bits recently. Before I get into that, first check out this real-life code I wrote this week. public static class NotificationQueue{    private static Queue<Notification> Read More
This is something I typed up internally, to help resolve the confusion that precipitates when Visual Studio begins stepping through comments. Hopefully this will be helpful to someone else.What is required for source mode debugging?Binaries (.dll, .exe, Read More
Blocked finalizer threads have gotten some recent publicity on Tess Ferrandez's blog. I recently ran into this myself, although the particulars were slightly different.Our problem was manifesting itself in a very long-running console application that Read More
When I'm writing a GUI or a multithreaded server application, I make heavy use of OutputDebugString (and various API's that map to it). This is a very useful tool when the act of stepping through an application has side effects that drastically change Read More
The source code for my Pointless Minesweeper Clone can be found here. Enjoy it.The license is BSD (you may know this as the "hey, go nuts" license). Read More
My roommate, a grizzled veteran of Cornell's CS 211, made an announcement a week or two ago. It was something along the lines of, "gee whiz, I'm glad they didn't make us write minesweeper as a project. It looks impossible." To prove my vast intellectual Read More
I found myself needing to automatically manipulate the return value of a managed function in release code today. I thought this would make an interesting little writeup. For the purposes of the demonstration, let's use this example program:class Program{    Read More
Good mescaline comes on slow. The first hour is all waiting, then about halfway through the second hour you start cursing the creep who burned you because nothing's happening ... and then ZANG!- HST, from Fear and Loathing in Las VegasThis is an only-slightly Read More
Low memory conditions have a way of executing lightly- or never-tested code paths. Bugs in these paths can sometimes cast a penumbra over the real reason your application is crashing. Worse, the resulting exceptions or crashes are likely to be more Read More
Here's an anecdote for the WTF inbox. I assure you this is very real, but I cannot divulge any of the specifics.Some time ago a friend of mine was talking to a web services vendor, who was explaining his versioning scheme. The vendor's approach was to Read More
This is a straightforward fix, but I couldn't find anything about it anywhere else. I have a handful of old ATL projects that have been upgraded over the years from Visual C++ 6.0, through VS2003 and are now being built using Visual C++ 8. I was trying Read More
The worst possible way to "handle" exceptions is to show the user a message box with __FILE__ as the text. This is extremely poor form. Apparently, Intel did not get the memo. Worse, this happens as many as ten times when I open Visual Studio. Why do Read More
"Why the hell is this application insisting on loading an old version of the CLR?" I'm guessing that's what you're asking yourself if you've gotten here through your search engine of choice. Well, relax. I'm about to explain.It is reasonably well-known Read More
I googled around, and couldn't find a generic singleton implementation that was 1) correct and 2) met all of my needs. This is a clever approach, but unfortunately it is limited to objects that are created by calls to constructors. So I went ahead and Read More
You never know what will become an API.[13:23] DarrelHerbst: did you make the annotated stock chart left link have linkId=666 on purpose?[13:23] McFunley: yes[13:23] DarrelHerbst: it looks really cool in this document i'm writing Read More
Mike Stall has had a recent string of posts about debugger features, which got me thinking about what I waste time doing in debuggers these days. Omniscient debuggers would be great, but what I would really like is a memory window that I can annotate. Read More
Raymond Chen has had an entry or two about "Psychic Debugging." This skill is a lot like everyday psychic abilities by virtue of being really just intuition and guesswork, but dissimilar in that it produces results that benefit society.Today one of the Read More
Here's another form I had to fill out twice, from nespresso.com:Nespresso is a Swiss subsidiary of Nestle, which I assume is the reason that this form ignores the "city, state, zip" convention we have here in the U.S. and instead opts for "zip, city, Read More
I cast my lot with Joel Spolsky in this, his latest, made-to-order internet dweeb controversy. There are some mentally-challenged folks, on either side of the aisle, that see it as an attack on Java. I'm not sure that they've read past the title, but Read More
I've been reading Slashdot for the last year and a half or so. I stayed away from it until I downloaded an aggregator that had it preinstalled, and, well, it just kind of stayed there. I don't post comments myself, but I find find those who do interesting. Read More
In my javascript debugging post I showed a stack trace and mentioned only that it seemed to be running javascript code. Here it is:0:009> ~0kChildEBP RetAddr WARNING: Stack unwind information not available. Following frames may be wrong.0012f97c 6009db8b Read More
A few posts ago I mentioned that Firefox was maxing out my CPU "when I had more than three tabs open." As is typical with bug reports from users, this one is very poorly worded and essentially useless. It turns out that that was not a good explanation Read More
If you find yourself struggling with the following error message in SQL Server Management Studio 2005:Database diagram support objects cannot be installed because this database does not have a valid owner. To continue, first use the Files page of the Read More
I realized just how much I depend on my laptop these days, and I'm starting to think this is flirting with disaster due to their mayfly lifespans. I was pricing backup appliances at the Mirra site when I realized, hey, image-only websites suck. I'm quite Read More
I was writing some C# code the other day and attempted to use a static local variable. This may only be because I've been spending so much time with C++ recently, but I was very surprised to find that it didn't work. "That's a shame," I thought. It's Read More
In my last post I alluded to interview quizzers. These are [straw man alert] egotistical people who assume that any smart person must know the highly-specific information that they themselves have learned in the last month. "I don't know, but I'll google Read More
I'm going to take a page from the Book of Darrel and post some design patterns whenever I realize that I'm using them. I'd like to be careful because I think that there are a few camps when it comes to design patterns:Design patterns are very important, Read More
The on-screen guide for my Direct TV box looks roughly like this:The control on my remote that causes the current channel to move up and down looks like this:If the problem here is obvious to you, you too may have a future in user interface design. If Read More
Attention reader: this website may contain terrible advice and fundamentally flawed code samples. Personally, I don't believe this to be the case, but my advice to you is to read it as if that were true. That you should question everything you read is Read More
I have been getting quite a few google hits for search strings like this:unmanaged memory leaks windbgIt's the second-most-common combination of search terms, trailing "hank goldberg picks" by a hell of a lot. I don't think the searches are coming from Read More
Here are a few roughly-equivalent class declarations using different languages and libraries. I say "roughly equivalent" because the implementation details and performance characteristics may actually be quite different in each case. However, the end Read More
Herb Sutter says the concurrency revolution is coming. This guy says, "*** you!! the concurrency revolution is coming!"That is the kind of attitude we need in the industry. We need more in-your-face greeks and fewer genial mustachioed C++ architects. Read More
Let's say you're writing a component that makes a DataSet available to a number of clients. The DataSet is expected to persist in your application for a while, and be used in code written by many different developers.You could carefully craft an email Read More
It's good to see that at least a few usability & design gadflies agree with my conclusion that AJAX is becoming a religious experience in some circles. (I intend religious experience to be taken in the pejorative sense here, as I always do.) This Read More
That's my assessment so far. I realize posting an apostate opinion such as this is a good way to get my site hacked by a sixteen year old, but I'm going to write the rest of this anyway. I'm only doing so because I care about the product.Let me first Read More
I recently put Google Analytics on this site, which does a lot of things I may never understand. One thing it does (which I do understand) is keeping track of search phrases for my site. I already had something like this with my hosting package, but it Read More
Here's the scenario: I had about eight hours of perfmon output, for several hundred counters sampled once per second. I wanted to put this into a database already containing the parsed IIS logs from the same machine, to try to correlate some of the resource Read More
I recognize that this looks like an extremely stupid question. Especially since AJAX necessarily involves XML. But try to keep your gun in your holster while I try to explain exactly what the hell I'm talking about.I think the word AJAX is starting to Read More
Introduction Part 1 - What is a DbgEng Extension? Part 2 - A Use Case & the Problem Setup Part 3 - A Crash Course on Object Layout Part 4 - Searching Memory Part 5 - Manipulating Managed Types Download the code for this article. We already Read More
I've been operating this site for over a year now, so it is finally time to reflect on just what, exactly, it is all about. The author of a technical website is always walking the all-too-fine line between obscurity, respectability, and complete whoremanship. Read More
Introduction Part 1 - What is a DbgEng Extension? Part 2 - A Use Case & the Problem Setup Part 3 - A Crash Course on Object Layout Part 4 - Searching Memory Download the code for this article. In the last post in this series, we succeeded Read More
Despite some initial bad press, my impression so far is that Visual Studio 2005 is a pretty nice product. I would qualify that by saying that I haven't yet used it to work on a massive web project, and as we all know web projects were definitely Visual Read More
Introduction Part 1 - What is a DbgEng Extension? Part 2 - A Use Case & the Problem Setup Part 3 - A Crash Course on Object Layout Now that we know how to solve our problem conceptually, we can put pen to paper. Metaphorically speaking, I Read More
Introduction Part 1 - What is a DbgEng Extension? Part 2 - A Use Case & the Problem Setup To write this extension, we need at least a cursory understanding of the way JIT-compiled objects are represented in memory. The basic structure on a Read More
..and we are compelled to face with sober senses our real conditions of life. Darrel Herbst (rss) is creating content for public consumption. Don't tell him I told you. Read More
Introduction Part 1 - What is a DbgEng Extension? Now that we have a feel for the difficulty of the task, we should probably stop for a moment and reflect. Do we really want to go through with this? Why would you want to go to all the trouble Read More
Over the next few days, I will be posting a series of articles about creating a small debugger extension to examine a managed process. This is going to be some of my most intense content to date; you have been warned. When the series is finished, Read More
One of the lesser-publicized features in version 2.0 of the .NET Framework is that link.exe can now combine multiple .netmodule files into a single managed executable or library. This is very similar to the functionality offered in the Microsoft Research Read More
This is not an original idea but I thought I would post/explain it anyway. This is a generalized version of a pattern I have been using for a while. I'm not sure where I first picked it up but I've seen it used in several places. The purpose of Read More
A few years ago, my reaction to encountering code like this was very predictable. You could set your watch to it: public XmlDocument FooBar() {     XmlDocument doc = new XmlDocument();     doc.LoadXml("<foo/>"); Read More
Earlier this week, we had a production issue with application servers that seized up and stopped serving requests. On one impacted server,   ·          The private bytes counter for the w3wp process Read More
I came across a JavaScript error today in just about the last place I expected to find one. I closed the window and reran the wizard a few times, thinking it was a website in another window acting up. Luckily, it appears to only be infecting Read More
I got a good cackle out of this: Web Two Point Oh! If anyone needs me, I will be busy working on my Greasemonkey extension for Flickr blogs via Ruby on Rails. Read More
This is a very technical post about debugging an unmanaged memory dump. The tool I am using for this is WinDbg. You can get more general information about WinDbg here.       We had our production release a few days ago, which means Read More
In my last post, I complained about an obscure Excel crash. Well, this morning the client got back to me saying that he opened up the original workbook (with no workarounds in place), and obviously, got the crash. However, something was different Read More
One of several applications I work on is a COM add-in for Excel. To put it mildly, this thing can be a real bear to support sometimes.   I was looking into a very peculiar access violation (AV) today. It seemed to only ever happen if—   Read More
Take a moment to subscribe to this DBA blog being maintained by Ira Pfeifer and Mike Forman, two outstanding engineers that I happen to work with. Their last post appears to be something about conducting raids with the South African Navy, but hopefully Read More
Part I Part II   In my original post, I left you with the assignment of modifying this command to create a series of dump files instead of overwriting the same one repeatedly.   0:003> bp kernel32!RaiseException ".dump /ma /o c:\\temp\\myapp.dmp; <