bush hid the facts

Here’s an interesting Windows bug.

1. In a new window type “bush hid the facts” (all lower case, no quotes)

2. Save the document.

3. Reopen it.

bush hid the facts

bush hid the facts

Where did the text go? Windows mistakenly identifies the file as Unicode rather than ASCII if you create a document with certain text. Almost any 4 letter word followed by two 3-letter words followed by a 5-letter word will have that effect. (via Newsvine; more details here)

Another reason VSTS sucks

My company recently switched from Visual SourceSafe (which I accessed using SourceOffsite) to Visual Studio Team System for version control, which has caused me endless grief.

The first annoyance was there’s no way to see which files were changed locally in the file list. The bigger problem is it can’t handle Unix/Mac line endings. If you use the compare feature, it will show the ENTIRE file changed because of the line endings.

Fix for crash

I came up with a fix for the APE-related crash I found a few days ago. It seems that signals can be delivered to any active thread. If you have APE installed, it injects its own thread into the application. If the signal happens to be sent to APE’s thread, there’s a chance bad things might happen.

The fix was for my signal handler to make sure it’s running in the thread we want, and if it isn’t, I send the signal to the proper thread and don’t do anything else.

void MySignalHandler(int SigNum)
{
	if (!pthread_equal(_my_signal_thread,pthread_self()))
	{
		pthread_kill(_my_signal_thread,SigNum);
		return;
	}
 ... etc ...

Elsewhere, I save a reference to the desired thread when I install the signal handlers:

main(int argc, char **argv)
{
	_my_signal_thread = pthread_self();
	signal(SIGIO, MySignalHandler);
 ... etc ...

APE caused a crash

I know Unsanity’s Application Enhancer is often unjustly blamed for crashes, but in this case it definitely caused one of my applications to crash, as shown in this stack frame from the crash report.

Thread 1 Crashed:
0   com.absolute.ctmweb      	0x0002b9a9 CheckForListen() + 253
1   com.absolute.ctmweb      	0x0002bba0 MyNot(int) + 28
2   libSystem.B.dylib        	0x9011108c _sigtramp + 49
3   libSystem.B.dylib        	0x9000a5c7 mach_msg_trap + 7
4   com.unsanity.ape         	0xc0001d12 __ape_agent + 307
5   libSystem.B.dylib        	0x90024b07 _pthread_body + 84

UPDATE: I realized that it’s my signal handler code being executed in APE’s thread.

My life just got more difficult

My company switched their source control from Visual SourceSafe (which I accessed using SourceOffsite) to Team Foundation Server (VSTS). Since XCode has no built-in support or plugins for either system, I always worked locally, did a checkout of any files changed locally, and then checked in my changes (after merging, if necessary). It was easy since SOS would show me which files were changed locally.

Unfortunately I don’t see any way for VSTS to show which files were changed locally if they aren’t checked out. If I had to check out every file before I worked on it, I would have to constantly bounce between VSTS in Windows XP running under Parallels and XCode.

Blogged with Flock

Busy week

I had a very busy week trying to implement a feature and this week will be more of the same. Tomorrow morning I have a conference call at 9AM.

I curse the person at Netscape who invented proxy auto configuration. You can’t simply read & parse a .pac file – you need a javascript interpreter to do it properly. It would be a lot easier if I could use CFNetwork, but I wrote my own networking code which, among other things, implements much of HTTP 1.1 using BSD sockets. It always supported manual proxy setup, but not auto configuration.

Python

I’ve started learning Python, which I’ve wanted to do for a long time. One thing that always bothered me about it is that whitespace is significant. Unlike most languages where blocks are delimited by begin..end or {…}, in Python a block is delimited by all statements being indented the same amount. Am I the only one bothered by that?