In Qt 4.3.3, I found myself needing to use QRect instances as a key in a QHash. However, Trolltech provides no qHash() implementation for QRect, so I implemented this one, and I think it ought to cover the most common uses of QRect. What do you think? uint qHash(const QRect &rect) { uint code = […]
I’ve interviewed dozens of software engineers, mostly to fill positions involving C++. I’ve also interviewed for about a dozen positions involving C++ and lots of other technologies and languages. I thought I’d share some good on-the-phone interviewing techniques for the interviewer for C++ positions. Before you read this, you shoud know that my interviewing technique […]
Classic! Xkcd brings us the programmer’s version of “talk to the hand”: Commenting someone in Perl or Python requires two hands.
I have been struggling with this problem for a number of months. Here are the symptoms: Email sent to Hotmail via my SMTP server and Thunderbird never arrives, but I get no bounce message. Strangely, email sent to Hotmail via my SMTP server and the “mail” command arrives perfectly. Email sent as a reply to […]
I recently wrote a Qt-based application in C++ that relies heavily on the QGraphicsView framework that made its first public appearance in Qt 4.2. QGraphicsView has been the target of some criticism for poor performance. I am a long-time user of Qt3’s QCanvas class which served me very well, in performance terms, but that lacked […]
Parsing XML is fun again with Xerces progressive scan. Do you have large XML files that you need to parse in your GUI application? Are you sick of your XML parser blocking the event loop while it laboriously parses all that XML? Don’t waste another day! Xerces-C++ progressive scan was made for you, my friend.
Does your firewall block port 25 so you can’t use Thunderbird to send email? Do you have a Linux box on the open Internet? If so, you are in luck. I run Windows on my desktop, and I have a Linode machine that runs my email server. When I discovered that I was behind a […]
Today I discovered a nifty way to do socket programming in bash without the need for netcat (nc) or telnet: /dev/tcp. Say you want to connect to Google and fetch their front page. Just do this: exec 3/dev/tcp/www.google.com/80 echo -e “GET / HTTP/1.1\n\n” >&3 cat
I’ve seen some confusion online lately about the purpose of the “@” operator in PHP. Let’s figure out exactly what the “at operator” does. PHP holds your hand with error reporting during development by printing error messages to the user’s browser automatically when something goes wrong. This often looks something like this: Warning: mysql_connect() [function.mysql-connect]: […]
SpeedScheduler, a little Azureus plugin that I wrote a while back, was featured in an article that made Digg’s front page: Top Azureus Plugins Revealed. Scroll to the bottom of the article for a few screenshots and a little write up. That’s pretty nifty.