I have a random piece of code, I use for reading from CSV files... and it's fine... until after about 2000 reads... then the getline line fails with an access violation to 0xcccccc... which I assume means that the input stream (file) has been cleared... Not that I know why :)
int CCSVManager::ReadCSVLine ( fstream * fsInputFile,
...
hi everyone,
i need to compute Laplacian Matrix-L for an image(nXn) in opencv...computing goes as follows..........
δij − 1/|wk|{[1+1/(ε/|wk|+σ2)][(Ii-µk)*(Ij −µk)]}.... for all(i,j)∈wk,summing over k yields (i,j)th element of L.
where Here δij is the Kronecker delta,µk and σ2k are the mean & variance of inten...
How do I hide the private implementation (implicit sharing) in Qt:
I have Employee.cpp the following in my Employee.h header:
#include <QSharedData>
#include <QString>
class EmployeeData;
class Employee: public QObject
{
Q_OBJECT
public:
Employee();
Employee(int id, QString name);
Employee(const Employee &other);
...
This is an issue, that I have come acrosss earlier.
Basically a c++ object has a member object that does some work, once the work is done , a notification needs to made to the parent.
What is the most elegant solution to allow this communication.
Does being in this position indicate a flaw with the design to begin with?
To elaborate.
...
While there are multiple ways to reverse bit order in a byte, I'm curious as to what is the "simplest" for a developer to implement. And by reversing I mean:
1110 -> 0111
0010 -> 0100
This is similar to, but not a duplicate of this PHP question.
...
I do not understand how to use enumeration types. I understand what they are, but I don't quite get their purpose.
I have made a program that inputs three sides of a triangle and outputs whether or not they are isosceles, scalene, or equilateral. I'm suppose to incorporate the enumeration type somewhere, but don't get where and how to u...
If my project name is ABC and the DLL currently outputs as ABC.DLL, how can I make my DLL be outputted as say CBA.DLL and so that when the .LIB is compiled linked against, it is not looking for ABC.DLL, but CBA.DLL. I tried changing the name under Linker > General > Output File but when I linked to the .lib in my other application, it wa...
I am exposing some ISO C++ data types to .Net (mono on Linux to be precise).
For the purpose of brevity, I shall refer to C# in my question, although my question relates to all of the .Net languages (with C# and VB.Net being my target languages).
So far, I have worked out how to expose the ISO C++ data types in C# class(es) for use in...
I'm searching an autoconf macro to use in my configure.ac that checks for Boost MPI.
It's not hard to find a couple of them on the Internet but none of the one I tried worked as expected.
What ax_boost_mpi.m4 do you use?
EDIT: I'll explain my requirement better. I need the macro to tell me if Boost MPI is available or not (defining HA...
I need to find a workaround for a bug with placement new in g++. I now it was fixed in gcc-4.3 but I have to support versions 4.2 and 4.1. For example, following code compiles with an error
"error: no matching function for call to 'operator new(long unsigned int, void*&)"
template<class T, template<typename> class Alloc>
inline void* ...
Hi all,
I'm trying to draw semi-transparent rectangles on an invisible HWND. However, clearing the window with ID2D1HwndRenderTarget::Clear just makes the entire window black, so when I draw rectangles on top, they look semi-black.
If I don't Clear() and don't draw, then the window is invisible, as it should be. Clear() is the culprit ...
According to this post on Daring Fireball a new iPhone SDK Agreement release in conjunction with the iPhone OS 4.0 announcement today specifically bans any iPhone application not implemented in C, C++ Objective-C or JavaScript. The clear impact here is to the wide array of programs written in languages other than those.
Is that your rea...
I think it should be 01 but someone says its "undefined", any reason for that?
...
At http://blogs.msdn.com/vcblog/archive/2010/04/06/c-0x-core-language-features-in-vc10-the-table.aspx there is a table showing C++0x features that are implemented in 2010 RC. Among them are listed forwarding enums and strongly typed enums but they are listed as "partial". The main text of the article says that this means they are eithe...
Hello everyone :)
I've got a moderately complex iterator written which wraps the FindXFile apis on Win32. (See previous question) In order to avoid the overhead of constructing an object that essentially duplicates the work of the WIN32_FIND_DATAW structure, I have a proxy object which simply acts as a sort of const reference to the sin...
Hello,
I've been trying to figure out how to add a private member from Object A, to a private member from Object B.
Both Cat and Dog Class's inheriate from the base class Animal. I have a thrid class 'MyClass', that I want to inheriate the private members of the Cat and Dog class. So in MyClass, I have a friend function to overload the...
I think I am making a simple mistake, but since I noticed there are many boost experts here, I thought I would ask for help.
I am trying to use boost threads(1_40) on windows xp. The main program loads a dll, starts the thread like so (note this is not in a class, the static does not mean static to a class but private to the file).
...
This is the question.
write a program that prompts the user to input five decimal numbers. the program should then add the five decimal numbers, convert the sum to the nearest integer,m and print the result.
This is what I've gotten so far:
// p111n9.cpp : Defines the entry point for the console application.
//
#include <iostream>
us...
I have the following problem: I am given a tree with N apples, for each apple I am given it's weight and height. I can pick apples up to a given height H, each time I pick an apple the height of every apple is increased with U. I have to find out the maximum weight of apples I can pick.
1 ≤ N ≤ 100000
0 < {H, U, apples' weight and ...
Hello, I was wondering if there's a way I could code some kind of "generic" FSM for a game with C++?.
My game has a component oriented design, so I use a FSM Component.
my Finite State Machine (FSM) Component, looks more or less this way.
class gecFSM : public gecBehaviour
{
public:
//Constructors
gecFSM() { state = kEntity...