Scriba is a Mathematica-style document-centric interface to BSF languages. It ships with BeanShell, HTML, JRuby, and JScheme pre-installed. Any JSR-223 compatible engine can be plugged in. See, for example, the list of such engines in the java.net scripting project.
... until the collector arrives ...
2008-08-20
2008-08-09
Excessive Hardware Interrupts
Windows recently told me it had found a bad block on my disk drive. I ran a disk check and told it to fix bad blocks. Presumably, the bad block had been spared out. However, my computer's performance was awful. I tried the usual dance -- clean up, defrag, ensure the page file was contiguous in a good spot -- but performance was still awful.
CPU usage was running at a background level of 10-20%. Process Explorer attributed this CPU to "Hardware Interrupts". A bit of Googling led me to this blog entry:
Little-Known Tweak to Boost Hard Drive Performance!
In short, after Windows has noted six I/O errors on a controller, it pins that controller to programmed I/O mode (PIO). You can check this by looking at the properties of the disk controller in the Device Manager. The only way to re-enable DMA mode is to perform some registry hacks under the key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E96A-E325-11CE-BFC1-08002BE10318}
Find the sub-key associated with the controller in question (e.g. the primary IDE channel). Then:
- delete
MasterIdDataCheckSum
(if present) - delete
SlavedIdDataCheckSum
(if present) - add
ResetErrorCountersOnSuccess
(DWORD) = 1 (if desired) - set any or all of the following capability masks to 0xFFFFFFFF (if
present):
MasterDeviceTimingMode
MasterDeviceTimingModeAllowed
SlaveDeviceTimingMode
SlaveDeviceTimingModeAllowed
UserMasterDeviceTimingModeAllowed
UserSlaveDeviceTimingModeAllowed
- reboot
After rebooting, check to see whether the relevant controller has reverted to DMA mode. If so, your problem is probably solved (unless the hardware is truly gacked).
2008-08-06
SQL Server Comments vs Line Terminators
If you use the '--' comment syntax in SQL Server, the comment extends to the end of the line. The question is: what constitutes the end of the line. It turns out that SQL Server does not count a single return character as the end of line, so the following line(s) might be gobbled up into the comment.
It would seem that lines that end solely with a return character wouldn't happen in practice, at least on Windows. However, if can happen if you are using the combination of HTA, DOM, Javascript and ADO. If you extract the text content of an HTML element using DOM, then line terminators that are expressed as \r\n on disk are converted to \r in memory. It is necessary to fix up such line endings before feeding the string to ADO if the SQL text contains any '--' comments.