Some of the first things I needed to get straight to move from Microsoft Office scripting to Open Office scripting:
The BASIC isn't quite compatible: I know the object model is completely different, but even the underlying language isn't quite the same. I wanted to use the InStrRev function, but it wasn't there! Then I found option VBASupport 1 which puts it in. It's (as far as I can tell) undocumented but mentioned all over on the web. I'm not sure what else it changes (again, in the language, not the object model).
The name of the program is OpenOffice.org; evidently Open Office is trademarked by someone else. I'll do my best to comply.
Sizes are in hundredths of a millimeter (dekamicrons? abbreviated as daµ; I can't find anyone using a better abbreviation), so my code has a lot of x = y * 2540/72: 2540 mm per inch, 72 points per inch.
Inserting control elements is more complicated than I would have thought; the object model divides them into "model" and "view" and figuring out which properties belong to which takes some searching and experimenting:
Dim rng as com.sun.star.text.TextRange, checkModel, checkbox
checkModel = doc.createInstance("com.sun.star.form.component.CheckBox")
checkView = doc.createInstance("com.sun.star.drawing.ControlShape")
checkView.control = checkModel
rng.Text.insertTextContent(rng, checkView, True)
My hospital isn't fully electronic yet; they use a hybrid system where doctors notes and orders are written on paper, to be scanned into the electronic chart at the end of the patient's stay. Everything else (nurse's notes, labs, radiology results) are electronic. It actually works pretty well, with most of the advantages of an EMR (Electronic Medical Record) without forcing the older doctors to use the computer. That's coming, of course, but it won't be pretty.
But those of us for whom the computer is mother's milk, and whose handwriting is somewhere between chicken scratch and Linear A, we'd rather do it all online. I've been writing my admission notes for a few years with a Microsoft Word template, printing them out and putting them in the chart, with nary a problem. And the medical records department clearly used PDF's for the pages, both the blank order sheets and the preprinted, fill-in-the-blanks "standard orders" since they were available on the hospital intranet. So let's create PDF's with actual editable text boxes and check boxes (these are mockups, but they look right):
All I wanted was to get a better 404 page for the bililite.com site and to use mod_rewrite to standardize my pages. Of course, nothing is ever simple and mod_rewrite is voodoo. So it took a week of experimenting, pulling my hair and staring at a lot of 500 errors, but I think I got things where I wanted them (still don't have a very elegant 404 page, though!). To make sure I didn't have to go through this again, and to help anyone else out there, here are the things I wish I had known:
I like Maxime Haineault's timepickr. But I found it was written for jQuery 1.2, and didn't trigger events correctly with the current jQuery. It also had more dependencies than I wanted, to the extent that the minified version is 49k large, and had some CSS quirks in Internet Explorer that I couldn't figure out without dissecting the whole thing. So I dissected it and rebuilt it smaller, updated for jQuery 1.3. I didn't put back a lot of the options that I didn't need, so it's not exactly an improvement. But it works for me.
I needed a date/time picker and spend a couple of hours making a simple one:
Obviously, I didn't spend a couple of hours putting this together. I wrote it quickly, then spend the hours getting it to work even remotely correctly in Internet Explorer.
So let's say I want to create elements that match a jQuery UI theme (in my case, I was using a <canvas> element and wanted to copy colors). I could try to parse the CSS file directly, but that runs afoul of the same-origin security problem (I use Google's CDN to get the jQuery UI stylesheets, as in http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/smoothness/jquery-ui.css). I could go through the document stylesheets to find the relevant styles, but there's an easier way; just create an element with the desired classes and query that:
var background = $('<div class="ui-state-default">').css('background-color');
Just added a new widget to the sidebar: the AVH Amazon Wishlist. It randomly picks items from my Amazon wishlist. Anyone reading this can feel free to buy me something, though I don't expect that (except from Stanley; you know who you are). I think it's more interesting as an indicator of the sorts of things that interest me. It's mostly all there: judaica, programming, woodworking, cooking gadgets. Interestingly, virtually no medical books. All my medical references are online or on my PDA (uptodate, epocrates, Riley Kidometer, Pediatrics, Contemporary Pediatrics). The actual books I've used in years are the picture books (Hurwitz's Clinical Pediatric Dermatology, Smith's Recognizable Patterns of Human Malformation). Almost by definition, texts are obsolete by the time they reach the editor, let only when they are published. The doctors I know still have impressive bookcases filled with medical textbooks, but they're the ones they bought in medical school and haven't opened since.
Speaking of which, there's a new edition of Hurwitz out. Hint!
I decided that this blog is mine, rather than Young Israel's, so I wanted to move it to a domain that I personally own. Thus, it is no longer at youngisrael-stl.org/wordpress, but at bililite.com/blog. Moving the blog intact was non-trivial, so I'm recording how I did it, based on mydigitallife's instructions:
Create the new folder, bililite.com/blog/
Create a new mySQL database on bililite.com
Copy all of youngisrael-stl.org/wordpress/ into bililite.com/blog/
Edit the wp-config.php file to reflect the new database name/user/password
In a text editor, change all the "http://youngisrael-stl.org/wordpress" to "http://bililite.nfshost.com/blog" and "/wordpress" to "/blog". note that there are both absolute and relative URL's in there, and I was changing both the domain and the subdirectory, so I had to do two replacements. I couldn't just change "http://youngisrael-stl.org" because I didn't want to change links to the actual site.
Run the edited SQL file on the bililite.com database
In the youngisrael-stl.org/.htaccess , add the line "Redirect permanent /wordpress http://bililite.nfshost.com/blog" to let browsers know I've moved
I added keyboard accessibility to flexcal, based on the AOL style guide. Tabbing into the trigger for a textpopup makes it pop. The focus remains on the input element and requires another tab to put the focus on the calendar (a bit awkward to require two tabs but I didn't want to have the input element lose focus every time it gets it), and the escape key (or tabbing out) hides it.
Unfortunately, control-page up/down if used by Firefox to change its tabs and I can't override that, so I use alt-page up/down to skip years. Alt-left/right arrow changes calendars.
Unfortunately, the tabbing in and out doesn't work in Chrome; after tabbing out when the focus returns to the input element it won't leave. I'm not sure what the problem is. And it uses tabindex=0 which isn't supported by Safari at all. I think I will leave it as is and wait for the browsers to catch up to me.
Just checking. No reason it shouldn't work with the jQuery UI themeswitcher. The slot machine animation has a white background, which looks off with some themes. The text color for the dates unfortunately is (by the CSS specificity rules) overridden by the blog's text color, so dark themes are near unreadable.