Давно мучала эта проблема, кто из них старше. Найду время и возможность обратиться к печатным изданиям, проверю. А сейчас вот что нашлось в Интернете:
МГУ: 1755
СПбГУ 28 января 1724 г.
Friday, November 14, 2008
Monday, November 10, 2008
Regular expressions
Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems. — Jamie Zawinski
source: http://thedailywtf.com/Articles/Now-I-Have-Two-Hundred-Problems.aspx
P.S. Last week I faced a problem, where unwanted lines in a textual template should have been deleted in memory, so guess what I have chosen to accomplish the task.
source: http://thedailywtf.com/Articles/Now-I-Have-Two-Hundred-Problems.aspx
P.S. Last week I faced a problem, where unwanted lines in a textual template should have been deleted in memory, so guess what I have chosen to accomplish the task.
Controlled waste and garbage disposal
Everyone has their own place in the world
Monday, November 3, 2008
xslt adventure
Hi,
As good things are good to replicate, I would like to send my regards andcopy-paste replicate this hashtable implementation by Mukul Gandhi:
Want to dive into more of such advanced things done with xslt? Go ahead!
As good things are good to replicate, I would like to send my regards and
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" />
<xsl:template match="/">
<xsl:call-template name="getValue">
<xsl:with-param name="hashtable" select="'key:a,1,2,3,4,key:b,5,6,7,key:c,8,9'" />
<xsl:with-param name="key" select="'b'" />
<xsl:with-param name="delim" select="','" />
</xsl:call-template>
<xsl:text>-------------------------- </xsl:text>
<xsl:call-template name="getValue">
<xsl:with-param name="hashtable" select="'key:1,1,2,3,4,key:2,5,6,7,key:3,8,9'" />
<xsl:with-param name="key" select="'3'" />
<xsl:with-param name="delim" select="','" />
</xsl:call-template>
<xsl:text>-------------------------- </xsl:text>
<xsl:call-template name="getValue">
<xsl:with-param name="hashtable" select="'key:1,a,key:2,b,key:3,c'" />
<xsl:with-param name="key" select="'3'" />
<xsl:with-param name="delim" select="','" />
</xsl:call-template>
<xsl:text>-------------------------- </xsl:text>
<xsl:call-template name="enumerateKeys">
<xsl:with-param name="hashtable" select="'key:1,1,2,3,4,key:2,5,6,7,key:3,8,9'" />
<xsl:with-param name="delim" select="','" />
</xsl:call-template>
<xsl:text>-------------------------- </xsl:text>
<xsl:call-template name="enumerateKeys">
<xsl:with-param name="hashtable" select="'key:1,qwert'" />
<xsl:with-param name="delim" select="','" />
</xsl:call-template>
<xsl:text>-------------------------- </xsl:text>
<xsl:call-template name="enumerateKeyValuePairs">
<xsl:with-param name="hashtable" select="'key:1,qwert'" />
<xsl:with-param name="delim" select="','" />
</xsl:call-template>
<xsl:text>-------------------------- </xsl:text>
<xsl:call-template name="enumerateKeyValuePairs">
<xsl:with-param name="hashtable" select="'key:fruits,apple,guava,key:flowers,rose,sunflower'" />
<xsl:with-param name="delim" select="','" />
</xsl:call-template>
<xsl:text>-------------------------- </xsl:text>
</xsl:template>
<xsl:template name="getValue">
<xsl:param name="hashtable" />
<xsl:param name="key" />
<xsl:param name="delim" />
<xsl:if test="contains(substring-after($hashtable, concat('key:', $key, $delim)), 'key:')">
<xsl:value-of select="substring-before(substring-after($hashtable, concat('key:', $key, $delim)), concat($delim, 'key:'))" /><xsl:text> </xsl:text>
</xsl:if>
<xsl:if test="not(contains(substring-after($hashtable, concat('key:', $key, $delim)), 'key:'))">
<xsl:value-of select="substring-after($hashtable, concat('key:', $key, $delim))" /><xsl:text> </xsl:text>
</xsl:if>
</xsl:template>
<xsl:template name="enumerateKeys">
<xsl:param name="hashtable" />
<xsl:param name="delim" />
<xsl:if test="contains($hashtable, $delim)">
<xsl:if test="starts-with(substring-before($hashtable, $delim), 'key:')">
<xsl:value-of select="substring-after(substring-before($hashtable, $delim), 'key:')" /><xsl:text> </xsl:text>
</xsl:if>
<xsl:call-template name="enumerateKeys">
<xsl:with-param name="hashtable" select="substring-after($hashtable, $delim)" />
<xsl:with-param name="delim" select="$delim" />
</xsl:call-template>
</xsl:if>
<xsl:if test="not(contains($hashtable, $delim))">
<xsl:if test="starts-with($hashtable, 'key:')">
<xsl:value-of select="substring-after($hashtable, 'key:')" /><xsl:text> </xsl:text>
</xsl:if>
</xsl:if>
</xsl:template>
<xsl:template name="enumerateKeyValuePairs">
<xsl:param name="hashtable" />
<xsl:param name="delim" />
<xsl:if test="contains($hashtable, 'key:')">
<xsl:if test="starts-with(substring-before($hashtable, $delim), 'key:')">
Key : <xsl:value-of select="substring-after(substring-before($hashtable, $delim), 'key:')" />
<xsl:variable name="val">
<xsl:call-template name="getValue">
<xsl:with-param name="hashtable" select="$hashtable" />
<xsl:with-param name="key" select="substring-after(substring-before($hashtable, $delim), 'key:')" />
<xsl:with-param name="delim" select="$delim" />
</xsl:call-template>
</xsl:variable>
Value: <xsl:value-of select="$val" />
<xsl:text> </xsl:text>
<xsl:call-template name="enumerateKeyValuePairs">
<xsl:with-param name="hashtable" select="substring-after($hashtable, normalize-space(concat(substring-before($hashtable, $delim), $delim, substring($val, 1, string-length($val) - 1), $delim)))" />
<xsl:with-param name="delim" select="$delim" />
</xsl:call-template>
</xsl:if>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
Want to dive into more of such advanced things done with xslt? Go ahead!
Subscribe to:
Posts (Atom)