Shmem vs tmpfs vs mmap
Hi. Does someone know how well the following 3 compare in terms of speed: shared memory tmpfs (/dev/shm) mmap (/dev/shm) Thanks! ...
Hi. Does someone know how well the following 3 compare in terms of speed: shared memory tmpfs (/dev/shm) mmap (/dev/shm) Thanks! ...
I am very new to C++ programming and you will see why. I want to make a character array consisting of a few words that I want to search with a linear search function. Does this array have to be a two-dimensional array? For example: char Colors[3][6] = {"red", "green", "blue"}; I tried it like this: char Colors[] = {"red", "green", "...
I'm writing a complex setup/installer application in native C++/MFC. I would very much like to be able to detect the version of Java that is installed (if any). Is this possible, and so, how? ...
I've got the following two programs, one acting as a reader and the other as a writer. The writer seems to only send about 3/4 of the data correctly to be read by the reader. Is there any way to guarantee that all the data is being sent? I think I've got it set up so that it reads and writes reliably, but it still seems to miss 1/4 of th...
Hi, I have been working on a project and trying to find the source of a large slowdown in execution time and have narrowed it down to a single method which I have managed to optimise out of the logic. The problem is that my solution involves using a reference which makes another section of the code run quite slowly... The question I'd li...
i'm writing a crypto program that does stuff like hashing (sha1), encryption, digital signatues for win32 in c++ is built in cryptoapi secure, or should i use some other library like crypto++ i need maximum security and works on all systems xp and vista (and optionally 2000), but at same time i need to minimize exe size and so don't want...
How should I get the number of characters in a string in C++? ...
I was reading the answers for this question and found that there is actually method called length() for strings (I always used size()). Is there any specific reason for having this method in string class ? I read both MSDN and CppRefernce and they seem to indicate that there is no difference between size() and length(). If that is so, is...
How to round a number to end in 50 in obj c or c++ / cocoa? I am writing a tax program, for the final lookup i have to round the income to end in 50 before i apply the tax rate. The only alternative i can think of is string modification, but im shaky in that area,]. ...
Possible Duplicate: In C arrays why is this true? a[5] == 5[a] Is the possibility of both array[index] and index[array] a compiler feature or a language feature. How is the second one possible? ...
Hey everyone, I am getting a heap corruption error I cannot figure out. char * c = (char *) malloc(1); // main loop _gcvt_s(c, 100, ball->get_X_Direction(), 10); if(pushFont(c, (SCREEN_WIDTH - 30), (SCREEN_HEIGHT - 40), message, screen, font, textColor) == false) { //return 1; // error rendering text. } // end main loop f...
Hey! I try to do the following QList<QButtonGroup*> groups; for (int i=0; i<nGroup; i++) { QButtonGroup *objects = new QButtonGroup(this); objects->setExclusive(false); for (int j=0; j<nObject; j++) { Led *tempLed = new Led(); tempLed->setAutoExclusive(false); ...
I am trying to assign a custom type as a key for std::map. Here is the type which I am using as key. struct Foo { Foo(std::string s) : foo_value(s){} bool operator<(const Foo& foo1) { return foo_value < foo1.foo_value; } bool operator>(const Foo& foo1) { return foo_value > foo1.foo_value; } std::string foo_value; };...
hi, I want to create public key for AES key encryption is there are direct APIs in symbian thnx in advance. currently i am using the default api. ...
i am interested to synthesize a few classes which will have some/all of the functions as in the class res_obj. struct res_obj { int* res_; res_obj() ///method 1 : no arg constructor : res_(0) { } explicit res_obj(int value) ///method 2 : single arg constructor : res_(new int(value)) { } ...
In the mold of a previous question I asked about the so-called safe library deprecations, I find myself similarly bemused as to why fopen() should be deprecated. The function takes two C strings, and returns a FILE* ptr, or NULL on failure. Where are the thread-safety problems / string overrun problems? Or is it something else? Thanks ...
I want to get the free space on a compressed disk to show it to a end user. I'm using C++, MFC on Windows 2000 and later. The Windows API offers the GetDiskFreeSpaceEx() function. However, this function seems to return the "uncompressed" sized of the data. This cause me some problem. For example : - Disk size is 100 GB - Data size is...
Does C++ do value initialization on simple POD typedefs? Assuming typedef T* Ptr; does Ptr() do value-initialization and guarantee to equal (T*)0? e.g. Ptr p = Ptr(); return Ptr(); ...
Hi there When is about writing code into C++ using VS2005, how can you measure the performance of your code? Is any default tool in VS for that? Can I know which function or class slow down my application? Are other external tools which can be integrated into VS in order to measure the gaps in my code? ...
not from the ease of use, but from the performance point of view. are MFC message maps faster than a typical message pump? ...