Date operations on xsl 1.0

Adding/subtracting number of days to/from date in pure XSLT 1.0: <xsl:stylesheet version=”1.0″ xmlns:xsl=”http://www.w3.org/1999/XSL/Transform”> <xsl:output method=”xml” version=”1.0″ encoding=”UTF-8″ indent=”yes”/> <xsl:param name=”givenDate” select=”‘2014-05-13T00:00:00′”/> <xsl:param name=”daysDiff” select=”-3″/> <xsl:variable name=”JDN”> <xsl:call-template name=”JDN”> <xsl:with-param name=”date” select=”$givenDate” /> </xsl:call-template> </xsl:variable> <xsl:variable name=”newDate”> <xsl:call-template name=”GD”> <xsl:with-param name=”JDN” select=”$JDN + $daysDiff” /> </xsl:call-template> </xsl:variable> <xsl:template match=”https://stackoverflow.com/”> <output> <GivenDate><xsl:value-of select=”$givenDate”/></GivenDate> <NewDate><xsl:value-of select=”$newDate”/></NewDate> </output> </xsl:template> … Read more

The operation has timed out at System.Net.HttpWebRequest.GetResponse() while sending large number of requests to a host

ServicePointManager.DefaultConnectionLimit limits the number of outgoing web requests to a given server. The default is generally 2 or 10. If you are making 50 parallel calls to that web service, you should set ServicePointManager.DefaultConnectionLimit (at app startup) to a larger number (e.g. 40-50). Additionally, you are not calling Close or Dispose on request. You should … Read more

Is addition of byte converts to int because of java language rules or because of jvm?

if java supports byte datatype then why operation on byte results int Because that’s how the Java Virtual Machine is designed. There is no instruction set to perform operation on a byte type. Rather the instruction set for int type is used for the operation on boolean, byte, char, and short types. From JVM Spec … Read more

Why do these two multiplication operations give different results?

long oneYearWithL = 1000*60*60*24*365L; long oneYearWithoutL = 1000*60*60*24*365; Your first value is actually a long (Since 365L is a long, and 1000*60*60*24 is an integer, so the result of multiplying a long value with an integer value is a long value. But 2nd value is an integer (Since you are mulitplying an integer value with … Read more