Tag: c/c++

startwithmemlimit

At first I couldn’t believe that such tool wasn’t readily available because I’ve seen dozens of posts on different forums asking how to do this, however… I guess nobody felt urged enough to actually write a command line app for this. Well, I did 😉 startwithmemlimit is a Win32 application, […]

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 […]

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 […]

Project Euler #312

Sometimes I wish I could share solutions to PE problems. They’re so great! I totally enjoyed every bit of this week’s puzzle. At first you don’t know where to start, it seems so complicated and then you just immense yourself in the pleasure of thinking and bit by bit everything […]

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 […]

Project Euler #308

You just gotta take a look at this one! It’s one of the absolutely coolest things I’ve seen recently 🙂 A virtual machine with internal state consisting of just one integer number! And its instruction codes are… fractions! Whoa. It’s Turing-complete and unlike Brainfuck and some other quirky esoteric languages […]

I'm alive

I’m alive and well. In case you wondered what was stopping me from posting recently, the answer is PE #289, PE #294 and now the most recent PE #304. The last one was really easy (I had fallen asleep right before it was posted 😉 and got to it the […]

Project Euler #303

For a positive integer n, define f(n) as the least positive multiple of n that, written in base 10, uses only digits <=2. Thus f(2)=2, f(3)=12, f(7)=21, f(42)=210, f(89)=1121222. Also sum_n=1^100 {f(n)/n} = 11363107 Find sum_n=1^10000 {f(n)/n}. Phew… this was an easy one 😉 I made it to the top […]

Merge file sort and swap iterator

During my struggles with Project Euler Problem #302 I made an attempt to semi-brute force it. Unfortunately it required huge amounts of RAM (about 2e9 * 16 bytes) so I figured I could use some help from permanent storage. I implemented two helper classes, namely MergeSort and SwapIterator which look […]