Batch File with Self-Awareness

Batch file is a double-edged sword, the good side is that batch file runs on almost all of the Microsoft platforms, while the evil side is people just couldn’t get it right. At the highest level, batch file is interpreted by the command processor, which is cmd.exe or command.com. The interpreter is in charge of: Process escape sequences (e.g. caret). Expand…

1

Pop Quiz – JavaScript for Fun

Most people could write something in JavaScript, though they barely made it correct. I started using JavaScript while I was in school, and the project I gave myself was to implement a Scheme interpreter that runs in web browsers. As a result, I’ve realized the tight relationship between JavaScript and Scheme, I became a fan of JavaScript and…

0

Vector Deleting Destructor

Today one guy in my team asked a question regarding the behavior of delete[] operator in C++ – how does the program know it needs to call CBar::~CBar instead of CFoo::~CFoo? Note that the vector deleting destructor is a feature in Microsoft C++ Compiler, not required by the C++ standard. #define _CRTDBG_MAP_ALLOC #include <malloc.h> #include <crtdbg.h> class CFoo { public:   virtual ~CFoo() = 0; }; class CBar…

0

Undocumented Environment Variables

Although we have less Easter Eggs, there are still a huge number of undocumented behaviors. Recently I’m writing a CLR profiler using ICorProfilerCallback for fun, the CLR profiler was modeled as an in-proc COM server, and the activition was done through environment variables: SET COR_ENABLE_PROFILING=1 SET COR_PROFILER={XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} SET COR_PROFILER_PATH=”C:\FOO\BAR\MyProfiler.dll” Immediately I realized there must be a lot more…

0

The Pit of Success

The Pit of Success: in stark contrast to a summit, a peak, or a journey across a desert to find victory through many trials and surprises, we want our customers to simply fall into winning practices by using our platform and frameworks. To the extent that we make it easy to get into trouble we…

0

Error and Exception Revisited

Unless suffering is the direct and immediate object of life, our existence must entirely fail of its aim. It is absurd to look upon the enormous amount of pain that abounds everywhere in the world, and originates in needs and necessities inseparable from life itself, as serving no purpose at all and the result of…

0