Using Detours and Hooks to screen shot a DirectX 11 Game

I have been playing with Detours and DLL injection to take screen shots inside a game a-la-FRAPS.

According to the literature this method seems to be the least frowned upon.

The motivation is to generate screen shots of a game to train a OpenCV haar classifier to detect objects in the screen. This has already been done successfully offline.

I moved the repository here:


PHP Stata on PHP 7

Latest projects (off the clock) have involved: React, GraphQL (with Relay or with Redux) and Feathers.

PHP Stata got an update to work on PHP 7

New branch available at

Data collection on Mechanical Turk

I got together with a couple of my co-workers at the RAND Corporation and we did a study on Mechanical Turk. It got accepted on the Society for Research on Nicotine and Tobacco Annual Meeting (2015).

What: Consumer Perceptions of E-cigarettes: A comparison of Smokers and Non-Smokers in a Mechanical Turk Sample

Tools: Custom made data collection tool using PHP Symfony, Doctrine on MySQL, and Python/boto for automating the payments and HIT publishing.

PHP Stata Extension

After a long hiatus and a move to the US I finally had time to update my blog. I created a nice piece of code, a PHP Extension. This extension lets you read and write Stata files directly on your php code and at very good speeds. It still needs optimization but it is a very useful piece of code, specially for sites that deal with economics or social science data sets. You can get the code from my Github repository.

Calling SAS Web Services from C#

Something as trivial as setting a web service client on Visual Studio takes a new meaning when referring to SAS. Don't get me wrong, SAS is a great statistical tool but their implementation of Web Services despite being set on top of JBoss (an excellent app/web container) is disastrous. Add to that the fact that their working examples from using C# were written for Visual Studio 2005.

Mongo is fun

These past months I have been working for a client based in NY and we have been developing a CMS platform. The interesting part is the database we have used has been Mongo. Mongo makes databases fun. No more having to go to phpmysqladmin to recreate or drop tables, alter them, you just code and change the database as you go along. Your database just works.


Subscribe to mapleman's Code & Stuff RSS