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: C++, debug, desmume, emulation, memory, nds, nds printf replacement
Posted in C++, Linux, NDS |
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: C++, Linux, QueryPerformanceTimer, Win32
Posted in BSD, C++, Linux, Unix, Win32 |
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: C++, OpenGL
Posted in C++, OpenGL |
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: C++, hacks
Posted in Amiga, C++ |
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: color scheme, dark theme, IDE, Komodo, Qt Creator, theme
Posted in C++, IDE, PHP, Qt, Qt Creator |
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: OpenSSL, openssl_pkey_get_public error, PHP, private key, public key, ssh
Posted in OpenSSL, PHP, Security |
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: hard disk, installation, lost partition, ntfs, partition, reinstallation, resurrect, salvage, testdisk, Ubuntu, windows, windows xp
Posted in Hard drive, OS, Sysadmin, Tools, Ubuntu, Unix |
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: database dump, mysql admin, mysqldump
Posted in MySQL |
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: 2496, audio, audiophile, karmic koala, m-audio, pulse, pulse audio, sound driver, Ubuntu
Posted in Linux, Sound, Ubuntu, Ubuntu 9.10 |
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: bash, regexp, regular expression, tail
Posted in Apache, Linux, OS, Server, Shell, Unix |