If you have a link to download a file (e.g. a piece of software), you may want to redirect to another page after the user clicks the link, perhaps to gather download statistics or display a message to the user. Setting the window.location in an onclick event for that link does not work, as the [...]
The power of printf reveals all. Hmm.
It doesn’t crash though. Weird graphical excitations occur instead. Bugs which cause crashes are the *nice* ones. This is far more insidious.
Posted on April 17, 2009, 9:18 pm, by Daniel, under
programming.
I needed to average a lot of large values and was afraid that the normal approach of a+b+c..etc/N would overflow or something.
So here’s a C++ class to keep a running average:
class InfiniteRunningAverage
{
double average;
double valueCount;
public:
InfiniteRunningAverage()
{
average = 0.0;
valueCount = 1;
}
void Add(double value)
{
average = average * ((valueCount-1.0)/valueCount) + value * (1.0/valueCount);
valueCount += 1.0;
}
double Get()
{
return average;
}
};
Hmm. I guess eventually [...]
Posted on March 1, 2009, 5:09 pm, by Daniel, under
programming.
Hmm, I just got this error after running make:
process_begin: CreateProcess(NULL, cc -MMD -D_DEBUG -DdSINGLE -DWIN32 -DODE_DLL
-DdSINGLE -I../../include -I../../ode/src -I../../ode/src/joints -I../../OPCODE
-I../../GIMPACT/include -I../../ou/include -g -o obj/DebugSingleDLL/ode/fastlsol
ve.o -c ../../ode/src/fastlsolve.c, …) failed.
make (e=2): The system cannot find the file specified.
make[1]: *** [obj/DebugSingleDLL/ode/fastlsolve.o] Error 2
make: *** [ode] Error 2
After unsuccessfully searching the ODE mailing list archives for “fastlsolve”, google revealed [...]