I have a class that adapts std::vector to model a container of domain-specific objects. I want to expose most of the std::vector API to the user, so that he/she may use familiar methods (size, clear, at, etc...) and standard algorithms on the container. This seems to be a reoccurring pattern for me in my designs:
class MyContainer : pub...
Hi everyone,
I've been working on a project in C++ using openGL and am looking to save the current scene to a text file. Something simple along the lines of, cube at x,y,z and its color etc.
My question is about how to make sure that the file has not been changed by a user. I thought about calculating a checksum of the string and inclu...
I am working on a C++ project that uses Qt (gui lib), VTK (graphics lib) and another library which is so obscure I won't mention its name and will instead call it LIB_X. The project uses Qt for the gui components and VTK (more precisely the QVTKWidget extension provided by VTK that supports Qt) for rendering geometry.. and it uses LIB_X...
how can I make a stand-alone exe in Visual Studio. Its just a simple Console application that I think users would not like to install a tiny Console application. I compiled a simple cpp file using the visual studio command prompt. Will the exe work even if the .NET framework is not installed? I used native C++ code.
...
My app is written in Java.
There is a C++ library I need to utilize. I don't want to use JNI.
60 times a second, the C++ app needs to send the Java app 10MB of data; and the Java app needs to send the C++ app 10 MB of data.
Both apps are running on the same machine; the OS is either Linux or Mac OS X.
What is the most efficient way to...
How do you tell Visual C++ Express 2008 to statically link runtime libraries instead of dynamically? My exes do not currently run on computers w/o some sort of VS installed and I would love to change that. :)
...
how to answer this question?
...
Hi!
I'm quite new to Xcode (and Mac in general). I started a little iPhone project - coding in C++ whatever possible - and just noted that my assert(); commands are executed also in release mode.
Is this a known problem and how do I solve it properly?
thanks!
...
I am programming a web proxy that is installed on client machines (same machine as the web browser).
I would like for all traffic that is web traffic to get redirected into my proxy server.
I am using a windows operating system (XP, Windows 2003, Windows 2008, Vista, Windows 7).
What would I need to do, to redirect all internet traff...
What language is used to build low level languages like c++ and java?
How could you build the first language with no language?
...
My weekend project consists of writing a cross-platform concurrency primitives library (critical sections, read/write mutexes, interlocked integers, events, etc) and was wondering how to unit test this stuff. I realize that testing concurrent code is hard in itself, but testing the primitives of said code couldn't be that hard, could it?...
I'm writing a multiplayer game (obviously using UDP sockets. note: using winsock 2.2). The server code reads something like this:
while(run)
{
select(0, &readSockets, NULL, NULL, &t)
if(FD_ISSET(serverSocket, &readSockets))
{
printf("%s\n","Data receieved");
//recvfrom over here
}
FD_SET(serverSocket,...
Consider the following code :
void populate(int *arr)
{
for(int j=0;j<4;++j)
arr[j]=0;
}
int main()
{
int array[2][2];
populate(&array[0][0]);
}
There was a discussion regarding this on a local community whether the code is valid or not(Am I supposed to mention its name?). One guy was saying that it invokes UB because...
Hello All,
I am using boost shared pointer from considerable time in my project. Recently my fellow team mates have also started using weak pointers. I am not able to distinguish which to use when.
Apart from this, what should I do if I want to convert weak ptr to shared ptr. Does putting a lock on weak ptr to create a shared ptr affec...
I have an object which implements reference counting mechanism. If the number of references to it becomes zero, the object is deleted.
I found that my object is never deleted, even when I am done with it. This is leading to memory overuse. All I have is the number of references to the object and I want to know the places which referen...
Exposition:
I am on Linux / Mac.
Part of my code is in Java, part of my code is in C++.
They both have the same file mmapped for fast communication.
I want to synchronize the Java & C++ code.
I know the following:
1) given two threads in Java, I can use Locks / monitors.
2) given one piece of code in Java, one in C++, I can have t...
hi ,
I have a method to convert dec to bin
QList<bool> widgetInput::decToBin(int number)
{
int remainder;
QList<bool> result;
if(number <= 1) {
result << number;
return result;
}
remainder = number%2;
decToBin(number >> 1);
result << remainder;
}
but u...
I use QueueUserWorkItem() function to invoke threadpool.
And I tried lots of work with it. (about 30000)
but by the task manager my application only make 4~5 thread after I push the start button.
I read the MSDN which said that the default number of thread limitation is about 500.
why just a few of threads are made in my application?
I'm...
I have the following code that uses GTK+ widget toolkit to display a window with a button. Clicking this button will show a modal dialog. Note that the call to gtk_dialog_run will recursively start another instance of the main loop, i.e. the on_click function will not return until the dialog box is dismissed.
I would like to have two of...
i have a class with static functions.
i need to use the functions without creating an instance of the class.
is it possible?
...