C is a general-purpose computer programming language used for operating systems, games and other high performance work.

learn more… | top users | synonyms

1
vote
2answers
410 views

Is there a better way to organize my module tests that avoids an explosion of new source files?

I've got a neat (so I thought) way of having each of my modules produce a unit-test executable if compiled with the -DTESTMODULE flag. This flag guards a main() function that can access all static ...
1
vote
0answers
241 views

using flat file vs sqlite db for frequent data grabbing in a cron job

I have some automated task to be done using certain types of logs generated on the server end of each day. Log files contains specific machine identification "MAC" that is to be re-written in to ...
1
vote
0answers
149 views

How to extract the active code path from a complex algorithm

I have been puzzled lately by an intruiging idea. I wonder if there is a (known) method to extract the executed source code from a large complex algorithm. I will try to elaborate this question: ...
0
votes
0answers
40 views

type name for state machine state (as opposed to other state variables)

I need to create a typedef for a state machine state, e.g. enum ToasterStateMachineState { TSM_READY, TSM_TOASTING, TSM_DONE }; But ToasterStateMachineState seems verbose and redundant; is ...
0
votes
0answers
57 views

Does multiple Bloom filters make sense?

In order to decrease the number of false positives, I came up with a couple of possible solutions. Create two different types of Bloom filters; eg. filter1 using 3 different hash algorithms, filter2 ...
0
votes
0answers
81 views

In-place merging of sorted intervals in an array?

So I have code producing k sorted intervals in an n-sized array. What I'm brainstorming is the possibility of in-place merge of these intervals into a single sorted interval/array. The problem is ...
0
votes
0answers
25 views

Defining property and find substitution for copy function of python in cython

I want to cythonize a code in python to speed up the code. In the following you can see my attempt to make my python class understandable for cython: import numpy as np cimport numpy as np ctypedef ...
0
votes
0answers
60 views

wrap mysql API for gui use

Some time ago now, I've written a command-line tool, that connects to MySQL, and through a series of commands, does all sorts of good stuff. It was originally intended to be used by myself and, ...
0
votes
0answers
264 views

How does a dynamic library's references to a static variable get translated once in the running app?

If a dynamic library exports the address to a global variable defined within the library, how are accesses to that variable translated during dynamic linking so that a running application can interact ...
-2
votes
0answers
31 views

Find the number of increasing Sequence of length K

Let we are giving a Array we have to find the number of increasing sequence of length K. 1 2 3 1 1 For the first window of [1, 2, 3], there are 3 non-decreasing subranges so the answer is 3. For ...
-4
votes
0answers
40 views

Custom code folding in Eclipse

For those who use Eclipse and are working primarily in Java, there is a custom folding plugin coffee script. It is old but still works. However, C/C++ users are left without code folding ...