const BOOL ShowAllControls=TRUE;
if(somecondition() || ShowAllControls) {
}
else {
}
crosspost at code_wtf
Doing things exactly the right way
const BOOL ShowAllControls=TRUE;
if(somecondition() || ShowAllControls) {
}
else {
}
#include <stdio.h>
int main(int argc,char* argv[]) {
int a = 3["magic"];
int b = *(3+"magic");
int c = "magic"[3];
printf("a = %d\nb = %d\nc = %d\n",a,b,c);
}
strengths:
* Base constructions and syntax of the language.
* Work with memory.
* Standard library.
* Type casting and information about RTTI.
* Common questions about programming in C++.
* The difference between C++ and C.
* Namespace and scope.
* Questions about code efficiency.
weaknesses:
* Type casting and information about RTTI (the continuation).
Acquire
{
// HTTP method configuration
http
{
Proxy "http://user:pass@proxy_ip:port";
Timeout "30";
};
};
<!-- html output -->
<xsl:template name="html-wrapper">
<xsl:param name="contents">
<xsl:apply-templates/>
</xsl:param>
<xsl:result-document method="html" indent="yes" href="{concat(local-name(),'_',@name,'.html')}">
<html><body>
<xsl:copy-of select="$contents"/>
</body></html>
</xsl:result-document>
</xsl:template>
<xsl:template match="Chapter">
<xsl:call-template name="html-wrapper">
<xsl:with-param name="contents">
<-- some context there-->
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="Part">
<xsl:call-template name="html-wrapper">
<xsl:with-param name="contents">
<-- some context there-->
</xsl:with-param>
</xsl:call-template>
</xsl:template>
and so on