Author Archive

Dirty debug output in DeSmuMe

October 10, 2010

Looking for a printf replacement when coding NDS homebrew? Okay, (i)printf is nice, most of the time, but sometimes (actually quite often) you just can’t use it, be it for reasons like you’ve exhausted all video memory locations, or you need both screens, if you are coding something more complex than a simple effect, or [...]

Tags: , , , , , ,
Posted in C++, Linux, NDS | No Comments »

Crossplatform QueryPerformanceTimer

September 26, 2010

Here is a simple way to get high precision timer on both Linux and Windows (can’t remember where I saw parts of this code, but I hope wrapping it up and spreading it won’t make the author angry) : cross_platform_timer.h cross_platform_timer.cpp I added few helper wrappers to make the life easier, you can get current [...]

Tags: , , ,
Posted in BSD, C++, Linux, Unix, Win32 | No Comments »

error: ‘glActiveTextureARB’ was not declared in this scope

September 23, 2010

If this happens to you, you most likely have NVidia gfx card, and the set up has poked the gl.h. To remedy this without having to reinstall anything, just add this to your code, before calling #include : #define GL_GLEXT_PROTOTYPES 1 #include <GL/gl.h> For some reason th glActiveTextureARB prototype is under #ifdef GL_GLEXT_PROTOTYPES section. Adding [...]

Tags: ,
Posted in C++, OpenGL | No Comments »

Wrap numbers around power of 2 borders

September 3, 2010

I was working yesterday on some texture sampler, and recalled a simple thingy that was a great help back in the 90′s, which I completely forgot in recent years. If you have a counter, sampler or whatever that has to get wrapped around e.g. 256, 512 or any other power of two, you can use [...]

Tags: ,
Posted in Amiga, C++ | No Comments »

My darkish Komodo and QT Creator color schemes

July 17, 2010

You can download my Komodo and Qt Creator ‘dark’ themes from: http://www.modmancer.com/downloads/dev_blog/dew_dark.ksf http://www.modmancer.com/downloads/dev_blog/dew_dark.xml For Komodo: copy the Komodo theme to your ~/.komodoide/5.2/schemes folder. For Qt Creator 2.0: copy the Qt Creator theme to your ~/.config/Nokia/qtcreator/styles folder.

Tags: , , , , ,
Posted in C++, IDE, PHP, Qt, Qt Creator | 2 Comments »

PHP and OpenSSL key format (“key parameter is not a valid public key”)

July 7, 2010

PHP Warning: openssl_public_encrypt(): key parameter is not a valid public key in /script.php on line 175 If you experienced problems with OpenSSL and PHP, especially functions like openssl_pkey_get_public and openssl_pkey_get_private not willing to initialise from the provided public and private key strings, then you just need a few tweaks to get things running, because the [...]

Tags: , , , , ,
Posted in OpenSSL, PHP, Security | 1 Comment »

Resurrect NTFS partition after Win XP reinstall

June 9, 2010

The system was missing my partition E, or my Storage partition. It was wiped out. Storage manager denoted it as unallocated space. A quick reboot into Ubuntu ended up with same knowledge: Unallocated space.

No space for panic. Google comes, google helps. I found a marvelous little command line tool which was able to revamp my Storage NTFS partition in about 10 seconds. It’s called testdisk.

Tags: , , , , , , , , , , ,
Posted in Hard drive, OS, Sysadmin, Tools, Ubuntu, Unix | No Comments »

mysqldump rather than mysql Admin

May 20, 2010

If you are doing whole database backup & restore use mysql dump rather than mysql Admin tool, it will run *much* faster. mysqldump –verbose –compress –host -u USERNAME -pPASSWORD –databases DATABASE > ~/dumps/dump.sql If dragging data through network, use –compress flag. Also check the man pages of mysqldump, you might find interesting hints for different [...]

Tags: , ,
Posted in MySQL | No Comments »

M-Audio Audiophile 2496 on Ubuntu 9.10 = No sound!?

May 15, 2010

You have Ubuntu 9.10. You own M-Audio Audiophile 2496 audio interface. And you can’t hear a thing? I had to deal with this twice. First time it was when I upgraded my Ubuntu 9.04 to 9.10. Everything was fine, except: my 2496 Audiophile stopped playing any sound at all. Daemon.log didn’t show any errors coming [...]

Tags: , , , , , , , ,
Posted in Linux, Sound, Ubuntu, Ubuntu 9.10 | No Comments »

Grep intelligence – grep lines that DO NOT MATCH an expression

May 13, 2010

I have an apache access log that I need to monitor frequently while users do funny things, but the problem is 99% of the logged calls are some trivial ajax get requests which do stuff, like ‘check new messages’ which, when coming in from each user who has opened the page each second, tend to [...]

Tags: , , ,
Posted in Apache, Linux, OS, Server, Shell, Unix | No Comments »