MochiKit is a Javascript library. PlotKit is a graphing library that builds upon it.
... until the collector arrives ...
This "blog" is really just a scratchpad of mine. There is not much of general interest here. Most of the content is scribbled down "live" as I discover things I want to remember. I rarely go back to correct mistakes in older entries. You have been warned :)
2006-10-11
2006-10-10
Javascript Split Function
I discovered a discrepency in the way that the Microsoft and Mozilla implementations of Javascript handle the 'split' function. Consider this expression:
"!abc!def!ghi!".split(/!/)
Mozilla returns an array with five elements, the first and last elements being empty strings. Microsoft returns only three elements, having dropped the first and last elements. Intuitively, Mozilla seems correct. The definition of split in the ECMA-262 standard is difficult to read, but appears to support Microsoft's interpretation.
WSH/HTA Droplet
Here is a template for a Windows script droplet that forwards its arguments to an HTA.
2006-10-03
Finding Extreme Values in XSLT
Here's a neat trick to find the maximum value for an element using XSLT:
<xsl:variable name="max-date">
<xsl:for-each select="/jira-work-activity/entry/date">
<xsl:sort order="descending"/>
<xsl:if test="position()=1"><xsl:value-of select="."/></xsl:if>
</xsl:for-each>
</xsl:variable>
Subscribe to:
Posts (Atom)