I'm trying to create a JSON array using boost property trees.
The documentation says: "JSON arrays are mapped to nodes. Each element is a child node with an empty name."
So I'd like to create a property tree with empty names, then call write_json(...) to get the array out. However, the documentation doesn't tell me how to create unnam...
I got binary file, that contains doubles. How do i print that out to a terminal.
I've tried octaldump 'od' but cant figure out the syntax I've tried something like
head -c80 |od -f
But that doesnt work, the man page for od is extremely bad.
I've made a c program that does what I want,
something like assuming 10double chunks.
double...
Hi there,
I'm a programming student, and for a project I'm working on, on of the things I have to do is compute the median value of a vector of int values. I'm to do this using only the sort function from the STL and vector member functions such as .begin(), .end(), and .size().
I'm also supposed to make sure I find the median whether ...
How are you meant to initialise the program using Qt embedded? At the moment I'm using QMainWindow but this means including a lot extra when configuring Qt and makes the applications a lot bigger when compiling them statically.What are you meant to use in place of QMainWindow? I don't need anything like maximise buttons - using a small s...
Hi, I want to prevent memory working set minimize in Console application.
In windows application, I can do by overriding SC_MINIMIZE messages.
But, how can I intercept SC_MINIMIZE in console application?
Or, can I prevent memory working set minimize by other ways?
I use Visual Studio 2005 C++.
Somebody has some problem, and the solution...
Hi everyone,
I am trying to build a parser with Bison/Yacc to be able to parse a flow of token done by another module. The token different token id are already listed in a enumeration type as follow:
// C++ header file
enum token_id {
TokenType1 = 0x10000000,
TokenType2 = 0x11000000,
TokenType3 = 0x1110000...
I need a program to convert Binary numbers into Decimal number in Java or in C++.
is there some one who can help me.
...
This company have a interesting cpu that run in a amazing speed.
Will it be possible to emulate c or is the memory to small?
http://www.greenarrays.com/home/products/index.html
So someone that have tried to emulate c in forth may have a answer.
...
I have searched hard but still confused why POSIX is called "Portable Operating System Interface", what I learned is that it is some threading library for Unix environment, because when you need to use it under windows you have to use cygwin or "Windows Services of Unix", etc. That's why I am confused why it is called Portable OSIX. I a...
Hi
I have STL Multimap, I want to remove entries from the map which has specific value , I do not want to remove entire key, as that key may be mapping to other values which are required.
any help please.
...
Hi all,
I am trying to work out a simple hello world for OpenCV but am running out of ideas as to why it is not working.
When I compile and run this code:
#include <cv.h>
#include <highgui.h>
int main(int argc, char* argv[])
{
IplImage* img = cvLoadImage( "myjpeg.jpg" );
cvNamedWindow( "MyJPG", CV_WINDOW_AUTOSIZE );
cvShowImage("M...
I've been following the 'tutorials' of how to expose a .NET framework through COM ( http://msdn.microsoft.com/en-us/library/zsfww439.aspx and http://msdn.microsoft.com/en-us/library/bd9cdfyx.aspx ). Everything works except for the events part. When I add events to the C# interface the following C++ code is generated:
struct __declspec(u...
I am about to attempt reorganizing the way my group builds a set of large applications that share about 90% of their source files. Right now, these applications are built without any libraries whatsoever involved except for externally linked ones that are not under our control. The applications use the same common source files (we are ...
With C/C++ macros it's quite easy to generated long constructs automatically. For example, if I want a huge set of methods to not ever throw exceptions (a must for COM-exposed methods) I can do something like this:
#define BEGIN_COM_METHOD\
try{
#define END_COM_METHOD\
return S_OK;\
} catch( exception& ) {\
// set I...
I'm making a simple crime sim game.
Throughout it I keep doing the same thing over and over:
// vector<Drug*> drugSack;
for (unsigned int i = 0; i < this->drugSack.size(); i++)
this->sell(drugSack[i]);
Just one example. I hate having all these for loops all over the place omg QQ, anyway to do something like:
drugSack->D...
I have an application written in native C++ which I'd like to get running on the .NET virtual machine. I was thinking of recompiling the C++ code as C++/CLI, using the Visual Studio 2008 compiler. Regrettably, I don't find any documentation on how to do this, so hence my questions:
Does this actually make sense? Am I trying the impossi...
Beginners question, on loop efficiency. I've started programming in C++ (my first language) and have been using 'Principles and Practice Using C++' by Bjarne Stroustrup. I've been making my way through the earlier chapters and have just been introduced to the concept of loops.
The first exercise regarding loops asks of me the following...
I'm trying to start using namespaces the correct (or at least best) way.
The first thing I tried to do was to avoid putting using namespace xxx; at the beginning of my files. Instead, I want to using xxx::yyy as locally as possible.
Here is a small program illustrating this :
#include <iostream>
#include <cstdlib>
#include <ctime>
in...
I need to get a %TEMP% environmental variable value string in Windows platform.
If I try to use any methods(C / C++) (getenv (), …) to get this environmental variable, it returns with “~” in that string.
For Example: C:\DOCUME~1\pkp\LOCALS~1\Temp.
But I need to get full string for some reasons, as below:
C:\Documents and Settings\p...
I'm adding two different elements to both std::list and std::set and I want the std::list to be sorted with the same order as of std::set. one way I tried is when the element is added to std::set, find that element then get the index of that element using std::distance(begin, found) and then insert the element to that index in std::list....