Terminal.app hangs at startup

(Cross-posted from Bottled Text.) I just got bit by this bug, under OS X 10.5.4. The symptoms are that sudo hangs, and Terminal.app hangs when opening a new tab or when starting up. Console.app shows messages of the form

7/24/08 7:04:44 AM kernel devfs: ttys001: name slot allocation failed (Errno=17)
rprr posted a workaround in the above thread which worked for me. I don't know how to link to specific messages in the discussion thread (or whether that's even allowed under the terms of use, egad), so here's a recap:
1. Started Terminal. It hung up. Did Force Quit and Sent Crash report to Apple. 2. Since I had a working X11 application, I used it to open about 10 xterms using the Applications->Terminal Menu of X11.app 3. I started Terminal again. Now it works.

"Generating user instances in SQL Server is disabled"

I don't know why, but starting about two weeks ago SQL server is giving me error messages. They arise the first time I try to log in to a web application, one which I'm developing under Visual Web Developer 2005 Express Edition. The error message:

Generating user instances in SQL Server is disabled. Use sp_configure 'user instances enabled' to generate user instances. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Generating user instances in SQL Server is disabled. Use sp_configure 'user instances enabled' to generate user instances.

This problem recurs every time I restart my Windows XP VM (running under VMware Fusion). Until I figure out why the problem recurs, here's the SQL which makes it go away:

exec sp_configure 'user instances enabled', 1;
reconfigure;
go

Firefox 3 security and jqUnit

I recently upgraded to Firefox 3, and immediately began having problems with jqUnit unit tests. Problem The failing tests make Ajax requests, using URLs like "../templates/some_fragment.html". That is, the requested documents reside in the web application's source tree; they are not in a subdirectory of the directory containing the jqUnit test. Under Firefox 2 (and Safari 3) this was no problem. The browser would simply go out to the filesystem and retrieve the file, no matter its relative location. Under Firefox 3 the requests failed. The error console showed messages like

Security Error: Content at file:///path/to/unit_tests/foo.html may not load data from file:///path/to/templates/bar.html.
Firebug would report
Error: [Exception... "Access to restricted URI denied" code: "1012" nsresult: "0x805303f4 (NS_ERROR_DOM_BAD_URI)" location:...
Workaround A quick fix is to load Firefox's about:config page and revert to the less-secure behavior of Firefox 2, by setting security.fileuri.strict_origin_policy to false. kb.mozillazine.org explains in detail. Solutions? Long-term, I need to see about restructuring my unit test directories. This should be easy for organizing static .json files, but I'm not sure what to do in cases where I need to retrieve things like markup, from parent or sibling directories. More Information John Resig's weblog provided a great summary of the problem. The comments section was especially helpful.

Controlling DIV height in IE6

The arcs/edges in the tree layout from the previous post were built from <div>s. TreeLayout.png A vertical line is rendered by a <div> with a width of 1px, a horizontal line by a <div> with a height of 1px, etc. As usual, this doesn't quite work in IE6, which seems to ignore the height specification. And as usual, Google produces a solution: set overflow: hidden; on the horizontal line <div> to prevent IE6 from allocating space for any potential text content. From http://www.webmasterworld.com/forum83/4682.htm

IE leaves a default height even on "empty" elements which is equivalent to the default line-height required to accommodate your default font-size...

Centering text vertically within a DIV

This problem crops up often enough to make it worth documenting: How do you center text vertically within a <div>, in a way which works with Safari 3.x, Firefox 2 and 3, and IE 6?

The "line-height" solution posted by Lauri Raittila works for me. Set the line-height for the <div> to match the total height for the <div> and make sure any overflow is hidden.

Here's the relevant CSS:

.TreeNode {
  width: 8em;
  min-width: 8em;
  max-width: 8em;
  height: 2em; min-height: 2em;
  max-height: 2em;
  line-height: 2em;
  text-align: center;
  overflow: hidden;
}

And here's how it can render (Firefox 3/Mac OS X, with added CSS for borders):

TreeLayout.png

Migration

I'm moving the moribund dmoonc site to a new web hosting provider, WebFaction. As part of the migration I've copied from my Bottled Text blog all posts (and comments) relevant to software development. Now to start rebuilding the website proper...

Thank you, wsgi

Thanks to all of the developers behind wsgi.

When I first heard about it, wsgi struck me as an unnecessary complication. Then someone showed me how it could simplify testing of web applications. And now:

High-Scalability:

Google App Engine supports any framework written in pure Python that speaks CGI (and any WSGI-compliant framework using a CGI adaptor), including Django, CherryPy, Pylons, and web.py. You can bundle a framework of your choosing with your application code by copying its code into your application directory.

Visual Web Developer "Failed to start monitoring changes"

I keep forgetting about this...

I'd like to do development on an ASP.NET web application which resides in a VMware Fusion shared folder. Unfortunately, as noted in the Microsoft Forums, Visual Web Developer 2005 Express Edition (at least) does not support hosting on a UNC share.

So, AFAICT, the only option is to do development in a local folder. To access that folder from the host operating system, it needs to be shared from the Windows VM.

VMware Fusion, OpenSUSE 10.3 x64, copy and paste

I recently installed a 64-bit OpenSUSE 10.3 virtual machine under VMware Fusion. Everything worked fine except cut&paste -- the vmware-user executable was not launching when X11 started.

ldd showed a dependency on libexpat.so.0, in addition to libexpat.so.1. I installed that using yast, rebooted, and -- huzzah -- cut&paste now works.

yast_install_libexpat.png

More details are available in the VMware Fusion discussions forum.