Skip to content

Content Tagged "c"

Page 1 of 1

Stream from a String Instead of CIN in C++

January 11, 2016Category: Software
TL;DR : You can stream from a string instead of STDIN . Code is simple and is listed below. A project I did recently had a requirement to overload the >> operator use and STDIN to load data. The problem was not the overload itself, but the fact that testing would introduce a manual side. To get…

Simple Floating Point Equality Check in C++

December 21, 2015Category: Software
TL;DR : Here you can see a handmade comparison function for floating point values. While working on a C++ project using templates, I had to perform an equality to see if two values are identical. While the == is OK for integer values, it is not really OK for floating point values. At that point, you…

Build a Simple Makefile

December 20, 2015Category: Software
TL;DR : If you don't have anything better to do, create Makefiles by hand :) Gist here . The other day I went back to origins with building a small C++ project. With modern tools, all went OK. However, deployment was a bit of a problem, in the sense the host had an obsolete toolchain: So, I had to…

C Optimisation - 2005 style

October 10, 2014Category: Software
TL;DR : This post is about an experience I had in 2004 and it’s part of my consolidating technical posts I wrote in time. It may or may not be relevant to today’s technologies. I was trying to optimize a bit of code and found out that 2 if() statements are quicker than a case with true/false. and an…


November 16, 2007Category: Hardware
Note: This is a really old post transferred from Laurii for historical and consolidation purposes. Last week I've got an iPhone! :) 8G. Cute little toy... I've managed to compile the toolchain for linux last night and installed my first compiled app: the . I'm quite pleased with…

DBus and Qt programming

March 22, 2007Category: Software
For the past few days I've been trying to get more complex data sent via D-Bus. As one would say here in Ireland: Je'zus H. Christ Playing with python was easy. There are lots of examples on communicating complex data structures. But with Qt... It's a bit more complex, because there are only a set…

C optimisation

April 8, 2005Category: Random
I was trying to optimize a bit of code and found out that 2 if() statements are quicker than a case with true/false. and an if/else case is WAY quicker!!! All with various optimisation levels (from nothing to O3 to O3 + architecture optimisations). Odd. one might believe that the switch/case…


November 23, 2004Categories: Random, Software
Well, I've been writing a piece of code today and it took me 3 hours to realise that strcmp(txt, "message") was giving me a segfault.. because it doesn't accept implicit parameter. putting a: works... My excuse today is that i feel very bad (have a horrible cold) and i'm staying @ home. First sick…

All tags