|
For those who have expressed an interest in my PM Article[^], you should be glad to know some more stuff is on the way. I am going on a 4-week assignment and will have some evening time to devote to culiminating my thoughts and information.
I've also been toying with the idea of writing a PM book geared toward SW dev, you know, the usual technical stuff with a "mini-BAM" of my dry humor. Any thoughts or ideas?
~Nitron.
ññòòïðïðB A start
|
|
|
|
|
|
Marcie,
You are almost everywhere.
God is Real, unless declared Integer.
|
|
|
|
|
|
Marcie Robillard (Datagrid Girl) wrote:
I try
You are doing well so far
I'll write a suicide note on a hundred dollar bill - Dire Straits
|
|
|
|
|
|
|
Chloe was born on 11.October.2003. She was 7.0lbs and 20" long.
Chloe-1[^]
Chloe-2[^]
Chloe-3[^]
Chloe-4[^]
Chloe-5[^]
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
Sorry for being a late reply... the baby is sweet
He who controls others may be powerful, But he who has mastered himself is mightier still.
|
|
|
|
|
Cool, I was wondering when I'd get one of these!
If there's anything you want to ask me, just drop me a line!
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
Let me preface this with the fact that I'm obviously new to the game...
I'm coding an app that needs to store data that will be read from a file such that the data is accessible throughout the life of the app (like a database) and from multiple functions. I'm thinking of using a class/struct to store the data, but I'm not sure about the most efficient way to store/read the data, while maintaining the ability to read the data from multiple functions (this is a Windows VC++ app, dialog-based). To add to my confusion, I have trouble understanding when/where to use pointers more generally. Thanks for any advice.
- Blitzn
|
|
|
|
|
I will first modestly point you to two of my articles on the topics you mentioned.
1. For the "database" app, you can use several techniques. However, if you want to maintain simplicity for possibly rendering of the data in another application like Excel or Access; you can stick with the CSV (Comma-Seperated-Values) format. For an implementation of this technique, I suggest you download and study this[^] article. If you are storing more than numerical data, you can change the datatype to CString if necessary. You may also want to consider XML, for there are some nice XML parsers scattered about CP.
2. The aformentioned article will illustrate some pointer usage in practice. For more info on pointers, you can read my second article: A Prelude to Pointers[^].
Good luck, and don't give up. If you have more questions, post in the VC++ forum[^]. If no one responds, that usually means no one really knows a solution. However, I occassionally scroll through unanswered questions as do many others, so don't be surprised if an answer comes strolling in 3 months after you post.
There are many talented programmers that frequent this site, so don't be shy about posting questions. Since you are new to the site, a good piece of advice is to be sure to post in the proper forum. Good, helpful, sociable, nice people have been known to light men on fire for posting programming questions in the lounge ! A listing of all the forums can be found here[^].
Have fun, and welcome to CP!
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
two things...
1) I am surprised "Nitron" was available as a name and you just picked it up
2)"But in between all that, I integrate, test, and fix digital flight control systems for aircraft."
this sounds very cool and yet intense. I spent my many days on an aircraft carrier, USS Carl Vinson, and help support the daily flights of our airwing in the aviational storerooms. It is amazing how many people it really takes to make things work. It is a small world. (Joe goes away singing, disney's "It's am small world afterall"....)
Later, JoeSox www.joeswammi.com
"You may be against the war, but don't be against the soldiers there who are fighting it. I joined to serve my country but when I was there I was fighting to protect my friends,"
Sergeant Charles Horgan said in a hospital after Iraqi troops in civilian dress opened fire on them at the city of Nassiriya
|
|
|
|
|
JoeSox wrote:
I am surprised "Nitron" was available as a name and you just picked it up
I'd tell you where I got the name from, but then it wouldn't be cool anymore...
JoeSox wrote:
)"But in between all that, I integrate, test, and fix digital flight control systems for aircraft."
this sounds very cool and yet intense.
It is pretty slick. My background is Aerospace Engineering, and I worked in IT thru college. I just kinda stumbled into software development. What's cool is that I am on the integration and test team, so I still get to write cool code, yet I'm not just a code monkey. I get to play with the hardware and still stay in touch with technology. A friend of mine went the structural analysis route, and now spends all day in CATIA on an AIX machine with no internet connection
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
Nitron wrote:
no internet connection
Later, JoeSox www.joeswammi.com
"You may be against the war, but don't be against the soldiers there who are fighting it. I joined to serve my country but when I was there I was fighting to protect my friends,"
Sergeant Charles Horgan said in a hospital after Iraqi troops in civilian dress opened fire on them at the city of Nassiriya
|
|
|
|
|
Hi, I found your CDataFile class here using Google.
I wanted to alert you to a little pitfall that showed up when I brought it over to Linux (gcc 3.2 and its standard library being the relevant environment.) Maybe it just works differently on Windows.
With your ifstream theCSV, you close() and open() it several times. Apparently calling open() does not clear the eof bit, and there is no error checking in your code, so all the gets fail silently after the first rewind. To work around this I only had to call clear() after close(). I looked in the Stroustrup book but didn't find any guidance on this point.
Don't you just love the C++ standard library.
Another thing I did was to get rid of all the char buff[1024] and use std::string and the other getline() format. Since I implemented MFC CString as a subclass of std::string, this cleaned up nicely.
Thanks for the code, porting it was more fun than writing my own from scratch (I figured it was time to shop around.)
-Erik
|
|
|
|
|
I have a new version that I've been using that rids all dependence on MFC and fixes some bugs in the process. I haven't had a chance to re-write the article yet, but if you're interested the new parsing routine looks like this:
switch(ulCDataFileFormat)
{
case CDATAFILE_CSV_FORMAT:
{
char buff[MAX_FIELD_BUFFER] = {0};
std::ifstream theCSV;
theCSV.open(szFileName);
int i = 1;
do
{
if (theCSV.peek() == chDelimiter)
i++;
} while (theCSV.get() != '\n');
int nVars = i;
theCSV.ignore(MAX_LINE_BUFFER,'\n');
i = 1;
do
{
if (theCSV.peek() == chDelimiter)
i++;
} while (theCSV.get() != '\n');
if(i != nVars)
{
sLastDataFileError = "The Number of Headers is different than the Number of Data Columns!";
return false;
}
theCSV.seekg(0);
int iVar = 0;
for(iVar=0; iVar<nVars; iVar++)
{
m_pVariables.push_back(new CNamedVariable);
theCSV.getline(buff, sizeof buff, (iVar == nVars-1) ? '\n' : chDelimiter);
m_pVariables.at(iVar)->sVariableName = buff;
}
do
{
for(iVar=0; iVar<nVars; iVar++)
{
theCSV.getline(buff, sizeof buff, (iVar == nVars-1) ? '\n' : chDelimiter);
if(buff[0] != '\0' && buff[0] != '\n')
m_pVariables.at(iVar)->vData.push_back(atof(buff));
}
}while(!theCSV.eof());
theCSV.close();
if(m_pVariables.back()->sVariableName.find("\n")!=-1)
m_pVariables.back()->sVariableName.resize(m_pVariables.back()->sVariableName.length()-1);
break;
}
It is much cleaner too.
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
|
dnh wrote:
tell me how to beat you (Human) with Night elves
you can't. Seriouslly, do you play? An old college roomie and I usually play on Friday nights ~ 7PM CST. Let me know if you want in.
To beat me with NE, get your PotM and DH up to lvl 6 ASAP. I will try to quell your starfall with my MK, but if your DH does a few mana-burns on me first, i'll be toast. You activate starfall, and in my pride, i will doo all i can to kill the PotM. After I realize she's not dying and my units are falling from the face of the earth, it'll be GG. Be sure to get a good blend of units and don't go with the normal "chippo" routine or the like. The DH with his demon-form thing usually kicks my a$$ too...
~Nitron.
ññòòïðïðB A start
|
|
|
|
|
Nitron wrote:
you can't. Seriouslly, do you play?
We'll see. Some people say I have some skills, but I think I suck (usually). I play it like for two months (holidays ) but I play a lot... OK one nice day big DNH will join the Friday battle.
Nitron wrote:
get your PotM and DH up to lvl 6 ASAP.
ASAP. Yeah that's the problem. Before I get there I lose to rifleman/casters I usualy don't survive the first attack.
And yes, DH level 6 or more is pure evil :P
Btw while writing this I got some ideas what to try against humans.. hmm
Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy
|
|
|
|
|
dnh wrote:
one nice day big DNH will join the Friday battle.
Is big D up for the challenge tonight? If you get a chance to play, bing me on IM (aol): Nitron69 I should be online ~7PM/CST (wife and 2-yr-old permitting ).
~Nitron.
ññòòïðïðB A start
|
|
|
|
|