Cognitive Daily, one of the best physcology blogs around, announced they will no longer be posting anything new.
I've been reading Cognitive Daily since I was in high school and I'm very saddened to see it go.
Sunday, January 24, 2010
Tuesday, January 5, 2010
Useful google search tip
One way to avoid Google getting "too smart" about your search query is to purposely misspell words. Sometimes I've found more relevant results when I do that. The misspelling has to be close to the original word though.
Sunday, January 3, 2010
xslt: != vs not()
I made a minor change to my xslt file. I often write "stub questions" in my FAQ to remind myself to answer them. I added a simple attribute to the "item" element
This creates an optional attribute "stub" that is a string which could either be "true" or "false" and is by default "false".
That wasn't too hard to figure out. The harder part was getting my XSLT file to only display non-stub questions.
My first try was
This however never showed any of my questions. It turns out that != doesn't work when an element doesn't exist. After asking around on IRC
<xs:attribute name="stub" default="false">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="true"/>
<xs:enumeration value="false"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
This creates an optional attribute "stub" that is a string which could either be "true" or "false" and is by default "false".
That wasn't too hard to figure out. The harder part was getting my XSLT file to only display non-stub questions.
My first try was
<xsl:if test="@stub != 'false'">
(I used != because of the default).This however never showed any of my questions. It turns out that != doesn't work when an element doesn't exist. After asking around on IRC
<xsl:if test="not(@stub = 'true')">
appears to be the correct way to do things.
Subscribe to:
Posts (Atom)