about Tools
Tools amplify your talent. The better your tools, and the better you know how to use them, the more productive you can be.
The Pragmatic Programmer: From Journeyman to Master
Andrew Hunt (Author), David Thomas (Author)
Tools amplify your talent. The better your tools, and the better you know how to use them, the more productive you can be.
The Pragmatic Programmer: From Journeyman to Master
Andrew Hunt (Author), David Thomas (Author)
if (fruit== "apple") { ... } // hidden malloc
if (fruit== QLatin1String("apple")) { ... } // fast and mentions encoding
if (foo.startsWith("(" + type + ") 0x"))
if (foo.startsWith("(" % type % ") 0x"))
QThread was designed and is intended to be used as an interface or a control point to an operating system thread, not as a place to put code that you want to run in a thread. We object-oriented programmers subclass because we want to extend or specialize the base class functionality. The only valid reasons I can think of for subclassing QThread is to add functionality that QThread doesn’t have, e.g. perhaps providing a pointer to memory to use as the thread’s stack, or possibly adding real-time interfaces/support. Code to download a file, or to query a database, or to do any other kind of processing should not be added to a subclass of QThread; it should be encapsulated in an object of it’s own.
// create the producer and consumer and plug them together Producer producer; Consumer consumer; bool bOk = producer.connect(&consumer, SIGNAL(consumed()), SLOT(produce())); Q_ASSERT(bOk); bOk = consumer.connect(&producer, SIGNAL(produced(QByteArray *)), SLOT(consume(QByteArray *))); Q_ASSERT(bOk); // they both get their own thread QThread producerThread; producer.moveToThread(&producerThread); QThread consumerThread; consumer.moveToThread(&consumerThread); // go! producerThread.start(); consumerThread.start();
Reference: Threading without the headache or QThread’s no longer abstract (see attached file)
Many people don’t think of their command prompt as a particularly useful thing, or even pay it much attention. To me, this is a bit of a shame, as a useful prompt can change the way you use the command line. Well I’ve scoured the Interwebs looking for the best, most useful, or sometimes most amusing bash prompts. Here, in no particular order, are the ones I’d be most likely to use on my computers.
The QT Creator reference card is a handy reference designed to assist your use of Qt Creator. It is available in Windows/Linux as well as Mac versions and for ease of printing comes in A4 and US letter formats.
To get to the SendTo folder, you’ll need to open up an Explorer window, and then paste in the following to the address bar.
%APPDATA%\Microsoft\Windows\SendTo
%APPDATA% is an environment variable that actually maps to something like C:\users\<username>\AppData\Roaming.
Also, common “SendTo” menu is located here: C:\Users\Default\AppData\Roaming\Microsoft\Windows\SendTo
Additional:
Windows 7 may be Microsoft’s most anticipated product ever. It builds on Windows Vista’s positives, and eliminates many of that OS’s negatives. It adds new functionality, too—all in a package that is less resource-hungry than its predecessor.
And whether or not you’re upgrading from Vista or skipping it altogether and moving up from Windows XP, you’ll need to know how to make the most of it in your environment. Here are 77 tips and tricks to get you there.
Causes the compiler to output a list of the include files. Nested include files are also displayed (files that are included from the files that you include).
When an include file is encountered during compilation, a message is output, for example:
Note: including file: d:\MyDir\include\stdio.h