May 25, 2008

C# Source Analysis tool

by

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

by

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

by
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.

Stylesheet:


<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<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:call-template>
<br/>
</xsl:for-each>
</xsl:template>
<xsl:template name="SplitText">
<xsl:param name="inputString"/>
<xsl:param name="delimiter"/>
<xsl:choose>
<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:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$inputString = ''">
<xsl:text></xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$inputString"/>
<xsl:text> </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>


XML file (to be transformed) :


<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="textSpliter.xslt"?>
<Paths>
  <Item>
    <Path>C:\ProgramFiles\SomeWierdSoftware</Path>
    <Delimiter>\</Delimiter>
  </Item>
</Paths>


Output: C: ProgramFiles SomeWierdSoftware
Hope it is useful.

String Split Template

by

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