--------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EBJ00013 Date: 07/15/97 From: KURT KUZBA Time: 12:52am \/To: BORIS TERZIC (Read 3 times) Subj: Palette in textmode? BT> JN> I was told that textmode (80x25 / 80x50) work same way... BT> It's the same palette that is used and hence the same BT> code as for mode 13h, keep in mind though that in BT> textmode only the first 16 colors are used. It seems that the text modes do not use the VGA palette. They use the EGA palette, in which the order of the colors is slightly different. Try using these values: Dark Black 0 Bright Black 56 Dark Blue 1 Bright Blue 57 Dark Green 2 Bright Green 58 Dark Cyan 3 Bright Cyan 59 Dark Red 4 Bright Red 60 Dark Magenta 5 Bright Magenta 61 Dark Brown 20 Bright Brown 62 Dark White 7 Bright White 63 These should work for changing your colors in the available standard text modes. > ] What do you mean, "There is more to life than computers."?.. --- * Origin: *YOPS ]I[* 3.1 GIG * RA/FD/FE RADist * Milwaukee, WI (1:154/750) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EBJ00014 Date: 07/14/97 From: BEN Time: 06:21am \/To: KEVIN CAMPBELL (Read 3 times) Subj: Video Modes *** Quoting Kevin Campbell to Stefan Russo dated 07-04-97 *** > > Is there any way to set the text screen to any setting of Rows and > > Columns.. Maybe 132x60 or something?? > > Nope. > Virtual screen? ... No?>....hmmm.. --- 6b416e55724565446549 * Origin: -------------------------------------------------------- 1:246/54) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EBJ00015 Date: 07/14/97 From: BEN Time: 06:23am \/To: THOMAS MAEDER (Read 3 times) Subj: QUIERO APRENDER C++ *** Quoting Thomas Maeder to Fernando Ariel Gont dated 07-13-97 *** > FG> But about writing my messages in Spanish, I think that the fact that > FG> of people around the world speak English is not a valid reason for > m > FG> write my messages in that language, because there are millions that > FG> Spanish..... > > Correct. But the fact that about 100% of the people frequenting this > and > other conferences, Usenet groups etc. understand English is. > Besides that , english is the official language of FidoNet. Unless other wise of course :) .... ie, an area like FRECH_CHAT ... You obviously would not be welcomed if you spoke english in ther. --- 6b416e55724565446549 * Origin: -------------------------------------------------------- 1:246/54) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EBJ00016 Date: 07/15/97 From: BOB STOUT Time: 01:05am \/To: CAMERON CLARK (Read 3 times) Subj: Re: Signs of numbers On , Christopher Butler (2:257/135@fidonet) wrote: RS> 1. It only works on two's-complement machines. The C and C++ language RS> standards have been written to allow implementation on machines sing RS> other numeric representations. > The implementation of the language on a specific machine should > take care of the work for you. Cameron... Yeah, but the code in question determines whether a numer is negative or not by testing the high bit. On a 1's complement machine (yes, there are such beasts and they do have C compilers), it will fail. RS> 2. Your code only works on char's. Any other integral type (short, int, RS> long will break it. > The pseudo-code was meant only to display how to do it for a > specific data type. The rest would take too much explaining - not all > C++'s have the same size for int,long int, short and the like. It wasn't clear from the post that it was pseudo-code. RS> 3. Your code is guaranteed not to work on floats or doubles. > I don't know the standard encoding that C/C++ uses. I've only > studied such encodings on a VAX/VMS machine and don't have the > bit diagram memorized. > Still, one bit of the float is the sign for the encoding I > studied and I'm sure its not much different that what C++ specifies. If the compiler in question uses IEEE standard formatting, this is true. However, just with integer types, there's no guarantee that the internal representation uses 2's complement. Even assuming IEEE formatting, the sign bit isn't in either the MS- or LS-bit. RS> 4. Even if you restrict your functionality *only* integral type and add RS> support for short's, int's, and long's, it will fail on unsigned RS> types. > It would be stupid to want to test the sign of an unsigned variable. Perhaps, but it should still be smart enough to return 0 or 1 only. RS> 5. Depending on your machine's architecture, it may fail on multibyte RS> integral types depending on the "endianness" of your hardware. > Bite your tongue. I've ran the code on little and big endian > machines - the compiler will uses the correct interpretation of > bit possitions. It is from left to right, most to least significants. > I've used the same code on vax,dec,alpha,pc. Knowing before hand > the 4 of the machines on the network are big endian and I was > running a client server on a little endian machine. This is probably true, but it still seems to be an unsafe assumption. --- QM v1.00 * Origin: MicroFirm : Down to the C in chips (1:106/2000.6) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EBJ00017 Date: 07/15/97 From: BOB STOUT Time: 01:10am \/To: JERRY COFFIN (Read 3 times) Subj: Signs of numbers On , Jerry Coffin (1:128/166.5@fidonet) wrote: RS> The bottom line is that a single function... RS> int sgn(double x) RS> { RS> if (x > 0.0) RS> return 1; RS> if (x < 0.0) RS> return -1; RS> else return 0; RS> } RS> ...would work just fine in C, but in C++, either a template RS> implementation or overladed functions would be best. > I think in this case a templated function is preferrable to an > overloaded function: > template > int sign(const T &x) { > if ( x > 0) > return 1; > else if ( x < 0) > return -1; > return 0; > } Jerry... The original code I posted in this thread began: #if defined(__cplusplus) && __cplusplus #if (defined(__SC__) && __SC__ >= 0x700) || \ (defined(_MSC_VER) && _MSC_VER > 800) || \ (defined(__WATCOMC__) && __WATCOMC__ >= 1000) || \ (defined(__BORLANDC__) && __BORLANDC__ >= 0x450) template inline int sgn(const T n) { if (n > 0) return 1; if (n < 0) return -1; return 0; } #else /* no templates */ /* Overloaded C++ functions and C version follow */ The message you quoted specifically referred to the C version (which used a macro to control whether to use an unsafe macro for the C implementation). Sorry, we should have taken it to the C_Echo instead. > This should work for any type for which comparison to 0 and having a > sign makes sense. The only problem that might arise would be things > like smart pointers that define comparison to 0 only in terms of equal > and not equal, rather than less than/greater than. In particular, I've > seen a few that would do things like saying a pointer was both less than > AND greater than 0, as long as it wasn't equal to 0. In this case, > the "sign" you obtained for that pointer type wouldn't depend on the > pointer itself, but on the order in which you did the comparisons. > These might handle the comparison by defining a conversion of int to the > smart pointer, then compare the two, in which case the comparison might > not work very well. Strongly preferrable is for the smart pointer to > explicitly define the comparison operators it supports (==(int) and > !=(int)) and make the conversion from int to smart pointer explicit, > meaning you'd have to use `T(0)' to get 0 converted to a pointer. > Unfortunately, there are still quite a few compilers around that don't > support the explicit keyword. Good point. I suppose it should be noted in the code that anyone wishing to use the template version to compare such pointers should try it before trusting it. --- QM v1.00 * Origin: MicroFirm : Down to the C in chips (1:106/2000.6) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EBJ00018 Date: 07/15/97 From: BOB STOUT Time: 01:18am \/To: MIGUEL ANGEL SCAPOLLA (Read 3 times) Subj: RE: Signs of numbers On , Miguel Angel Scapolla (4:90/90@fidonet) wrote: > Or implement this function via macro definition: > #define SIGN(x) (((x) > 0) ? 1 : (((x) < 0) ? -1 : 0)) > And use this: > int z = SIGN (y); Miguel... As previously noted, this is an usafe macro. Consider what happens when you do somtehing like... int z = SIGN(y++); ...Some of the time, y will be incremented once, sometimes twice. --- QM v1.00 * Origin: MicroFirm : Down to the C in chips (1:106/2000.6) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EBJ00019 Date: 07/14/97 From: JERRY COFFIN Time: 11:47pm \/To: KEN WAUGH (Read 3 times) Subj: fork for watcom On (13 Jul 97) Ken Waugh wrote to Carey Bloodworth... KW> Ever heard of Gateway 2000 ? South Dakota, fortune 500 ? Just snubbed KW> their nose at a M/S buyout ? KW> They just aquired Amiga and have already released 2 licenses for KW> development. [ considerably more about the Amiga elided ] Please keep the Amiga specific discussions in an appropriate area, and keep the C++ specific discussions here. Thank you. Later, Jerry. (C_PLUSPLUS Moderator) ... 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: EBK00000 Date: 07/14/97 From: CAREY BLOODWORTH Time: 09:23pm \/To: KEN WAUGH (Read 3 times) Subj: RE: FORK FOR WATCOM KW>Ever heard of Gateway 2000 ? South Dakota, fortune 500 ? Just snubbed heir KW>nose at a M/S buyout ? Yes. And I did know they had bought it. They make the, what, 5th company to own it. And if they actually get something out the door, they'll be the first ones since Commie. KW>Babylon 5 about a space station. Guess what !.. Amigas have a big part in KW>that. I am aware of the graphics programs for it. There are a couple of Amiga owners around here. And the local FOX & UPN station(s) use one for their promotional graphics stuff and the guy that did that was on this board regularly. There is still software being written for my old 8 bit CoCo, and a few 'hobbiest' companies still make some hardware for it, but none the less, the platform itself is dead. There has even been talk of resurecting it and doing all sorts of 'neato' things to it. None of it came to anything though. Just like the Amiga. KW>The specs for the newest Ami would make you drool... Unlikley. I don't drool over anything less than a Cray. KW>Inet.. The last press release showed some specs, not all of where Ami is KW>headed in hardware, no actual prices yet, but I'd guess still way below Well.... There have been several previous companies that had big plans but never actually released any new designs. I'm aware the Amiga is still popular. But considering it's off, on, off, off, on off, off, etc. history.... If it's not dead, its more than a little close. I guess you could call it the 'zombie' platform. (Hey, that sounds like a catchy name for the next (?) version. Mention it to Gateway, they might get a kick out of it.) --- QScan/PCB v1.19b / 01-0162 * Origin: Jackalope Junction 501-785-5381 Ft Smith AR (1:3822/1)