Hi,
I want to convert a wav file to speex format .I am getting issue that it doesnt get the proper header for ogg conversion,It reads the wave header and when it tries to write the ogg header it runs infinte loop .
Thanks in advance .
...
In our company's coding standard, we have been told to "be aware of the ways (accidental) copying can be prevented".
I am not really sure what this means, but assume that they mean we should stop classes from being copied if this is not required.
What I can think of is as follows:
Make the copy constructor of a class private.
Make th...
With gcc versions before 3.3 and with the MS compiler I use the following macro:
DEBUG_WARNING(...) printf(">WARNING: "__FUNCTION__"() " __VA_ARGS__);
Use:
DEBUG_WARNING("someFunction returned %d", ret);
Output:
>WARNING: Class::FunctionName() someFunction returned -1
Its extremely handy when we have lots of systems, all sending...
I have a serial application that I parallelized using OpenMP. I simply added the following to my main loop :
#pragma omp parallel for default(shared)
for (int i = 0; i < numberOfEmitters; ++i)
{
computeTrajectoryParams* params = new computeTrajectoryParams;
// defining params...
outputs[i] = (int*) ComputeTrajectory(params...
I'm writing an application, where I want to store strings as keys ans a custom Object as value
multimap<string, owncreatedobject> mymap;
Compiling does well, but I get a "Segmentation fault" when using the funtion insert
during runtime.
mymap.insert(string,myobject); --> Segmentation Error
A already added a copyconstructor an assig...
I am in the process of learning C++ and came across an article on the MSDN here:
http://msdn.microsoft.com/en-us/magazine/dd861344.aspx
In the first code example the one line of code which my question relates to is the following:
VERIFY(SetWindowText(L"Direct2D Sample"));
More specifically that L prefix. I had a little read up, and...
I my company we use small application called IPMsg a messenger kind of tool to pass messages and file to other fellows in company, even it allows to multicast the message.
And also it list the Username, hostname and IP addresses of users.
How it could do that? There is no server present for message routing and when checked through nets...
Most texts on the C++ standard library mention wstring as being the equivalent of string, except parameterized on wchar_t instead of char, and then proceed to demonstrate string only.
Well, sometimes, there are some specific quirks, and here is one: I can't seem to assign a wstring from an NULL-terminated array of 16-bit characters. The...
Hi,
I was wondering what -fno-omit-frame-pointer will do without optimization?
CXXFLAGS = -Wall -ggdb3 -DDEBUG -fno-omit-frame-pointer
Isn't it that fomit-frame-pointer auto turned on at all levels of -O (except -O0)? I assume in my example it is -O0 by default.
Thanks and regards!
...
How do you generate a random double uniformly distributed between 0 and 1 from C++?
Of course I can think of some answers, but I'd like to know what the standard practice is, to have:
Good standards compliance
Good randomness
Good speed
(speed is more important than randomness for my application).
Thanks a lot!
PS: In case that ma...
We're developing/supporting 2 large MFC applications, using VS 2005. Currently, we are looking at various MFC GUI/controls component libraries:
www.bcgsoft.com : "BCGControlBar Pro"
www.codejock.com : "Toolkit Pro"
www.prof-uis.com : "Prof-UIS"
others?
The samples/demos provided for those look all great, and the feature sets seem to...
I need to create a binary bitmap from a closed 2D polygon represented as a list of points. Could you please point me to efficient and sufficiently simple algorithms to do that, or, even better, some C++ code?
Thanks a lot!
PS: I would like to avoid adding a dependency to my project. However if you suggest an open-source library, I can ...
any ideas why stream.flush(); won't work?
boost::asio::ip::tcp::iostream stream("localhost","5000");
assert(stream.good());
stream << 1;
stream.flush();
while(true);
it's only flushed if the loop is removed and the line
boost::this_thread::sleep(boost::posix_time::seconds(1));
is executed (much later).
Thanks
Update:
I did some ...
Hi all!
I am searching for a way to find a mapping between a heap and the module which owns the heap.
I retrieve the heaps in the following way:
HANDLE heaps[1025];
DWORD nheaps = GetProcessHeaps((sizeof(heaps) / sizeof(HANDLE)) - 1, heaps);
for (DWORD i = 0; i < nheaps; ++i) {
// find module which created for heap
// ...
}
The ...
I am attempting to construct a very simple proof of concept that I can write a web service and actually call the service from a symbian environment. The service is a simple Hello service which takes a name in the form of a const char* and returns back a greeting of the form "hello " + name in the form of a char*. My question is, how do I...
Using C++ with Visual Studio, I was wondering if there's an API that will print the callstack for me. Preferably, I'd like to print a callstack 5 levels deep. Does windows provide a simple API to allow me to do this?
...
I have this code for a custom class 'sau_timer':
sau_timer::sau_timer(int secs, timerparam f, vector<string> params) : strnd(io),
t(io, boost::posix_time::seconds(secs))
{
assert(secs > 0);
this->f = f;
this->params = params;
t.async_wait(strnd.wrap(boost::bind(&sau_timer::exec, this, _1)));
boost::thread thrd(b...
I've been playing around with Moose, getting a feel for it. I'd like an example of pure virtual functions like in C++ but in Moose parlance (specifically in a C++-looking way). I know that even with Moose imposing a stricter model than normal Perl, there's still more than one way to do what I'm asking (via method modifiers or SUPER:: cal...
I have a std::set, what's the proper way to find the largest int in this set ?
...
I'm trying to do some refactoring of code, and have run into a problem. The program has a data manager that returns pointers to arrays of structures as a void*. One of the new types of data, instead of having a single pointer to an array of structures, has two pointers to arrays of numbers. The problem is that all the processing code ...