DAtum

Entrepreneurship, Software and the business of technology

Category Archives: c++

“Program the way, John does”

Carmack. id Software coding standards were basically “program the way John does” … I had been harboring some suspicions that our big codebases might benefit from the application of some more of the various “modern” C++ design patterns, despite seeing other large game codebases suffer under them. I have since recanted that suspicion. Pure glory. [...]

A Business case for Infosys to deploy its “bench” towards FOSS

This is an open letter to several of India’s IT offshoring companies, who are suffering the problem of too much idle manpower to utilize this lean period to contribute towards Free and Open Source Software and in the process gather free PR and Marketing, as well as expose their employees to excellent mentorship. Dear Project [...]

The evolution of C++: Why pointer to data members

The anser: I dont know…. But I needed to find out. It all started when I was reading my copy of Design and Evolution of C++ by Stroustrup himself. It is a superlative work on the design process behind (arguably) the most popular language on the planet. In one of the topics [13.11] I was [...]

Multithreading paradigms: windows and *nix

Before we visit this topic, let us go off-topic for a bit: let us examine the CFS scheduler (part of the Linux GIT tree after 2.6.22) and the round robin Windows scheduler. The Ingo Molnar developed CFS (Completely Fair Scheduler – inspired by Con Kolivas’ SD scheduler) maintains a RB-Tree of “wait_runtime”. When a task’s [...]

Please sir, CUDA have some more??

The first I read about PhysX was because of dear ole’ Gordon Freeman‘s crowbar - which captivated me for weeks. Then I read about it getting acquired by nVidia … yawn. And then I discover its physics platform was going to be patched in Geforce 8xxx series using CUDA. Huh? What platform allows you to add physx capabilities to a graphics card, after it is manufactured. That’s when I read about CUDA- nVidia’s GPGPU (General Purpose GPU) intitiative. By architecting the chip to have elements that can be addressed individually (by reading this, I would say those are the stream processors) and providing a C-level API for it, it throws the field wide open to morph the GPU into something absolutely customized for myriad applications. AMD/ATI does have its initiative - If I’m not wrong, it is called Close to Metal , however I am not sure about the maturity ofits compilers vs Nvidias.

GIT the hell out of here

Since, several open-source projects are getting hosted using distributed version-control-systems like Mercurial (my favorite) and GIT , I had to build GIT on my laptop to check out a particular repository. Now, I had to build it on Ubuntu Gutsy with http support (so I can pull and push via a remote repository). This meant [...]

Running Glibc 2.3 apps on Redhat 7.2

Working in a software firm with its baseline support at Redhat 7.2 certainly is hard – you have to make do with several apps that are old or forgo them altogether. For all its opensource cred, Firefox 2.0 doesnt have an out-of-the-box build that works on Glibc 2.1 . However, Opera 9 does (praise their souls). [...]

STL and its trees

Very recently I had a problem with STL maps and the way it organizes data – come to think of it, it was an incorrect way of using it. So the premise is simple – Have a composite class pointer  be the index into the map. The composite class can be constructed in very funky [...]

Explicit construction of class object (not pointer to class object)

Consider the following piece of code: #include <stdio.h> #include <stdlib.h> using namespace std; class SSS{ public: SSS(){ printf("Calling constructorn"); } }; typedef struct test{ SSS s1; }test; int main(){ test *t1; t1=(test*)malloc( sizeof(test)*1); return 0; } Does the constructor of the class get called? Nope. Then how do you do it. The problem is, how [...]

Function pointers: number of parameters mismatch

Here is a strange quirk of gcc – It ignores number-of-parameter mismatch if we use function pointers, if and only if we pass more arguments than necessary. Consider the following piece of code #include <stdio.h> typedef int (*myFunc)(int a, int b); int func1(int a){ printf(“In func1 n”); } int func2(int a, int b){ printf(“In func2 [...]

Follow

Get every new post delivered to your Inbox.