Questions about C++, a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language.

learn more… | top users | synonyms

2
votes
3answers
343 views

How to manage focus for a small set of simple widgets

I'm developing a set of simple widgets for a small (128x128) display. For example I'd like to have a main screen with an overlay menu which I can use to toggle visibilty of main screen elements. Each ...
0
votes
2answers
538 views

Is factory pattern a right pattern for the situation described here?

Is factory pattern a right pattern when we want to consolidate the related objects? Problem - In the Set-top box, I have a user-io, basically the interface to control the settop box - The user-io can ...
0
votes
1answer
409 views

GUI code implementation for specific Window/Form class

Terminology Element/Form Element -> Fields such as text list, combo_boxes, push buttons, etc. Problem I have a program that is basically a fat client that interfaces into a system that keeps track ...
0
votes
1answer
516 views

Interface questions for using Command Pattern and Dependency Injection together

I have many projects that have essentially the same high level requirement: test all hardware on a device. Each device can have a different communication protocol, requires different test equipment to ...
-1
votes
1answer
204 views

Optimal movie schedule

Let's say Mr. A goes to cinema and he gets a movie schedule. There are N movies on the program today (1 < N < 50) and for every movie the time of the start and the time of the end are given in ...
-1
votes
1answer
575 views

How to move a car around an environment with hills in C++?

I don't have any code for this since I don't know how I am meant to do this. I have a car and I am able to move it around on a flat plane and I have that working correctly. However, I want it to also ...
2
votes
0answers
185 views

Dynamic programming in Bin packing

Problem: Given a list L of objects of possible sizes from set S={1,2,4,8} and unlimited supply of bins of sizes 16 each and we have to use minimum possible numbers of bins to pack all objects of L. I ...
2
votes
0answers
202 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: ...
1
vote
0answers
81 views

Is the behaviour of floating-point arithmetic defined by the c++ standard?

I started writing this as a SO question but I think it's better suited here. While I'm happy for simply an answer I'm also fond of the "Teach a Man to Fish" phylosophy so I'm happy for people to point ...
1
vote
0answers
130 views

General design choices. How do you decide?

I have a project in C that I'm looking to convert to C++. The project does white box hardware testing of a device (actually many similar devices). In this case the device has two processors. Each ...
1
vote
0answers
64 views

Maximizing reuse out of a function primitive in CUDA

I'm working on the implementation of a few related algorithms in CUDA, all of which require a primitive that we'll call f(). The related algorithms can't simply call f though, as they require f to ...
1
vote
0answers
121 views

Requesting information regarding the use of MUI vs. the use of GetText for i18n/L10n of Windows desktop applications

I have spent the past two days investigating which technology I will use to support translations of text strings (as part of an overall internationalization migration) for an archaic (VC6) Windows ...
1
vote
0answers
112 views

API for accessing CTS and DSR signals of serial port

I'm trying to improve another abstraction of the serial port. The project involved often needs to check one of the single control signals CTS and DSR. This is currently done by a call to ...
1
vote
0answers
94 views

Web Services of System Integration

I have been assigned to a system integration project. However, I do not understand part of the integration implementation architecture. For example, I have a passport scanner connected to a Windows ...
1
vote
0answers
94 views

Representation of time expanded graph

I want to build a time expanded graph with time discretization Dt that starts at t = 0 and ends at t = T where between the node (n1, t) and the node (n2, t') is an arc if and only if (n1, n2) were ...
0
votes
0answers
37 views

Flat files for events and alarms

So I'm working on a project that I was introduced to a year ago. One of the features of project involves alarming the users when certain events are triggered. There is also a log of these events. ...
0
votes
0answers
49 views

data structure with best match lookup

Let me explain my question with one example: I have the following structs: struct Box{ unsigned char color; unsigned double width; unsigned double height; unsigned double weight; }; struct ...
0
votes
0answers
40 views

Difficulty designing my EventHandler class that uses a callback to handle key-presses

I wrote an EventHandler class that takes a std::function<void(char)>, and a std::vector<char> of chars (representing keys). If a key in the vector is pressed, the call-back is executed ...
0
votes
0answers
57 views

Matching groups of similar lines on a generic matching algorithm

I have to write a program to search through a file containing lines and find lines that match to a degree of tolerance but are not necessarily the same. So for example the following lines would match: ...
0
votes
0answers
90 views

Polymorphic template container: shared_ptr vs reference_wrapper

Assuming we have two classes: class A { ... } class B : public A { ... } Would it be better to write std::deque<shared_ptr<A> > container; or ...
0
votes
0answers
66 views

Mailbox Pattern with Variable Arguments in C++

In a game I'm developing, the GUI thread is catching user actions, and the simulation thread is responsible of handling and responding to them. To minimize complexity and delay, I predefined all ...
0
votes
0answers
172 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
153 views

GSP Algorithm explanation

I've been trying to implement the GSC algorithm in C++, however I need help with clarifying the definition: http://en.wikipedia.org/wiki/GSP_Algorithm GSP Algorithm makes multiple database ...
0
votes
0answers
152 views

R* Tree work with dynamic data

I'm searching an algorithm to store my data (which are moving objects' coordinates) and allow me to query objects within a specific radius of a specific point. I came up with R* Tree which is said as ...
-2
votes
0answers
26 views

Effect of not calling pthread_attr_destroy - pthread

I was looking into pthreads, and this question popped into my head, what happens if I initialize an attribute object calling pthread_attr_init and then do not destroy it with pthread_attr_destroy? ...