Drawing UML diagrams in OpenOffice Draw

In my search for a simple (and since my reasonably disastrous experiences with StarUML: stable) UML editor, I came across this set of UML symbols for use in OpenOffice Draw:

http://www.lautman.net/mark/coo/index.html

The author suggests you open the UML drawing and copy/paste elements from that into your own UML diagram. That is possible, but I prefer to add the elements from an OpenOffice Theme.

  1. Click the “Gallery” icon in OpenOffice Draw, or choose Tools > Gallery.
  2. Click on the “New Theme…” button.
  3. On the “General” tab, enter the name of the new theme, e.g. “UML”
  4. Drag the UML diagram elements from Mark Lautman’s ODG into the new UML theme. To do this, click on an element whilst holding the Ctrl key pressed. Keep holding Ctrl for a second or two. The cursor will turn into a “Copy” pointer; drag it into the empty UML theme area and drop it.
  5. The element will be added with a default title like “dd2014”, you can change this title by rightclicking the element in the Theme area and selecting contextmenu item “Title”, so sensible names will be visible in the list view.

Remove recent projects from Visual Studio 2008

To remove projects from the “Recent Projects” list in Visual Studio 2008, open regedit.exe and go to:

HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\ProjectMRUList

You will find a number of keys here named “File1”, “File2”, etc. that contain paths to the projects in the “Recent Projects” list. Invalidate the paths of the entries you want to remove. (For instance, you can remove “vcproj” from the path.)

Now open up Visual Studio 2008 and click on one of the projects you want to remove. Visual Studio will detect the incorrect path and ask you whether you want to remove the project from the “Recent Projects” list; click Yes to remove the project from the list.

(Why isn’t this functionality available in VS2008?)

Text truncated to 255 characters when reading from Excel with Jet 4.0 OLEDB

One of those MS vagaries: text from my Excel sheet was truncated to 255 characters. See http://support.microsoft.com/kb/281517 for the reason. Apparently, the driver guesses the maximum length of a column by looking at the first 8 rows of the Excel sheet. The MS article tells how to change this number, but does not provide a workaround. My (ugly) workaround is: modify the Excel sheet by inserting an extra row at the top that contains more than 255 characters. A subsequent read will identify the column as bigger than 255 characters and read ALL text in the sheet.

jQuery UI problem with nested accordion and tabs widgets (solved)

An application I’m working on features tabs inside a jQuery UI accordion inside yet another set of tabs. The problem I was having was that, for some unknown reason, the accordion became way too high or way to narrow.

It turned out to be logically related to the nesting of the UI widgets and the order in which the widgets were created. If the accordion is rendered before the inner tabs are rendered, the contents of the inner tabs are (still) displayed below each other. The accordion calculates the necessary height based on these vertically stacked elements. Subsequently, the inner tabs are created and a big empty space remains inside the accordion. Another related problem is that when the accordion is created, the actual contents have to be visible for the height calculation to be performed properly. In my case, the accordion is not on the first (outer) tab that is visible by default, but on a subsequent tab, causing the accordion to be rendered with minimum height (approximately 50 pixels) by default.

The final solution was:

1. Create the (inner and outer) tabs

2. Select the outer tab that contains the accordion

3. Create the accordion

4. Re-select the initially selected outer tab.

All logical in retrospect, but isn’t that always the case.

McAfee = leet?

Whenever a scheduled virus scan starts, the number of scanned items remains on a suspicious number for a while… Is it just my leetz0rz laptop or is it an Easter egg? mcafee 1337Hmm…

Easter Egg on jQuery site

Digging around the script on the jQuery.com website I saw there´s an easter egg that uses the Konami cheat code, i.e. up arrow twice, down arrow twice, left arrow, right arrow, left arrow, right arrow, a, b. Rock on!
(Tested in Google Chrome only)

Mysterious additional HTTP GET: beware of the IMG tag!

This morning I solved one of those mysterious problems that cause insomnia, premature baldness and/or random acts of violence such as throwing anything out of the window with an on/off switch.

One of the web forms I’m working on stores an object in the Session scope. The object  is being created on the initial (non-postback) call of the webpage and fetched from the Session on subsequent postbacks. One particular part of the page utilizing AJAX caused the object to be reset to its initial state and that was when the detective work started.

Firebug showed that after loading a dynamic part of the page an additional HTTP GET was done. It turned out to be an IMG tag with an empty src attribute, i.e.

<img src="" />

that was filled in after dynamically inserting the HTML, causing the aforementioned HTTP GET by the browser. The solution was to point the IMG to a valid (empty) image first and overwrite that later.

This reminded me of a similar case I had a long, long time ago in a place near, nearby where a piece of faulty HTML also caused an additional GET. Exercise for the reader:

<body background="#FFF">

(Yes folks, that was in the day that CSS did not exist yet and “Auto-complete” referred to a letter stating that your T-Ford was ready.)