May 25, 2008

C# Source Analysis tool


Microsoft has announced release of a new developer tool, Source Analysis for C#. This tool will help teams enforce a common set of best practices for layout, readability, maintainability, and documentation of C# source code. Source Analysis is similar in many ways to Microsoft Code Analysis tool FxCop, but there are some clear distinctions. FxCop performs its analysis on compiled binaries, while Source Analysis analyzes the source code directly. For this reason, Code Analysis focuses more on the design of the code, while Source Analysis focuses on layout, readability and documentation.

download tool

May 18, 2008

Hyderabad Traffic


I just had a near death experience today riding my bike to office. And tell you what, it is not something new in Hyderabad.Whether you see a BMW or some tin can with wheels, you have a maverick driver behind the wheel. Where on earth do you find traffic rules that are applicable only from 8 am to 8 pm? And if you try to follow these "nonexistent" rules, others make you look like a chump. There is total disregard for others' safety. Traffic signals do not mean anything more than blipping lights around the corner. It’s quite frustrating to see even so called educated people practicing these sort of “senseless” driving. I don't figure whether it's just a mad rush or men trying to get their pregnant wives to a hospital, everyone seems to be in crisis to reach "somewhere" in a jiffy.

We are witnessing Hyderabad developing into a Cosmopolitan (at least people say so..), it’s about time we have matching traffic etiquettes.

May 16, 2008

XSL template to split string

Finally came up with a xslt template that would split a delimited string into substrings.
I don’t claim it’s the smartest script, but surely solves my problem.


<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="">
<xsl:template match="/">
<xsl:for-each select="Paths/Item">
<xsl:call-template name="SplitText">
<xsl:with-param name="inputString" select="Path"/>
<xsl:with-param name="delimiter" select="Delimiter"/>
<xsl:template name="SplitText">
<xsl:param name="inputString"/>
<xsl:param name="delimiter"/>
<xsl:when test="contains($inputString, $delimiter)">
<xsl:value-of select="substring-before($inputString,$delimiter)"/>
<xsl:text disable-output-escaping = "no"> </xsl:text>
<xsl:call-template name="SplitText">
<xsl:with-param name="inputString" select="substring-after($inputString,$delimiter)"/>
<xsl:with-param name="delimiter" select="$delimiter"/>
<xsl:when test="$inputString = ''">
<xsl:value-of select="$inputString"/>
<xsl:text> </xsl:text>

XML file (to be transformed) :

<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="textSpliter.xslt"?>

Output: C: ProgramFiles SomeWierdSoftware
Hope it is useful.

String Split Template


I want an XSL template which would split a given string. Spent a hell lot of time searching on net, but could not find one that would solve my problem.

So I have decided I will write one myself.

Hmm ..

May be tomorrow.


Top Ad 728x90