Hello,
Short story: does Qt 4 have an analog of Python's os.path.join?
Long story: I need to add a relative path to the application directory, QCoreApplication::applicationDirPath() in the Right Way (TM), so that the code doesn't depend on the file system directory separator character.
Is merely joining QStrings and using "/" as the s...
While writing a post about project euler's 14th problem I ran into a difference in behaviour between VC9 and VC10.
The following code runs OK in VC9 but in VC10 std::unordered_map throws a bad_alloc exception.
The strange thing is that if I recover from the exception future allocations will succeed (the size of the container continues t...
Please help,
my c++ function:
extern "C" REGISTRATION_API void calculate(char* msg)
{
//some calculation here
msg = "some text";
}
my c# call:
[DllImport("thecpp.dll")]
static extern void calculate(StringBuilder sMsg);
private void button4_Click(object sender, EventArgs e)
{
StringBuilder msg = new Stri...
Hi,
I am using wxwindgets 2.8.7 on C++.
There is a parent frame which is derived from wxMDIParentFrame and from that frame, there is a call to a message dialog with ShowModal.
...
dlg->showModal();
...
In other parent windows, showModal disables the parent window but in this mdi window, it is still enabled somehow.
I want th...
Hi,
If I have an array created like this:
MyType *array = new MyType[10];
And I want to overwrite one of the elements, do I have to delete first the old element like this:
delete &array[5];
array[5] = *(new MyType());
Or is this completely wrong and do I have to work with something like "pointers to pointers" to fix this job? If s...
Hi,
This seems to be a rather stupid question, but I create a pointer to an array of doubles :
double* tab = new double[10];
Then I fill the double array, but when I expand the tab pointer in Debug Mode, I only *tab which gives me the value of first element, which is normal. But how do I see the other elements?
thanks
...
I have a 8-bit color palette, therefore I am having 256 colors.
The palette is basically an array of [256 * 3] {r, g, b} values, Now I need to draw a color spectrum out of it. So basically I have to select 256 out of total 256*256*256 values possible which would enable me to draw the rainbow as closely as possible.
Similar questions he...
Hi all,
I want to perform encryption - decryption of certain audio - video files.
Can anyone suggest me some suitable algorithms in cocoa, objective- c, c, or c++ to accomplish it?
You can suggest me some link and/ or third party software for it.
Thanks,
Miraaj
...
What's the return of the algorithm std:set_union when one or both input containers are multisets with duplicated objects? Do dups get lost?
Let's suppose for example:
multiset<int> ms1;
ms1.insert(1);
ms1.insert(1);
ms1.insert(1);
ms1.insert(2);
ms1.insert(3);
multiset<int> ms2;
ms2.insert(1);
ms2.insert(1);
ms2.insert(2);
ms2.insert(...
Ok I have a shader compiled up under D3D10.
I am obtaining a shader reflection to get details of all the constants/globals in the shader. However I'm a little confused on something ... how do I set a texture to a constant buffer?
I assume I don't just Map the constant buffer and copy the ID3D10Texture pointer into it ... I assume I us...
Hi,
I am trying to find all the unused methods of my project. I have search ways of doing this, but the most convincing answer I found was to declare all my functions as obsolete, and remove this attribute until I got no warnings.
The problem is that I don't know how to declare a function as obsolete. When I write:
[Obsolete]
cl...
Is it allowed to mix different file handling functions in a one system e.g.
fopen() from cstdio
open() from fstream
CreateFile from Win API ?
I have a large application with a lot of legacy code and it seems that all three methods are used within this code. What are potential risks and side effects ?
...
If so, what is it?
EDIT: In response to comment below:
var tabulatedOutputErrors = from error in outputErrors
group error by error into errorGroup
select new { error = errorGroup.Key, number = errorGroup.Count() };
var tabulatedInputErrors = from error in inputErrors
...
I was working on a thread safe queue backed by memory mapped files which utilized boost interprocess fairly heavily. I submitted it for code review and a developer with more years of experience than I have on this planet said he didn't feel that boost::interprocess was "ready for prime time" and that I should just use pthreads directly....
It's often the case that you have 2 enums that are equivalent but numbered differently, and you need functions to translate elements from the first enum to elements of the second and the reverse. This is usually really tedious to code, and anytime a new element is added you have to make sure to add the pairing both to the converting and ...
If I have a pointer that is pointing to an element in a vector, say element 2, and then that element gets swapped with element 4 of the same vector, Is the pointer now pointing to element 2, element 4, or neither? Example:
vector a is equal to [1,2,3,4,5]
create pointer that points to the element 2, which is equal to 3 in this case
sw...
Hi,
I have a base class(Base) whose constructor takes a reference as argument. In my derived class its constructor, I call the superclass-constructor and of course I need to pass a reference as argument. But I have to obtain that argument from a method of which the return type is by value...
I will give a short example:
class Base
{
p...
Hi,
Is there a way to get the hashed value of Windows password for a specific local user? Which Win32 API would that be? I don't want to know what the actual password is, just the hash value of the password.
I'd like to be able to tell which workstations/servers don't have the same password for a specific user.
Please advise, thanks...
I've got a C/C++ program that runs in a console window, and prompts the user to press any key to continue, or 'q' to quit. It currently uses _kbhit() to detect if a key has been pressed, and then uses _getch() to determine what character it was.
Now I want to be able to automate this program (from a C# app using a Process with RedirectS...
Hi,
I need to plot my simulation (which I do in a C++ application) for use in a Latex document (so I would prefer some vector output like EPS). My function is of 2 arguments, so I am after a 3D plot, ideally with colouring indicating the function value (similar to what Mathematica does). Could anyone recommend any library?
...