I'm looking for a framework that provides execution of hierarchical state machines (HSMs).
These are the requirements for the framework:
Conforms to UML state machine semantics (as much as possible)
Supports at least
run-to-completion semantics
hierarchical states
entry and exit actions
transition actions
guards
events with custom pa...
Hi everyone,
I would like to transfer an image from a Java application to a C++ application. I am using sockets as the communication method, and for now this works good with strings.
I want to be able to transmit it both way (Java <-> C++).
The image is NOT a file, this is a memory object/structure. So my main problem is how to encode...
I am new to C++. Could you pls help me get rid of the errors:
error C2259: 'MinHeap' : cannot instantiate abstract class
IntelliSense: return type is not identical to nor covariant with return type "const int &" of overridden virtual function function
template <class T> class DataStructure {
public:
virtual ~DataStructure...
Is it possible (or relevant at all) to export member functions of a static library?
When I "dumpbin /EXPORTS" my .lib file I don't see any of my defined class members.
Linking to this lib file succeeds, but I use an external tool that fails to read non-exported symbols.
Also tried adding a .def file with no results.
...
I have been implementing a heap in C++ using a vector. Since I have to access the children of a node (2n, 2n+1) easily, I had to start at index 1. Is it the right way? As per my implementation, there is always a dummy element at zeroth location.
...
Is there a way to see which signals are fired, and if there is a slot connected to them? Ideally, we'd like to see all signals, not just those of a particular class or method; e.g. QSignalSpy only allows us to track specific signals of specific instances.
In our application, we've seen performance problems because of a signal being emi...
Hi
I was wondering if there is any way in c++ to treat a double with a given precision.
for example, the number 3.1345 will be considered as 3.13 and the number 0.009 will be considered as 0 (precision of 2 after the dot).
I need that it will be applied on mathematical operations. for example:
double a = 0.009;
double b = 3.12345
//a...
How can I dump candidate functions (or viable functions or best viable functions) for a function invocation?
I know g++ provides an option to dump class hierarchy. (In fact, Visual Studio 2010 provides a similar option, but it's undocumented. I remember reading something about it—maybe in the VC++ team blog—but I can't remember it clea...
The boost ublas::compressed_matrix should only allocate space for non-zero elements. But in the below example, I am getting strange results.
#include <boost/numeric/ublas/matrix_sparse.hpp>
#include <boost/numeric/ublas/io.hpp>
using namespace std;
using namespace boost::numeric::ublas;
int main () {
{
compressed_matrix<double,row...
Is there a nice and simple way to find nth element in C++ std::map? Particularly I'm looking for an algorithm to erase the last k elements from the map. That would make sense to retrieve the iterator to the nth element and call std::map::erase. The requirement is that complexity doesn't suffer - that should be possible to erase the eleme...
I have put each function in own file.
How do i include all those functions at once without repeating #include for each file manually? I dont care at which order the functions are included.
Edit: All the functions from hundreds of different files belongs to the same group. Actually each file has 4 functions...
...
Hi, I am working on dialog based MFC application in WinCE.
I created few controls in a dialog and scrolled down.
When i scroll up again, the controls in the first screen got disappeared.
Controls getting created in OnInitDialog() like below at coordinates (50,10)
test->Create(_T("Title"), WS_CHILD|WS_VISIBLE, CRect(50,10,200,40), this...
I am startting to develop a module using C++ and yes using VC++ 6.0. Had a look on google test framework but it supports VC 7.1 onwards.
Can any body please suggest few tools for unittesting C++ exes or dlls. If the tool can be integrated to VC++ 6.0 IDE will be great.
...
Hello guys.
I'm writing a tetris game using C++ and MFC. I have a timer and OnTimer handler. Handler looks like this:
... do some game-only logic ...
this->RedrawWindow();
And in OnPaint handler I draw blocks, map(with bitmap background), score etc. For drawing i use bitmaps and BitBlt function. Everything is drawn from scratch, i red...
I have the following function that was written by someone else, however I am rewriting this application and I was just wondering if there isn't any better way to do exception handling, besides just returning what was originally passed to the function?
CComVariant GetFldVar(ADO_RsPtr rs, long nIndex, CComVariant def)
{
try
{
...
Why does the following code not work?
It compiles fine but output is something like an address if I write f using * and the output is 0 if I write f without *.
#include <iostream>
#include<cstring>
using namespace std;
using std::size_t;
int *f(size_t s){
int *ret=new int[s];
for (size_t a=0;a<s;a++)
ret[a]=a;
...
I need to do some matrix operations on my computer. These matrices are large 1000000x1000000 and more, some operations requiring TB of memory. Obviously these cannot be directly loaded into memory and computed. What approaches can I use to solve these matrices on my computer? Assuming that the matrices cannot be reduced further using mat...
I don't see a way to create an array using boost::property tree. The following code ...
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <iostream>
int main()
{
try {
boost::property_tree::ptree props;
props.push_back(std::make_pair("foo", "bar"));
props.push_back(std::make...
hello
#include <iostream>
#include <fstream>
#include <string>
#include<string>
#include<boost/algorithm/string.hpp>
#include<boost/regex.hpp>
#include <boost/algorithm/string/trim.hpp>
using namespace std;
using namespace boost;
int main() {
string robotsfile="User-Agent: *"
"Disallow: /";
regex exrp( "^Disallow...
Hello ;-)
I have a newbie but really important question for me: I have a Mac Os X application that uses carbon api, but it is still a C++ application. I need to debug which functions are called at execution time and then make a C++ patch to replace one of those functions.
The real goal: I need to log all text printed into a chat window...