Here are mine:
noOne of my powershell scripts syncs mail certificates from our ADAM to our AD. It might be one of my most hated scripts, as there are so many special cases and places where the script or its tooling just breaks or runs into trouble, because some team changed some stuff in places. But the worst part is the tooling, which just fails.
function do_something() {
# 20 lines of fetching an AD contact or creating one if it does not exist.
# $objADSI contains the AD Object
# $c contains a row of an imported CSV file
$r = new PSObject -Property @{# The ISE crashes when I return the new object directly.
ADEntry = $objADSI
CSVEntry = $c
}
return $r
}
One of my C# applications displays a splashscreen while doing stuff in the background. In order to display the splashscreen, I spawn a new thread which also fuels a little animation and just shows the user that the application is working. At one point, I want to display a modal message, so I get the splashscreen's handler from the second thread (with proper lock) and display the message. Turns out the debugger has some serious issues with my code...
lock (splash)
{
try
{
MessageBox.Show(
splash,
"This is the first time you start this application... // and more text here",
"First Time Notice",
MessageBoxButtons.OK,
MessageBoxIcon.Information);
}
catch (Exception ex)
{
// The debugger will throw an error and while debugging the message will _not_ be displayed because splash was created in another thread.
// When executed without a debugger, this piece of code executes just fine and does what it should.
// Personally, I think it's stupid that the debugger does not recognize the lock construction and just executes the code.
// But well... whatever. Who knows how long we will be using this tool either way.
}
}
Oh, and by the way, it's an old tool which really is not used any more. So the last sentence of the original comment is quite funny :D