Tag: c++

CRecentLocationsDialog

Recent locations dialog is an improved version of standard open/save file dialog. It features lists of 100 most recently accessed folders and files for easier navigation among commonly used resources. Double-clicking on a folder item or selecting an item from the folders list and clicking Browse button below launches a […]

Long-lost Qt Goodies – QArrowCue

Have you ever wanted to indicate (in a more pronounced way than usual mouse cursor change) that a drag action is taking place? Now is your chance to do just that 🙂 Thanks to QArrowCue you can display a neat arrow for any QDrag object you have out there. I’ll […]

Long-lost Qt Goodies – QPieMenu

I bet every single coder out there has some long-forgotten pieces of code, which when rediscovered bring this “WTH. I wrote that?” kind of feeling. I happen to have a lot of such candies 😉 Today, it’s an eye-appealing one – a pie menu. Nothing too innovative, but quite useful […]

Recording and replaying Qt input events

Recording, saving, loading and replaying of Qt input events could come in handy in numerous situations. For example, in automatic GUI testing or when implementing a macro system (like the one in Microsoft Office or Adobe Photoshop), in interactive help systems, demos of all sorts etc. Input events in Qt […]

Efficient Meta-Information Based Binary Parser

The problem of storing information about structure of binary data seems quite prevalent nowadays. As tendency to use non-homogenous programming platforms increases, a need arises to store information about data (meta-information) separately from code and in a format that facilitates extensibility and portability. Such architecture could be illustrated using the […]

QDomNodeModel / QXmlQuery

I have prepared an implementation of QAbstractXmlNodeModel class from QtXmlPatterns module which makes it possible to run QXmlQuery-ies on a QDomDocument. I’ve run into problems with QXmlQuery though, because it doesn’t seem to support @Attribute queries either in QXmlQuery::XPath20 or QXmlQuery::XQuery10 mode. I’ve tested it without my custom model and […]

LINQ/C++

LINQ was released as part of .NET Framework 3.5 back in 2007 – http://en.wikipedia.org/wiki/Language_Integrated_Query. Some attempts were made to mimic its capabilities in C++, most notably the proof of concept code by Hong Jiang: https://github.com/hjiang/linqxx. I’ve written my own, more concise version with similar functionality, which you can see below. […]

Random thought – QObjectLocker

I figured it _could_ be useful to have my mutexes created automatically for me on a per object basis. QObjectLocker maintains a pool of mutexes assigned to specified addresses (object pointers) in memory. Otherwise it behaves similarly to QMutexLocker. This way I don’t have to extend or pair up existing […]

OpenMPI and Precomputed Values in Shared Memory

Think OpenMPI. Let’s say you have a 12-node cluster at your disposal. Every node has 16GB of RAM and two 4-core processors which in normal situations enables you to run 8 processes per node. What happens if you want to precompute a huge constant lookup table (e.g. 3GB in size) […]

Project Euler #309

Oh… GOD! This time I was SO close, soooo close :/ Precision issues played tricks on me again. Long double just doesn’t seem to be good enough with PE problems most of the time. Anyway, crossed ladders problem is a classic (a very fascinating classic nonetheless) and you will figure […]