(Not so much) Fun with QSharedPointer

Qt has a wonderful way of dealing with memory management. The core idea is simple. Most objects have a parent, and when the parent gets destroyed, it will first destroy all it’s children. Using this technique, you can often write your Qt applications with little to no concern for memory management. Often, you literally don’t have to have a single delete in your entire application. That’s pretty sweet!

In addition, since Qt 4.5 QSharedPointer was introduced, which is very similar in concept to boost::shared_ptr (and thus std::tr1::shared_ptr). I have long been a huge fan of the idea of smart pointers. They solve the need to worry about memory management for almost all usual cases. Unfortunately, when you combine these two concepts, sometimes you can go awry. I was surprised by this one, so I figured I’d shared my findings :-) .
Continue reading

Posted in General | Tagged , | 1 Comment

Combining Qt’s Signals and Slots with c++0x lamdas

Qt is a fantastically designed library. However, every now and then I think of something that I wish they offered that they don’t. It’s almost always something small and easily worked around, but it would be nice if it were just there. This time around, that feature is the ability to connect a signal to a function which is not a member of a class/struct. Specifically, I think it would be really cool if I could connect it to a c++0x lambda! Especially now that the ISO C++ committee approved the C++0x final draft.

Continue reading

Posted in General | Tagged , , , | 2 Comments

GMP error handling frustrates me

The GNU Multiple Precision Arithmetic Library (GMP) is a wonderful library. It offers arbitrary precision math in a relatively simple, easy to use package. It is currently used in kcalc as the core for all basic math operations. The only problem is, the error handling it offers, is broken by design.

Continue reading

Posted in General | 3 Comments

HTML5 and undefined tags

So I was just reading up on the upcoming HTML5 standard and am generally very pleased with the work they’ve done. But a though occurred to me, since HTML5 is effectivly going “version-less“, web designers are going to have to use javascript in order to detect features client side and either inject elements into the DOM when they are there, or inject some fallback code if they are not. There has been a lot of nice work on this front, specifically modernizr is a very cool library for this. But maybe there is a cleaner, better way.

Continue reading

Posted in General | Tagged , | Leave a comment

The Default Browser on Linux Debacle

The concept of a default browser on linux is a complete mess. There doesn’t seem to be any central, agreed upon method of defining what the default browser is. First there is the $BROWSER environment variable. This seems like a good idea, it can be set globally, and on a per user basis. On the command line, all you need to do is type $BROWSER http://... and you on your way to the website of your choice. If only it were that easy…
Continue reading

Posted in General | Tagged | 6 Comments

How not to handle a bug report

I recently submitted a bug report to Qt software, the results were less than impressive. One thing I’d like to make clear though is that Qt is an amazing library that I would recommend to any c++ software developer, I truly mean that. It is well designed, well documented and generally works as advertised. On top of all of this, it is portable! It really just gets better and better. Which is why I found the handling of my bug report so… underwhelming.

Continue reading

Posted in General | Tagged , | 3 Comments

Flash accidentally subverts the privacy mode of newer browsers?

Pretty much all of the popular browsers now support a “private browsing” mode. The whole concept of this mode is to prevent any history of your browsing activities from being recorded. The problem is that there is nothing forcing browser extensions to respect this mode of operation.

Continue reading

Posted in General | Tagged , | 2 Comments

How not to maintain an API

So I’ve been working on my graphing code for EDB.  I was eventually able create a Qt widget which natively  renders a graphviz graph layout. It actually works quite nicely, you can create an ordinary graphviz graph either in memory or from a file like usual.  The code can simply create a “GraphWidget” and the code will display the graph perfectly (there are some constructs which it doesn’t support, but the basics are there) with nice things such as zooming and rotating.

All of this works great, except for the fact that graphviz decided to change some of the structures used to represent the layed out graph.

Continue reading

Posted in General | Tagged , | 3 Comments

Fun with graphs

So I figured that I would post some of the progress with EDB. I’ve been very happy with the function analysis engine that I developed, but there is one thing that it completely ignores, basic block analysis. Of course in order to identify functions it does technically break things down into blocks, but this information is discarded when a whole function is identified.

Continue reading

Posted in General | Tagged , | 5 Comments

Micro-optimization is stupid

I tend to frequent the website stackoverflow.com. It’s a fantastic website. It allows knowlege to be shared in a unique way. The only problem is, some people have no idea what they are talking about. If there are enough people who agree with these misguided notions, well then these incorrect answers get up-votes. And the cycle of mis-information repeats. It isn’t too dissimilar from the various types of incorrect information regarding 32-bit machines and 4GB of RAM.

Continue reading

Posted in General | Tagged | 4 Comments