This has been haunting me for quite some time. When building Qt app for Windows, the QImage::save() function did not work for JPEG for deployed applications, while it did work if Qt SDK was installed on the machine. Continue reading →
To turn your box into a dev web server is pretty simple, yet I’ve seen people struggling with this over and over again, so here’s a simple TODO list.
I won’t go over the likes of Apache installation, VirtualHost setup, .htaccess settings, etc. as you can find these online very easily, and might be specific to the needs of your project.
Most of the time I see people using localhost:8080 and a myriad of other ports to work on several sites locally; but you might as well work on http://www.myproject.com locally in just 2 simple steps:
Create a VirtualHost in Apache which goes by “the name” http://www.myproject.com, by including the following within the definition:
# all the other options and definitions ...
“Register” the domain name locally – simply add the following line to your /etc/hosts file (on Windows, this file is typically located under [Windows]/System32/Drivers/etc):
Now enable the VHost in Apache, restart Apache, and open http://www.myproject.com in the browser, and you’re ready to code off!
Note: The VHost name need not be a valid domain name – feel free to use myproject as ServerName and in /etc/hosts; just beware that some browsers will try to search for “myproject” instead of opening the local site. In such case, type in the whole http://myproject.
Fortunately, both of these are deprecated in new versions of PHP.
Unfortunately, most hostings are not that keen on updating PHP to the newest version (mainly they’re still stuck at the likes of version 5.1.x).
MySQL does not support create user if not exists syntax as it does with create table and create procedure. This is pretty weird, as it just boils down to checking whether single row exists in the `mysql`.`user` table.
Often “in the wild”, even in English texts, you meet both accented versions and non-accented versions of certain words, such as brand names.
You’re then facing two options – you can either work with both versions, or get rid of accents. The latter option bears advantage of cutting down the dimensionality of the problem, as you don’t need to presume that you support all existing versions of the spelling, but how to get there?
After years of using VMWare, I suddenly had to migrate to VirtualBox; I’ve been using VirtualBox for quite some time now, but not in the way I use VMWare.
First I thought it will be a short-lived trip, but now I’m happily stuck. I still had the image of VBox the way it was in the version 1.x in the head. What a blow it was to fully explore 4.x, in my case 4.0.6!
Here are few optimization techniques that were handy to me recently; they mostly concern 2D graphics programming, where these patterns often emerge, but are helpful anywhere where you have to iterate and update data.