getElementsByClassName not working [duplicate]

There are several issues: Class names (and IDs) are not allowed to start with a digit. You have to pass a class to getElementsByClassName(). You have to iterate of the result set. Example (untested): <script type=”text/javascript”> function hideTd(className){ var elements = document.getElementsByClassName(className); for(var i = 0, length = elements.length; i < length; i++) { if( … Read more

How to give dynamic file name in the appender in log4j.xml

It’s much easier to do the following: In log4j.xml define variable as ${variable}: <appender name=”FILE” class=”org.apache.log4j.FileAppender”> <param name=”File” value=”${logfilename}.log” /> <layout class=”org.apache.log4j.PatternLayout”> <param name=”ConversionPattern” value=”%d::[%t]::%-5p::%c::%x – %m%n” /> </layout> </appender> Then make sure you set the system property when you start your JVM such as: java -Dlogfilename=my_fancy_filename example.Application That will create a dynamic log file … Read more

Why no variable size array in stack?

Variable Length Arrays(VLA) are not allowed in C++ as per the C++ standard. Many compilers including gcc support them as a compiler extension, but it is important to note that any code that uses such an extension is non portable. C++ provides std::vector for implementing a similar functionality as VLA. There was a proposal to … Read more