--------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E5W00005 Date: 05/25/97 From: JERRY COFFIN Time: 10:21am \/To: JAVIER KOHEN (Read 3 times) Subj: LOW LEVEL OPTIMIZATIO 1/2 On (18 May 97) Javier Kohen wrote to Jerry Coffin... JK> Jerry, I certanly do *not* agree with Herman, but you do not have to JK> use all the CPU time to show 300 fps, you can show just 30 fps, and JK> leave the rest of the time to other threads... Quite true, but more or less irrelevant. It turns out he wasn't talking about frames per second at all, but shaded triangles per second. This changes the situation entirely - while 600 FPS is entirely useless, it's quite easy to use 600 triangles per second, and a lot more besides. In fact, 600 triangles per second is relatively slow - using OpenGL on my AMD 5x86/133, I get a couple thousand triangles per second. With a heavy duty graphics accelerator, you're looking for figures in millions of triangles per second range. Later, Jerry. ... The Universe is a figment of its own imagination. --- PPoint 1.90 * Origin: Point Pointedly Pointless (1:128/166.5) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E5W00006 Date: 05/21/97 From: LOUIS RIZZUTO Time: 08:39am \/To: JERRY COFFIN (Read 3 times) Subj: LOW LEVEL OPTIMIZATIO 1/2 > On (15 May 97) Louis Rizzuto wrote to Carey Bloodworth... > LR> Is it plausible to write such RT apps in C++ - and still meet real > LR> time criteria? I am not sure. Perhaps some else here can comment > LR> on this. > Yes. There's not a lot of difference between doing RT > programming in > C and in C++. In both cases, there are some obvious > restrictions such > as on using dynamic memory allocation unless your library has > an > allocator with know worst-case speed. > One thing that does change is that typical C++ programs _do_ > tend to use > dynamic allocation more than their C counterparts, at least > in my > experience. Likewise, it's not necessarily as easy to "see" > which > things are likely to consume time by examining source code. > For > instance in C an assignment statement: > a = b; > is always going to be relatively simple and straightforward. > About the > only time it's going to consume significant time is if `a' > and `b' are > struct's of relatively large size. > However, in C++, that same assignment statement might > disguise an > arbitrary amount of complex code, and may well involve a > number of > function calls. > However, in both cases things come out more or less the same > in any > case: you've got to find your absolute worst-case path > through the code > and you've got to verify that it's within requirements. Thanks for replying Jerry. In Real Time apps, both memory and execution time are often critical. I agree that typically C++ pgms use dynamic allocation of memory but I wonder if this is adviseable in a C++ RT app due to typical RT memory constraints. C++ complex generated code may add to the problem of controlling both memory and execution times. C++ is primarily a language noted for reuseability of code; but are RT apps so similar that they would benefit from such reuseabilty? If the guess that C++ can be used in a RT envirnment proves to be a fiasco backing off and back to 'C' and ass'y may cancel out any perceived labor benefits from using C++. What do you think, Jerry? For that matter why not use Java since it claims portabilty and is coming on strong as the future development environment? Regards, -= Lou =- --- * Origin: Chicago ire BBSį (1:2624/603) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E5W00007 Date: 05/21/97 From: LOUIS RIZZUTO Time: 07:25pm \/To: ALL (Read 3 times) Subj: C++ - the promise Hi, All. Has C++ been a boon or a fiasco in saving labor time since it's inception? How long has C++ been around as an 'accepted' language for project work? Since 1992 - I am not sure. C++ hung it's promise of saving programmers labor time on the eventual 'resuseability' of C++ code. Has this promise been met thus far? Have you personally witnessed the fullfillment of this promise? I would like to hear your experiences - and your opinions on this matter. Another matter that concerns me is what will happen to this promise of reuseability of C++ code if Java becomes the language of the future - in a year or so? Will C++ be abandoned if Java becomes the new standard language for new projects - for development? Will C++ be relegated to the back burners - being used merely for 'maintainenance' as has happended to so many past languages like Cobol, RPG, PL-1, 'C'(???), etc? What happens to older production programs like Cobol, RPG, etc? Most of us wouldn't care - except for the YK2 phenomenon. Yet now the hourly rates for software contractors has almost doubled for Cobol, Rpg, programmers. Will this lure the older C++ programmers who were knowledgeable in Cobol and RPG away from their C++ work and to doing Cobol and RPG stuff again? Will programmers who never used Cobol and RPG and haven't a clue about what they were or are now be lured into studying Cobol and RPG so they can perhaps double their rate of pay? If so, if C++/Windows/UNIX types are lured into doing Cobol and RPG programming what will happen to C++ for the next 2.5 years till the year 2,000 is past us? Will the job market be there for the C++ programmers? Will the rates for C++ programmers increase as a rsult of programmers being drawn into the YK2 problem? What about Java? How will it impact job demand for programmers with C++ skills? When? Will thos former C++ programmers now lured into doing Cobol and RPG for the next 2.5 years being willing or able to re-enter a C++ market after the year 2,000? What will the C++ market look like after the year 2,000 - as compared to Java at that time? Will what happened to Cobol and RPG programmers after "C" and C++ took the programming field by storm become just like them after the year 2,000? What will happen to network and database development during the next 2.5 years - and after? My interest in these kinds of questions relate to my experience in project management and architecture of systems - and my personal interest in future trends and what I should be doing now to prepare myself for the changes that may result in the near term. Perhaps you will find it worthwhile to discuss these issues. Regards, -= Lou =- --- * Origin: Chicago ire BBSį (1:2624/603) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E5W00008 Date: 05/24/97 From: LOUIS RIZZUTO Time: 12:46pm \/To: CAREY BLOODWORTH (Read 3 times) Subj: LOW LEVEL OPTIMIZATIO 1/2 > LR>consulting job I get calls on during the last 2 years states they want > "C/C+ > LR>programmers. I keep thinking this is a mistake on the part of the > people > LR>coming out with kind of job spec but perhaps I am in error. > LR>Is it plausible to write such RT apps in C++ - and still meet real time > LR>criteria? I am not sure. Perhaps some else here can comment on this. > The author found numerous mistakes in the Intel ref books > concerning > instruction clock cycles, but as near as he could figure, > each call of > the ISR should take about 104 cycles. The actual timed > result gave 148 > cycles at best. At worst, he got 272 cycles. Then, with the Hi, Carey. Thanks much for that detailed analysis. I can appreciate those facts based on studies done. I recall reading several years back now that Intel had problems w/ certain hardware instructions being very buggy. Intel allegedly releases - for each new cpu they come out with - a list of buggy hardware problems to certain vendors like Borland and MS and probably other compiler vendors. This is so they can write code workarounds these buggy hardware instructions. Unforutnately this article indicated that it is hard for anyone else to get on this vendor list for Intel's buggy hardware instructions. Wha'? As a result, I have studiously avoided writting any ass'y language code of any kind that goes into *my* personal software products. I simply didn't want to take the many man-months involved investigating Intels hardware cpu instructions and decided to rely on Borland to do this for me - or some other compiler vendor. This is for 'normal' apps - non real time. RT apps are much more demanding so it follows that a programmer must learn every crook and cranny inside the hardware to write reliable code - in any language IMHO. So I asked myself, 'What benefits might accrue a client if I wrote RT apps in C++ as they claim they want done - and what benefit would accrue to me in terms of experience I can sell to other prospective clients in the future?'. I simply have never believed the market hype about C++ or any other OOP's language having the benefit of 're-useable code' - even as desireous as that certainly is. Yes this claim will benefit companies - until something 'better' comes along - like JAVA. Now where does that 'reuseability benefit go'? In this circumstance, companies are left with production code qritten in some OOP's language just like Cobol and RPG and PL-1 - nowhere. It is fine as long as those production programs never need to be revised but who will revise them if everyone is doing Java some years hence? Same for RT apps - or any apps for that matter. It is like trying to 'freeze' a pgm written for the 286 - where do you buy 286's now-a-days that is mainstream - where do you get the parts or the maintanence agreements? (See next msg for continue) --- * Origin: Chicago ire BBSį (1:2624/603) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E5W00009 Date: 05/24/97 From: LOUIS RIZZUTO Time: 01:17pm \/To: CAREY BLOODWORTH (Read 3 times) Subj: LOW LEVEL OPTIMIZATIO 1/2 (Part II continued) OK, so maybe the client will buy this logic and decide to stay w/ something like 'C' but that only eleiminates the problems "C++" might cause - it does nothing for the hardware problems w/ Intel processors. BTW, if you have a source for the information you supplied in your msg, I sure would like to have it. I might need it to pursuade a client. :) Unfortunately , I do not remember my source. :( Further, where are the benefits to people like me - consultants who usually do this kind of work. Where is the demand for follow-on work that makes getting involved in RT apps worth while? What do people like me do if the next RT apps demand is 2 years after the end of the first one? Employers now-a-days virtually still demand - even with the un-employment rate being less than 5% in general and around 3% in the Boston Metro arena? OPPS, how crass of me to want to stay employed. :) Where's the 'beef'. :) Thanks to you stimulating my ass'y language juices - almost dried up over the last ten years or so - I think I will be even more cautious in regard to taking on such contracts. Aside: Two years ago Hugh's Communication couldn't find anyone who could still do machine language and was delighted that they found me; but not delighted enough to hire me at the very high rates I demanded. I couldn't have cared less. Most companies are business 'jokes' IMHO. They can't afford the people who have the job skills they demand. So they do without - what else. It seems to me that out of every 100 job requirements being given to contract firms - according to the recruiters I talk to in the NE Region - only five (5) percent are being filled. The companies can't find the people they claim they need at the prices they can afford. It seems the only real jobs out there that companies can afford are the for people with 3 - 5 years of experience. In RT embedded apps job requirements the same is true based on my experience. I think I will stick w/ my database and network stuff - unless or until Cobol and RPG start paying $150/hour for the Y2K problem - or more. Don't laugh yet. Some recruiters told me that Cobol and RPG programmers are demanding $150 - 200/hour. Of course they aren't getting it - *yet*. But as the Y2K problem looms close and the corp execs can now *see* that inpentrable wall - the year 2000 - who knows what these desperate decison makers(I say this with tongue in cheek) will do - besides 'crash and burn'. Recruiters tell me the Cobol pgmers are ROFL when they hear that they, the recruiters, are not seeing any demand - yet. Con't give up your daytime C++ job just yet but who wouldn't want to make more than the $45 - $55/hour rate common now for C++ pgmers - hmmmm? By my calculations, based on 1986 dollars, has the buying power of $22.50 - 27.50/hour. Sorry I got carried away a bit. Thanks again for the warning. Regards, -= Lou =- --- * Origin: Chicago ire BBSį (1:2624/603) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E5W00010 Date: 05/25/97 From: VADIM DAVYDOFF Time: 05:50am \/To: PAUL DRUGGITT (Read 3 times) Subj: passing structures to functions Hello Paul! 16 May 97 22:57, Paul Druggitt wrote to All: PD> Now, is it possible to write a single function that will accept ANY PD> structure as a parameter, stating which member to compare? According to the EchoTag, we are talking about C++, right? Simply use a base class with the only data member as a type identifier. class CBase { public: int m_iType; }; Then, derive all your other classes from it just like: class CBig1 : public CBase { public: CBig1 () {m_iType = 1;} char m_acData1 [20]; char m_acData2 [100]; }; class CBig2 : public CBase { public: CBig2 () {m_iType = 2;} char m_acData1 [25]; char m_acData2 [200]; int m_aiData [10]; }; Use a pointer to the CBase as your function paramter. In function body check the type member and then convert a CBase* to the appropriate type. void f (CBase* p) { switch (p->m_iType) { case 1: // use (CBig1 *)p as you need break; case 2: // use (CBig2 *)p as you need break; // ... } } This is a simple but stupid way. Using virtual functions is a better, I hope you are familiar enough with C++. Vadim --- GoldED 2.41+ * Origin: ---- * BackSpace * St.Petersburg * Russia * ---- (2:5030/122.72) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E5W00011 Date: 05/26/97 From: FRANK MASINGILL Time: 01:07pm \/To: CLIFF RHODES (Read 3 times) Subj: getline? > FM>void main() > Frank, please use int main(void) !!!! Thanks, Cliff, I will. But WHY do the books I'm following not use it? They are some of the most promient names like Lafore, etc. I'm not implying that means they are right - just asking why you make a point of it? > FM> InFile.getline(buffer, MAX); > FM> cout << buffer; > FM> Instead of the expected result of the second file > FM>reading in the two lines as separate lines it is being read > FM>in as merged into one line. What am I doing wrong? > getline() removes the '\n' at the end of the line--it doesn't > store it > in buffer. So, when you display buffer you don't get the > newline. > Use cout << buffer << '\n'; O.K. I was following Lafore _Object Oriented Programming in Turbo C++_, Chapter 14, page 523 and he said the getline function read the characters UP TO the newline character and failed to say it "removes it" I added the code you instructed and, of course, it worked - and I learned something. Thanks "teach" (grin) Sincerely, Frank --- FMail/386 1.02 * Origin: Maybe in 5,000 years frankmas@juno.com (1:396/45.12) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E5W00012 Date: 05/25/97 From: CHRISTOPHER BUTLER Time: 09:32am \/To: ALL (Read 3 times) Subj: fstream.h Hi All! How do I use the fstream classes in Turbo C++? My help file is corrupt, and my manual went to that placeof eternal happiness untidy people call "somewhere" ages ago... Chris --- FMail/Win32 1.22 * Origin: Death Butler BBS, +44-1582-620141, 24 Hours (2:257/135) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E5W00013 Date: 05/24/97 From: VIRGIL GARNESS Time: 05:16am \/To: JASON HULME (Read 3 times) Subj: cin >> errors Hi Jason, -> if an char value is inputed into a cin << input, where input is defined as -> a float my program goes "crazy" All inputs after the cin .. are not -> accepted. Is there a way to get around this? I plan to have a window pop up -> and say "Invalid amount please redo" -> I have tried: -> if (input!=float) cout <<"invalid"; -> ...but the program still exectued the same. try: if (input !==float) cout << "invalid"; In your case of this I beleive you are trying to assign the value of float to input. -> Another problem I am havings is reading a float value for a file using -> _dos_read. The only content of the file is 123.45 but when dos_read reads -> this value is returns 123.45\x1. What does \x1 mean? This is an unprintable character '\x###' is the Hexadecimal equivelent (1 or more hexadecimal digite specifing the interger value of the desired character) not sure if that is the character it is returning or the interger itself. Are you using a C or C++ compiler? Hope this helps till Later..... --- Platinum Xpress/Win/Wildcat5! v2.0 * Origin: Al's Force BBS 44-1638-532437 Fido 2:2501/206 (2:2501/206) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E5W00014 Date: 05/25/97 From: VIRGIL GARNESS Time: 09:46am \/To: DAN CHAK (Read 3 times) Subj: RE: Getting to next line Mongo like DAN CHAK, Mongo write back: DC> Does anyone know a quick way to get to the beginning of the next line of DC> an istream text file? DC> Thanks to anyone who responds! DC> Dan Try: inFile.ignore(100,'\n') inFile- the name of your ifstream file .ignore(100, '\n') - this will ignore 100 characters or at the end of the line. Hope it helps Later..... Virgil Garness ==Mongo wuz here== ... Al's Force BBS == Down Not out == Fido 2:2501/206 Xnet 99:1/724 --- Platinum Xpress/Win/Wildcat5! v2.0 * Origin: Al's Force BBS 44-1638-532437 Fido 2:2501/206 (2:2501/206)