A helpful self review
Was just looking through an (unfinished) project I was working on with someone last year. I was busting my ass on making a bridge between the TALib technical analysis library (http://ta-lib.org/) and ruby. I was about 60% done on the bridge (about 2000 lines of code) when my partner bailed on me and I lost motivation to work on the project.
Looking back on the code I’m pretty impressed by what I was able to pull off considering I hadn’t written C in years and my Ruby knowledge was still pretty infantile. Here’s a tasty snippet to give you an example of what its like converting from C typedefs to Ruby built in types:
// TODO - Make the memory allocation relative to calculated size from lookback
void **c_output = (void *)malloc(sizeof(void *) * funcInfo->nbOutput);
const TA_OutputParameterInfo *outputParamInfo;
for (i = 0; i < funcInfo->nbOutput; i++) {
TA_GetOutputParameterInfo(funcInfo->handle, i, &outputParamInfo);
switch(outputParamInfo->type) { // type
case TA_Output_Real:
c_output[i] = (TA_Real*)malloc(sizeof(double) * endIdx);
retcode = TA_SetOutputParamRealPtr(paramHolder, i, c_output[i]);
break;
case TA_Output_Integer:
c_output[i] = (TA_Integer*)malloc(sizeof(int) * endIdx);
retcode = TA_SetOutputParamIntegerPtr(paramHolder, i, c_output[i]);
break;
default:
return INT2FIX(“666”);
}
if (retcode != TA_SUCCESS) {
return INT2FIX(retcode);
}
}
Nothing super impressive or whatever but it was fun to look at what I did in a very short time as encouragement to continue working on and learning things and proof to myself that I am capable to those things that I’m sheepish to start doing.
…
Oh wow this Youtube video is great! LOLLOLOLOFLOLFOLOLORLOLFORFLORL“
I tried to highlight the url but accidentally poofed the entire address block away.
No biggie. I never have to type anything anyway.
Tsk Tsk! Should never be clicking on the URL. Command+L is your friend!
“…it isn’t what you drive that matters, it’s how you drive it.”
And to sum up the conclusion that any logical person would come to in regards to the Big Religions, and what I figured out when I was 10 years old sitting in Catholic mass…
Note: I’m 100% cool with niche/philosophical “religions” (spirituality) that encourage the growth of humanity in a forward thinking manner and that don’t allow room for nutty evangelism. It’s the fucked up ones like Islam and Christianity that ruin everything (though fuck all if they haven’t produced some badass art).
At least I can see the sun.