..
It's you and me.. and billions of bugs.
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 the following ultra fast hack:
// Wrap around 2^10 int x = some_fn(x) & 1023;
This will wrap whatever x is, around 1024 limiter. For example if x is 1025, it will become 1. 1026 will turn over to 2 etc. Still better than:
x = some_fn(x); x = x > 1023 ? x - 1024 : x;

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. Read the rest of My darkish Komodo and QT Creator color schemes »
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 key formats are not compatible. If you are used to using ssh-keygen command line tool to generate your key pair, you will need to manually edit the public key in order to make it php openssl compatible. Read the rest of PHP and OpenSSL key format (“key parameter is not a valid public key”) »
Scaling up. For most people a nightmare area. What? How? Where? It usually comes down to how much money are you willing to spend and what is it that you actually need. Here is free as in free beer solution for all you geekz out there who need a simple load balancer and reverse proxy… oh and to allow for a convenient SSL wrapper for those Web servers that do not offer it natively. Guess you could go for nginx if you want – after using it for over a year it’s too bloated for what was needed. Pound came up as a far better solution.
Read the rest of POUND – Reverse proxy and load-balancer »
Another unpleasant experience with windows last week. (We’ll just disregard the notorious behaviour of Win installer which eradicates any previously installed foreign OS boot manager.)
Read the rest of Resurrect NTFS partition after Win XP reinstall »
Here is the story: if you happen to run Joomla! 1.0, which you should not but what the heck, you’ll run into some weird issues if there is PHP 5.3.x running on your server. Everything will work fine except for one thing – there will be no content at al on your web site. And no matter what you do content will be invisible. Since Joomla! 1.0.x is no longer being maintained you should either upgrade to Joomla! 1.5.x/1.6.x or apply this little hack below:
Replace:
$arguments = func_get_args();
with
$arguments = func_get_args();
$numargs = func_num_args();
for($i=1; $i < $numargs; $i++){
$arguments[$i] = &$arguments[$i];
}
in includes/Cache/Lite/Function.php. This should be OK till… well, till you upgrade. It’s not like they are going to fix it in Joomla! 1.0.
I use a few computers and I like to have pretty much the same $ENV on them. Using various rsync methods helps keeping $HOME synced. Yet, sometimes that $HOME is way too big for syncing via the Internet. And what if I’d like to sync just some programes and not the whole damn $HOME dir?
Read the rest of Syncing Firefox bookmarks and passwords »
I just realized that the latest Lighttpd you may find in FreeBSD ports (and in all Linux distros actually) is a bit buggy. Apparently there is an error in network.c which will crash your HTTPS.
Read the rest of Lighttpd and (network.c.529) SSL error »
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 needs.
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 from pulse, I could clearly kill and start it without any errors whatsoever. So, I let my xmms play a song, went to the Pulse configuration, to see if xmms gets registered as a valid audio stream. Guess what, the bars (vu-meters) were pulsing left to right decently meaning that sound was actually been streamed.
But still I couldn’t hear a thing.
I then tried changing the chosen output device profile in Preferences -> Sound -> Hardware -> Profile, but none of them helped. Googling around showed that dozens of people have experienced the same problem, and that there was not only ONE problem, but sometimes 2-3 different problems which pretty much looked alike.
Here are shortly the 2 problems I saw people complained about: Read the rest of M-Audio Audiophile 2496 on Ubuntu 9.10 = No sound!? »