A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Jump to

Quick reference

Showing posts with label case. Show all posts
Showing posts with label case. Show all posts

Lowercasing in XSL

translate(field_to_change, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz').

Case sensitive MySQL column

Make a case sensitive varchar column:

CREATE TABLE `page_dm` (
`url` varchar(500) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

http://dev.mysql.com/doc/refman/5.0/en/case-sensitivity.html
http://dev.mysql.com/doc/refman/5.0/en/create-table.html

Upper and lowercase in vi

Select the text you want using visual mode, then type U for uppercase or u for lowercase.

XSL de-duping

example:

<xsl:choose> <xsl:when test="/session/dataset = 'news'"> <xsl:for-each-group select="item" by="lower-case(title)"> <xsl:apply-templates select="current-group()[1]"> </xsl:apply-templates></xsl:for-each-group> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="item[title != '']"> </xsl:apply-templates></xsl:otherwise>
</xsl:choose>