I pasted the wrong version of my code (wht a typo). The correct code should be :
//start of fugly code
char cSep[1];
cSep[0] = char(0x01);
//Tokenize the fields
typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
boost::char_separator<char> sep(cSep);
tokenizer...
I have a file that has it's fields seperated by ^A characters (0x01) and want to use the boost tokenizer to split the fields.
However, when I attempt to use 0x01 directly as the token I get a complaint about type mismatches. To get around that issue I created a char array to hold the token but...
Thanks so much for the help that does exactly what I need.
I am using the script to parse a dump from an old book data storage system that I have and I am importing it into a spreadsheet so I can work with the data a little more easily. The old application is pretty clunky :(.
My plan is to...
Here is a sample from my real data file:
title: Harry Potter and the Sorcerer's Stone (Book 1) author: J.K. Rowling pub-date: 1998 format: hardcover
title: Harry Potter and the Sorcerer's Stone (Book 1) author: J.K. Rowling pub-date: 1998 format: paperback publisher: Arthur A. Levine Books
The...
I have a flat file of the following format:
field1: data1.1 field2: data2.1 field4: data4.1
field1: data1.2 field3: data3.2 field5: data5.2
That I want to convert to a delimited file so that I can import it into a spreadsheet with the following format:
field1 field2 field3 field4...
This is a really simple question:
I have an xml file:
<data>
<foo>xxx</foo>
<bar>yyy</bar>
</data>
How can I get the values foo and bar to print using an xslt.
I assume it's something like:
<xsl:for-each select="/data/*">
xxRule Title: <xsl:value-of select="SOMETHING"/><br/>...
I am attempting to read a newsgroup using Outlook Express v. 6 however, many of the news postings show up with:
This is a multi-part message in MIME format.
------_=_NextPart_001_01C52B2C.6AB4E95C
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
At the...
Heh heh. I think I missed the obvious part:
You only need to pass in the flags when you produce the gmon.out file. (This generates all the stats)
Running "gprof a.out gmon.out" simply produces the human readable stat output.
Thanks :)
*blink*
According to the gprof docs you do something like:
1) Run your application; it will run slower than normal, and will produce a file called gmon.out in the current directory
2) Run: % gprof EXECUTABLE gmon.out > gprof.txt
What I need to do is run: % gprof EXECUTABLE <flags passed to...
How do I run gprof such that I can pass command line paramaters to my binary.
ie. I want to run a.out -f file.txt -n 100
I tried gprof a.out -f file.txt -n 100 gmon.out > profile.txt
But it didn't work! This HAS to be pretty simple.
Can anyone think of a more readable way to convert an int to a std::string then what I have below:
std::string FilePath;
std::stringstream ss;
std::string FileNum;
for(int i=0 ; i < 5; i++)
{
ss << i;
ss >> FileNum;
FilePath = "/blah/blah/FileName" + FileNum + ".txt";
cout << "File to open:"...
I am working on a fairly large project that takes 5 or so minutes for a complete compile and have been experimenting with using <a href="http://ccache.samba.org/">ccache</a> in order to speed up the build process.
I know however, that there is no such thing as a free lunch and that there must...
That will teach me to not read everything in the docs.
SELECT message FROM BT_MESSAGES, BT_MEMBERSHIP WHERE (BT_MESSAGES .Who = "USR_username1") OR (BT_MESSAGES.Who = "USR_ALL") OR (BT_MESSAGES.Who = BT_MEMBERSHIP.GroupID AND BT_MEMBERSHIP.GroupID = "username2") ;
Should work just fine...
Does anyone see anything wrong with:
SELECT Notes FROM BT_Messages WHERE (Who = "USR_username1") OR (Who = "USR_ALL") OR (Who IN (SELECT GroupID FROM BT_Membership WHERE UserID = "username2")) GROUP BY UID,Notes ORDER BY UID
Guys,
Thanks for your help. The one thing I was confused with in the beginning was that an exec() call gets the PID of the caller. You guys managed to more then clear that up!
Thanks
Smilee
Forking to get a child process to start another program is fine and all but the external program (program2) that needs to be started would still have a different PID then the thread that starts it. The problem remains that I need the pid of program2.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.