f



Overloading / Getting rid of cout

Hi,

I'd like to get rid of all the cout stuff in my code.

Following situation:

Way over 2000 files, search and replace in all of them is not an option.
All of the files include a basic header.
In this basic header i must NOT include iostream.
Iostereams thus get included after my basic header, at any random place 
in the code.

What I'd like to do is change the behaviour in a way that everything 
sent to either cout or cerr comes to my own stream class (which is 
accessible by including the base header) or can at least be supressed 
(this is easy though)

with kind regards Philip

0
philip3816 (19)
6/29/2003 1:55:54 PM
comp.lang.c++ 49423 articles. 6 followers. Post Follow

8 Replies
197 Views

Similar Articles

[PageSpeed] 28

"Philip Lawatsch" <philip@waug.at> wrote in message
news:3efeef2d$1@e-post.inode.at...
> Hi,
>
> I'd like to get rid of all the cout stuff in my code.
>
> Following situation:
>
> Way over 2000 files, search and replace in all of them is not an option.
> All of the files include a basic header.
> In this basic header i must NOT include iostream.
> Iostereams thus get included after my basic header, at any random place
> in the code.
>
> What I'd like to do is change the behaviour in a way that everything
> sent to either cout or cerr comes to my own stream class (which is
> accessible by including the base header) or can at least be supressed
> (this is easy though)
>
> with kind regards Philip
>

Search and replace is the correct option, write a program to do it, or if
you are on Unix/Linux use a tool like sed or awk.

john


0
6/29/2003 1:54:46 PM
John Harrison wrote:


> Search and replace is the correct option, write a program to do it, or if
> you are on Unix/Linux use a tool like sed or awk.

Well, I'm aware that this would be a correct solution, but I'm afraid i 
just can't do this.

Thus I was looking for something else, perhaps some special stuff the 
iostreams provide for this


with kind regards Philip

0
philip3816 (19)
6/29/2003 2:07:27 PM
John Harrison wrote:

> You can redirect cout. Forget the exact syntax but its something like
> 
> int main()
> {
>     streambuf* save_buffer = cout.rdbuf(my_stream.rdbuf());
>     ...
>     cout.rdbuf(save_buffer);
> }


Hmmm, nice thought, though this leads to a problem.
Using this approach it seems that my code (my stream code) won't get 
called when data is written, and this would result in a huge buffer needed.

(One of the reasons I'd like to get rid of all this couts is that huge 
amounts of output are written out).

Also, using this approach I could not easily filter the output I get and 
only write some of the stuff out because I could only do it when I'm 
inside the my stream class. Thus this would result in a huge lagg of 
output since some parts of our code run for several minutes until 
controll returns to some part where I could initiate parsing this buffer.


with kind regards Philip

0
philip3816 (19)
6/29/2003 2:15:26 PM
On Sun, 29 Jun 2003 19:38:24 +0200, Philip Lawatsch <philip@waug.at>
wrote:

>John Harrison wrote:
>
>>>Hmmm, nice thought, though this leads to a problem.
>>>Using this approach it seems that my code (my stream code) won't get
>>>called when data is written, and this would result in a huge buffer
>> 
>> needed.
>> 
>> Sounds like you've put your stream code in the wrong place. It should have
>> gone in the streambuf derived class you created (or should of created). The
>> stream derived class should just be a thin wrapper around the streambuf
>> derived class where the real work is done.
>
>I see ...
>
>For portability issues (we're compiling on more than 6 unices, linux and 
>windows).
>
>Due to crappy compilers and ill behaved std libs we tried to code as 
>much of the basis framework ourselves as possible, and thus my stream 
>class is not derived from streambuf.
>
>I'll have a look at this option !

What have you got currently? What does your stream class look like? If
you haven't derived from streambuf, I'm curious as to how your stream
class works. Is it completely independent of the iostreams heirarchy?

Tom
0
tom_usenet3 (1118)
6/30/2003 2:52:45 PM
tom_usenet wrote:
> On Sun, 29 Jun 2003 19:38:24 +0200, Philip Lawatsch <philip@waug.at>
> wrote:

> 
> What have you got currently? What does your stream class look like? If
> you haven't derived from streambuf, I'm curious as to how your stream
> class works. Is it completely independent of the iostreams heirarchy?

Yep, it is

I'm sorry, i just cant paste the source here, but in prinziple its a 
class with stream ops for the basic data types defined (virtual).

And then some derived classes for streaming to files, the console, the 
gui etc.

And my objects implement stream operators for my basic stream class.

This thing does not support everything the iostreams do, but enough for 
my app.

Ohh, and, yes, my stream class cant be mixed with anything from iostream 
since they dont know each other.


with kind regards philip

0
philip3816 (19)
6/30/2003 3:09:48 PM
On Mon, 30 Jun 2003 17:09:48 +0200, Philip Lawatsch <philip@waug.at>
wrote:

>tom_usenet wrote:
>> On Sun, 29 Jun 2003 19:38:24 +0200, Philip Lawatsch <philip@waug.at>
>> wrote:
>
>> 
>> What have you got currently? What does your stream class look like? If
>> you haven't derived from streambuf, I'm curious as to how your stream
>> class works. Is it completely independent of the iostreams heirarchy?
>
>Yep, it is
>
>I'm sorry, i just cant paste the source here, but in prinziple its a 
>class with stream ops for the basic data types defined (virtual).
>
>And then some derived classes for streaming to files, the console, the 
>gui etc.
>
>And my objects implement stream operators for my basic stream class.

How do you manage to have cout calls in the code then? If your classes
don't implement operator<< for ostream, then cout calls won't work. Or
perhaps the cout calls only use the built in types?

>
>This thing does not support everything the iostreams do, but enough for 
>my app.
>
>Ohh, and, yes, my stream class cant be mixed with anything from iostream 
>since they dont know each other.

Well, I won't chastise you for reinventing the wheel (and making it a
bit less round than current wheel designs), but instead tell you that
you can't redirect std::cout to anything but another streambuf. Where
exactly do you want to redirect it to? You obviously can't direct it
to your stream class, but you can get it to write to the same thing
that your stream class is writing to, but creating a streambuf class
that outputs to that (note this can be unbuffered if you choose -
streambuf is a slightly misleading name).

You can supress cout output with a call to:

std::streambuf* oldcout = std::cout.rdbuf(0);


//reset before exit:
std::cout.rdbuf(oldcout);

Still, from what you're saying, search and replace is by far the best
option.

Tom
0
tom_usenet3 (1118)
6/30/2003 3:58:03 PM
tom_usenet wrote:

>>Yep, it is
>>
>>I'm sorry, i just cant paste the source here, but in prinziple its a 
>>class with stream ops for the basic data types defined (virtual).
>>
>>And then some derived classes for streaming to files, the console, the 
>>gui etc.
>>
>>And my objects implement stream operators for my basic stream class.
> 
> 
> How do you manage to have cout calls in the code then? If your classes
> don't implement operator<< for ostream, then cout calls won't work. Or
> perhaps the cout calls only use the built in types?
> 

Well, this is exactly the point.
There should not be any calls to cout directly, but a lot of developers 
just give a damn about design rules, and exchanging them is not an option.
So something has to be done to get rid of the problem.

If I just search and replace this won't keep any of them from adding new 
couts and thus this would be a never ending stuff

>>This thing does not support everything the iostreams do, but enough for 
>>my app.
>>
>>Ohh, and, yes, my stream class cant be mixed with anything from iostream 
>>since they dont know each other.
> 
> 
> Well, I won't chastise you for reinventing the wheel (and making it a
> bit less round than current wheel designs), but instead tell you that
> you can't redirect std::cout to anything but another streambuf. 

But I can (and am working on that currently) write a dummy stream class 
derived from streambuf as a wrapper.
Not nice, and i just cross my fingers that this will be portable (I do 
have bad experiences about such stuff, this is why we wrote as much 
ourselves as possible in the first place)

> Where
> exactly do you want to redirect it to? You obviously can't direct it
> to your stream class, but you can get it to write to the same thing
> that your stream class is writing to, but creating a streambuf class
> that outputs to that (note this can be unbuffered if you choose -
> streambuf is a slightly misleading name).
> 
> You can supress cout output with a call to:
> 
> std::streambuf* oldcout = std::cout.rdbuf(0);
> 
> 
> //reset before exit:
> std::cout.rdbuf(oldcout);

Well, what i'll do is write a wrapper using a class derived from 
streambuf and then distribute it to appropriate calls in our framework

Its not nice what I'm doing, and I am aware that such a situation should 
never happen if just everyone would follow design guidelines, but if 
you've ever worked in mid size projects you might know that you can't 
just make everyone do what you want him to do.


with kind regards Philip

0
philip3816 (19)
6/30/2003 5:15:42 PM
tom_usenet wrote:


> Assuming you don't want buffering (which might interfere with other
> usages of your stream class), you just need to override overflow:
> 
> class MyStreambuf: public std::streambuf
> {
> 	MyStream& m_stream;
> public:
> 	MyStreambuf(MyStream& s)
> 		:m_stream(s)
> 	{
> 	}
> 
> protected:
> 	int overflow(int c)
> 	{
> 		if (c != EOF)
> 		{
> 			char cc = traits_type::to_char_type(c);
> 			m_stream.put(c); //or whatever puts a char
> 		}
> 		return traits_type::not_eof(c);
> 	}
> 
> 	//optional
> 	int sync()
> 	{
> 		m_stream.flush();
> 		return 0;
> 	}
> };
> 
> And that's it. Inefficient (I virtual function call per character
> output), but that probably doesn't matter to you.

This is in principle what I'm doing right now :)

Thanks for all the ideas

with kind regards Philip

0
philip3816 (19)
7/1/2003 4:28:21 PM
Reply:

Similar Artilces:

where exactly c++,c fail and Ada gets thru'
we are developing safety critical software.my seniors say that c and c++ are not suitable for safety critical software development and ada is very much safe.NASA aslo uses Ada.at what point c++ or c turns to be not suitable for devleloping flight software. i may be wrong also. can any one give some more justifications for telling "ADA is safe" thanks in advance Ananth the Boss wrote: > we are developing safety critical software.my seniors say that c and > c++ are not suitable for safety critical software development and ada > is very much safe.NASA aslo uses Ada.at what point c++ or c turns to be > not suitable for devleloping flight software. i may be wrong also. can > any one give some more justifications for telling "ADA is safe" thanks > in advance The Coding Standards for the Joint Strike Fighter http://public.research.att.com/~bs/JSF-AV-rules.pdf give you an idea of the kinds of safety problems recognized in both C and C++. For example, the standard prohibits the use of C-style arrays as function parameters. The problem cited is the degeneration of an array function argument into a pointer. The pointer provides no information about the size of the array it points to. This problem commonly leads to overflowing arrays. Accessing elements beyond the end of an array is always problematic. The C standard explicitly allows one to access one element beyond the end of an array to support common practice in thousands of C programs. The C...

couting cout.
I've noticed that when you cout cout (or cin) it gives you a series of bytes. Does anyone know what these bytes mean? (cut and paste for those who want a look) #include <iostream> using namespace std; int main() {cout << cout << endl; cout << cin << endl; return 0;} -==Kensu==- I was trying to build a "typerwriter" program, okay? Chris Schumacher wrote: > I've noticed that when you cout cout (or cin) it gives you a series of > bytes. > Does anyone know what these bytes mean? Streams have an implicit conversion to void *. It returns a null pointer if fail () is true and a non-null pointer otherwise. The non-null pointer's value is not specified, AFAIK. On my system it seems to be the address of some subobject or data member of the stream. -- Regards, Buster. ...

how to get rid of this
I have installed SyGate about 4-5 weeks ago. I have Comcast service at the time of Sygate installation and I still have the same Internet service. I used to have DSL. I have treid to remove and deleted anyhting that has to do with DSL before SyGAte installation. Someone helped me remove bad entries from running hiJjackThis during Sygate installation. About 3 weeks ago, a comcast tech came by and replaced a new modem and configuartion. A few days ago I experience a window popped up with title "Enetr Network Password" with the folling info: Server: smtp:sbcglobal.yahoo.com User name: ****@sbcglobal.net Password: I can't closed this window not cancel. What do I need to do? I believe all my posrts inclduing smtp is blocked properly. Thanks. heyimjustcurious@yahoo.com (curious) wrote in news:ca3e516b.0402221022.622d9b61@posting.google.com: > I have installed SyGate about 4-5 weeks ago. > > I have Comcast service at the time of Sygate installation and I still > have the same Internet service. > > I used to have DSL. > > I have treid to remove and deleted anyhting that has to do with DSL > before SyGAte installation. Someone helped me remove bad entries from > running hiJjackThis during Sygate installation. > > About 3 weeks ago, a comcast tech came by and replaced a new modem and > configuartion. > > A few days ago I experience a window popped up with title "Enetr > Network Password" with ...

How to get ethernet information in C/C++ using API/Subroutines
Hi, I want find out information about ethernet cards on AIX box, and want API which I can fire and get information such as Netmask, State, Gateway, MAC Addr etc. Anand use the ioctl interface http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.doc/libs/commtrf2/ioctl_socket_control_operations.htm ...

More about C and C++
Hello, I have wrote: >I will resume it like this: >On the criterias of "complexity" and "difficulty", the C and C++ >programming languages are more complex and difficult than Object >Pascal for example, so since they are more complex and difficult they >are likely to create something like a darwinian filter who don't let >the weaker humans among us humans to cross or to climb the social >ladder, this is why i think that C and C++ do participate to social >darwinism, this is why i say that C and C++ are bad. Joseph Mitzen repsonded: >Something may be more complex or more difficult to learn but it may >bring more capabilities. For instance, a helicopter is both >mechanically more complex and more difficult to learn to fly than an >airplane. However, helicopters possess vertical takeoff and landing >which allow it to reach places planes can not and also gives it >special abilities, such as hovering. >Two important measurements then are the value (what one gains for the >complexity) and what one needs to do (is language X enough for the >task, will feature Y be used, etc.). >Otherwise, one could simply say "Delphi is more complex and difficult >than Ruby or Python, therefore Delphi is bad." It's not only >simplistic, it's also meaningless (bad at what?). I understand your example of hellicopter, you are s...

can't get idebug to show C/C++ code on multi-threaded app
I have a multi-threaded app written in C and C++ running on AIX.. I compiled everthing with -g. I start it running then I attach to it with idebug, set a break point and click "go". It stops at the break point but I can't see the C/C++ code. I only get assemble code displayed. I have no problems with non threaded processes with idebug. Any ideas on what I might be doing wrong? thanks Duane ...

Getting rid of warnings
Hello all, I usually try to get my code clean enough so that no warnings remain at compile time. So I'm annoyed by the 2 following warnings which I can't get rid of. Suggestions (in the form of code rewrite or #pragma) are welcome. Exemple 1: #define MAX_TRACES 100 int NbTraces=0; // Set somewhere else in the program void F(void) { int i, Idx[MAX_TRACES]; for (j=0; j<MAX_TRACES; j++) Idx[j]=0; // Doesn't change anything for (j=0; j<MAX_TRACES; j++) GetSomething(&Idx[j]); for (j=0; j<NbTraces; j++) i = Idx[j]; } The last line gives me: Warning: Local 'Idx' might not have been fully initialized. Obviously NbTraces<MAX_TRACES and anyway I fill up the Idx array with 0, so what is it complaining about ? Example 2: #define ADD(Frmt) { \ if (NULL==strchr(Frmt, '%')) sprintf(DimName, "%s/" Frmt, Server.Name);\ else sprintf(DimName, "%s/" Frmt, Server.Name, Port); ADD("Something"); ADD("SomePort%d"); The first add gives me: DimPpcServer.c:1126: warning: too many arguments for format And the 2nd one: DimPpcServer.c:1130: warning: too few arguments for format I understand the reason (the expansion of "%s/Something" on the 2nd line of the macro has an extra argument). Thanks -- Guillaume Dargaud http://www.gdargaud.net/ On 2012-03-05, Guillaume Dargaud <use_the_contact_form@www.gdargaud.net> wrote: > Hello all, > I usually try to get my code c...

How to get rid of cookies
Hi all, I am trying to get rid of an individual cookie. The OS is Windows ME. Seems like a cookie is slowing my computer to a crawl. When I go to Windows folder and open cookies I see just one file with extension .dat When I click on it, I get a message that another program uses it and therefore it is not accessible. So I changed the folder name from "Cookies" to "Junk", and the computer went back to normal speed. It seems that this is not the best solution though. Can anybody help me? Also, is there a way to search a group? I suspect that someone has already asked identical question. .. Les exlibris <exlibris@lafn.org> wrote in message news:<40AC414F.9000603@lafn.org>... > Hi all, > I am trying to get rid of an individual cookie. The OS is Windows ME. > Seems like a cookie is slowing my computer to a crawl. When I go to > Windows folder and open cookies I see just one file with extension .dat > When I click on it, I get a message that another program uses it and > therefore it is not accessible. So I changed the folder name from > "Cookies" to "Junk", and the computer went back to normal speed. It > seems that this is not the best solution though. Can anybody help me? Well, cookies are a big pain, but some of them you may want to keep if they are from websites where you have a password and log on frequently. It remembers your logon info so you don't have to type it in every time. The...

how do i get to the system in C++?
Hi! I want to run an external Program in my C++ Program. I have a string of an existing program which has to be executed. Which command do i have to execute and in which library is it to find? For anybody's help, Thank you. Tamer > I want to run an external Program in my C++ Program. I have a string of > an existing program which has to be executed. Which command do i have to > execute and in which library is it to find? The std::system() function in <cstdlib>seems to be what you are looking for. -- Peter van Merkerk peter.van.merkerk(at)dse.nl Dear Peter, How do i run correctly the function?! "Fullsting" is a variable of string. FullString.assign(StringToConvert[0]); FullString.append(StringToConvert[1]); FullString.append(StringToConvert[2]); system(FullString); and output: g++ CapiSuitePrint.C CapiSuitePrint.C: In member function `void CapiPrint::convert()': CapiSuitePrint.C:49: error: cannot convert `std::string' to `const char*' for argument `1' to `int system(const char*)' tamer@linux:~/Desktop/CapiSuitePrint> Tell me please, how i could avoid this error. Thank you Tamer Peter van Merkerk wrote: >>I want to run an external Program in my C++ Program. I have a string of >>an existing program which has to be executed. Which command do i have to >>execute and in which library is it to find? > > > The std::system() function in <cstdlib>seems to be what you are l...

Getting started with C
After a long period off line, due to a falling-out with demon and a shift to a new ISP and my own domain name, so I am no longer dependent on a single ISP, I am now back and trying to learn C. I have never used C before, and I don't think there are any obselete versions on my system. I have done what I think I ought to have done and followed the RISC OS GCC Tutorial, downloaded the program, and I have on my harddrive the directory C :- containing :- !gcc, icon with GNU on it, containing :- !help !Run !Sprites !Sprites22 bin Changes docs examples include lib Old!Run startup !System, containing :- 310 -> Modules -> SharedUlib (The icon is marked "RM", I may have downloaded this with Fresco, which has a tendency to corrupt file types) tutorial/html, whose instructions I am following. I dragged Tasks -> Next slot up to over 5Mb, I went ctrl-F12, typed in gcc ~v , entered and the following exchange took place :- *gcc ~v Error: Cannot read file '~void' Drlink: Link failed with 1 error ld fatal error: program /gccpkg:bin/drlink returned exit status 3072: * The exasperating thing is that it did work once before, but I can't remember what I have changed! Once I have got it to work, I shall get down to the drolleries of Dan Gookin and his dummie's guide - I hope it doesn't get too wearisome! But it has to work first, and I would be greatful ...

How to get rid of spyware?
Can anyone suggest a good free program to remove spyware from a PC using Windows 98? I found Ad-Aware at: http://www.docsdownloads.com/spyware.htm Would that be about as good as anything else? On Sat, 31 Jul 2004 17:29:18 GMT, dh_ld@nomail.com while sniffing the trees left this message >Can anyone suggest a good free program to remove spyware from >a PC using Windows 98? > >I found Ad-Aware at: http://www.docsdownloads.com/spyware.htm >Would that be about as good as anything else? Sorry I don't do cross posts. Wolfman Even a man who is pure at heart And says his prayers by night May become a wolf when the wolfsbane blooms And the autumn moon is bright When you are running with the pack, you had better watch where you step! On Sat, 31 Jul 2004 17:29:18 GMT, dh_ld@nomail.com wrote: >Can anyone suggest a good free program to remove spyware from >a PC using Windows 98? > >I found Ad-Aware at: http://www.docsdownloads.com/spyware.htm >Would that be about as good as anything else? That and Spybot wolfman wrote: > > On Sat, 31 Jul 2004 17:29:18 GMT, dh_ld@nomail.com while sniffing the > trees left this message > > >Can anyone suggest a good free program to remove spyware from > >a PC using Windows 98? > > > >I found Ad-Aware at: http://www.docsdownloads.com/spyware.htm > >Would that be about as good as anything else? > > Sorry I don't do cross posts. You j...

Get rid of the title
I have a syntax which, when run, generates a IGRAPH for every subject I have (actually two graphs per subject). In the output file each IGRAPH gets a separate title which simply states "Interactive Graph". As having this title a few dozen times is redundant, I wondered whether I can put a command in my syntax to prevent SPSS from generating this title ... or, if this is not possible, maybe I could change it to something more sensible, again automated within the syntax? Thanks in advance! Cheers, Matthias If you want to get rid of this in the right hand side of the Viewer (rather than in the outline pane), you can suppress it with OMS. Here is an example. OMS select headings/if command='igraph'/destination viewer=no. <your igraph commands> OMSEND. "Interactive graph" will still appear in the outline, because it is the root for the Igraph output, but you won't see it in the main output. To get rid of it also in the outline would require an autoscript to promote the items below it and then delete it. HTH Jon Peck SPSS ...

Getting rid of duplicates
I have a table, TEST_TABLE, with 6 columns (COL1, COL2, COL3, COL4, COL5, COL6).... I need to be able to select all columns/rows where COL3, COL4, and COL5 are unique.... I have tried using DISTINCT and GROUP BY, but both will only allow me to access columns COL3, COL4, and COL5..... i need access to all columns...I just want to get rid of duplicate rows (duplicates of COL3, COL4, and COL5)... Thanks in advance. Joe If a row is duplicated on (col3, col4, col5) which values do you want for col1 and col2? Here's some example data: CREATE TABLE Sometable (col1 INTEGER NOT NULL, col2 INTEGER NOT NULL, col3 INTEGER NOT NULL, col4 INTEGER NOT NULL, col5 INTEGER NOT NULL /* PRIMARY KEY ??? */) INSERT INTO Sometable VALUES (1,2,3,4,5) INSERT INTO Sometable VALUES (2,1,3,4,5) If you don't care which values go into col1 and col2: SELECT MIN(col1) AS col1, MIN(col2) AS col2, col3, col4, col5 FROM Sometable GROUP BY col3, col4, col5 If you want just one row from the table for each value of (col3, col4, col5): SELECT MIN(S1.col1) AS col1, S1.col2, S1.col3, S1.col4, S1.col5 FROM Sometable AS S1 JOIN (SELECT MIN(col2) AS col2, col3, col4, col5 FROM Sometable GROUP BY col3, col4, col5) AS S2 ON S1.col2 = S2.col2 AND S1.col3 = S2.col3 AND S1.col4 = S2.col4 AND S1.col5 = S2.col5 GROUP BY S1.col2, S1.col3, S1.col4, S1.col5 Try out one of these two queries. If you need more help, please post DDL and sample data (CREATE and INSERT statements as above...

How to get rid of warnings?
I have the maximum number of warnings during PHP development. How can I get rid of these warnings without turning them off in PHP? Here's the code I have: <form method="POST" action="eat.php"> <select name="lunch[ ]" multiple> <option value="pork">BBQ Pork Bun</option> <option value="chicken">Chicken Bun</option> <option value="lotus">Lotus Seed Bun</option> <option value="bean">Bean Paste Bun</option> <option value="nest">Bird-Nest Bun</option> </select> <input type="submit" name="submit"> </form> Selected buns: <br/> <?php foreach ($_POST['lunch'] as $choice) { print "You want a $choice bun. <br/>"; } ?> And I get: Warning: Invalid argument supplied for foreach() in C:\lighttpd\htdocs\index.php on line 17 Is there a way to give the 'lunch' variable a default value if undefined? Thank you. Lenard Redwood wrote: > I have the maximum number of warnings during PHP development. How can I > get rid of these warnings without turning them off in PHP? > > Here's the code I have: > > <form method="POST" action="eat.php"> > <select name="lunch[ ]" multiple> > <option value="pork">BBQ Pork Bun</option> > <option value="chicken">...

Getting too smart with C
Please enjoy :-) http://embeddedgurus.com/stack-overflow/2010/08/setting-a-bad-example-part-1/ ...

getting uptime from c
Im running 5.2 and soon going to 5.3 and using gcc from the AIX Linux site. I'm trying to get system uptime in seconds and wonder if anyone has an example I can use, and works in 64 bit mode. thanks aixhack wrote: > I'm trying to get system uptime in seconds and wonder if anyone has an > example I can use, and works in 64 bit mode. Get the boot time from the utmp file and subtract from the current time. ...

get rid of warning
After I download some software from a place like macupdate, I install it and then I try it out. But first I get a warning: "such and such app" was downloaded from the internet are you sure you want to open it? Yes, I *know* I downloaded it from the internet. I chose to. And yes, I *do* want to open it � that's why I double clicked it! Is there a place where I can choose to not have those warnings? (iMac, 2.66GHz, 4GB RAM, 10.5.7) -- Michael Fogler http://MichaelFogler.com In article <guitarist-6DC91C.08070308072009@netnews.insightbb.com>, Michael Fogler <guitarist@michaelfogler.com> wrote: > "such and such app" was downloaded from the internet are you sure you > want to open it? > > Yes, I *know* I downloaded it from the internet. I chose to. And > yes, I *do* want to open it � that's why I double clicked it! And some day, something will be downloaded without your knowledge or intent, and that something will be or contain malware. -- Member National Rifle Association Member American Civil Liberties Union Member Human Rights Campaign On 2009-07-08, Michael Fogler <guitarist@michaelfogler.com> wrote: > After I download some software from a place like macupdate, I install > it and then I try it out. But first I get a warning: > > "such and such app" was downloaded from the internet are you sure you > want to open it? > > Yes, I *know* I downloaded it from the i...

Getting rid of powerlines
Any tips on getting rid of power lines in a photo? I have tried the cloning tool, healing brush etc but still some obvious markings left in photo - have experimented with different settings to no avail? Many thanks Cheers Ron "Ron" <ronjs@tpg.com.au> wrote in message news:449eec3b$1@dnews.tpgi.com.au... > Any tips on getting rid of power lines in a photo? I have tried the > cloning tool, healing brush etc but still some obvious markings left in > photo - have experimented with different settings to no avail? > > Many thanks > > Cheers > > Ron Having done this a few times and never had any problems with the cloning tool, might be worth puting in a link to the picture to see what the problem is. > > "Ron" <ronjs@tpg.com.au> wrote in message news:449eec3b$1@dnews.tpgi.com.au... > Any tips on getting rid of power lines in a photo? I have tried the > cloning tool, healing brush etc but still some obvious markings left in > photo - have experimented with different settings to no avail? > > Many thanks > > Cheers > > Ron Hi. It is not at all difficult, I have got rid of the supporting poles. Zoom up the image to a large size, and keep the brush size small. I find it looks better if you do not use a "Soft" Brush as they nearly always seem to create areas which look out of focus. You just need to make sure that you reset the "Pick Up" points fai...

C++ BOOKS The C Book / C++ Annotations/ Thinking in C++/ How to Think Like a Computer Scientist C++ Version
-The C Book=20 by Mike Banahan, Declan Brady and Mark Doran is an introduction to C for ex= perienced programmers. The print edition, first published in 1991, is no lo= nger in print.=20 DOWNLOAD http://hitfile.net/JcVZ -C++ Annotations is a free e-book by Frank B. Brokken of the University of Groningen. He use= s it as the primary text of his course on C++, and it's written for program= mers already familiar with C DOWNLOAD http://hitfile.net/CEGU -How to Think Like a Computer Scientist C++ Version is the C++ "port" of Allen B. Downey's classic introduction to programming.= The Python version has been used by MIT for its introduction to programmin= g. It assumes no prior programming experience. There are also versions in Python and Java, and a Ruby version is in progre= ss DOWNLOAD http://hitfile.net/Q67V -Thinking in C++ by Bruce Eckel aims to "move you, a little at a time, from understanding C = to the point where the C++ mindset becomes your native tongue." It's writte= n with the expectation that the learner have existing knowledge of C syntax= .. It begins by introducing object oriented programming and moves into cover= ing more advanced C++ over the course of two volumes DOWNLOAD http://hitfile.net/Q7tz ...

C++ BOOKS The C Book / C++ Annotations/ Thinking in C++/ How to Think Like a Computer Scientist C++ Version
-The C Book=20 by Mike Banahan, Declan Brady and Mark Doran is an introduction to C for ex= perienced programmers. The print edition, first published in 1991, is no lo= nger in print.=20 DOWNLOAD http://hitfile.net/JcVZ -C++ Annotations is a free e-book by Frank B. Brokken of the University of Groningen. He use= s it as the primary text of his course on C++, and it's written for program= mers already familiar with C DOWNLOAD http://hitfile.net/CEGU -How to Think Like a Computer Scientist C++ Version is the C++ "port" of Allen B. Downey's classic introduction to programming.= The Python version has been used by MIT for its introduction to programmin= g. It assumes no prior programming experience. There are also versions in Python and Java, and a Ruby version is in progre= ss DOWNLOAD http://hitfile.net/Q67V -Thinking in C++ by Bruce Eckel aims to "move you, a little at a time, from understanding C = to the point where the C++ mindset becomes your native tongue." It's writte= n with the expectation that the learner have existing knowledge of C syntax= .. It begins by introducing object oriented programming and moves into cover= ing more advanced C++ over the course of two volumes DOWNLOAD http://hitfile.net/Q7tz ...

C++ has overloaded operators? I laughed.
While packing for a move to another domicile, I found some oldies. I came across a finite element model generation system developed about 1980. This project really hurt my brain, but PL/I helped enormously. The high poohbahs at Alcan were trying to model the flow of heat and electricity through Hall-Heroult cells, aka 'pots'. So their initial efforts were writing ever more convoluted IBM FORTRAN programs to create models consisting of 20 noded bricks with 16 noded 'faces' for brick interfaces. Of course, the complexity escalated to the point where they chewed through several hours of IBM CPU time at $1,200 / hour and realised the generated model was Garbage-In. Who do you call? B-) To beat the process into simplicity, models had to be built up from pieces, not starting from the bricks (with all of that material baggage) and descending to the nodes (points). So why not start from lists of nodes and build them up into bricks? The concept of Cartesian product helps here. While writing a model generation program, one wishes to assign a symbolic name to objects, (i.e. points, boundary conditions, bricks, sub- models). However, the use of POINTERs to address objects is also essential. The pieces of a model are stored in an AREA variable with a general construction of <name> <type> <values>, all linked so that a call of: THIS_LINE = LOOKUP ( 'X_LINE' ) returns a POINTER to the desired object when found. One can infer: DECL...

getting rid of stack sequence
hello, i am trying to clean up my code because i have too many local variables.i need to make it more easier to read. can someone suggest some ways to get rid of the current stack sequence?i have some pictures. thank you for your time.<img src="http://forums.ni.com/attachments/ni/170/338714/2/untitled5.PNG"> <img src="http://forums.ni.com/attachments/ni/170/338714/3/untitled11.PNG"> <img src="http://forums.ni.com/attachments/ni/170/338714/1/untitled21.PNG"> <img src="http://forums.ni.com/attachments/ni/170/338714/4/untitled31.PNG"> here is what's in the subvi<img src="http://forums.ni.com/attachments/ni/170/338714/5/untitled41.PNG"> Message Edited by krispiekream on 07-08-2008 01:22 PM untitled21.PNG: http://forums.ni.com/attachments/ni/170/338714/1/untitled21.PNG untitled5.PNG: http://forums.ni.com/attachments/ni/170/338714/2/untitled5.PNG untitled11.PNG: http://forums.ni.com/attachments/ni/170/338714/3/untitled11.PNG untitled31.PNG: http://forums.ni.com/attachments/ni/170/338714/4/untitled31.PNG untitled41.PNG: http://forums.ni.com/attachments/ni/170/338714/5/untitled41.PNG You don't fax a picture of you to your doctor and expect him to diagnose you. So why attach a picture of your code and expect us to troubleshoot? :D &nbsp; If you want help, attach some real code! &nbsp; Things we cannot tell! - In frame 1, what happens in the TRUE case? - Why do you need to read...

how to get rid of default window
When running on wish/tclsh, the following line "package require Tk" pops up a window which just does not go away, whatsoever widgets I create or whatsoever widgets I destroy. It goes away only when the application quits. Can you suggest how to get rid of this window? On Mar 22, 8:37 am, John Connor <john.crap.con...@gmail.com> wrote: > When running on wish/tclsh, the following line "package require Tk" > pops up a window which just does not go away, whatsoever widgets I > create or whatsoever widgets I destroy. > It goes away only when the application quits. > > Can you suggest how to get rid of this window? wm withdraw . Or, just put all your application widgets in this window instead of creating a separate toplevel. Wow... thanks a lot Bryan for this tip! ...

Getting rid of spaces in fields
Hi, I have a database of about 10,000 individuals. One column is devoted to a person's surname (LastName) and another column to their first name and inititals (FirstName). One problem I have is that the spacing is all screwed up in the FirstName column. For example, instead of reading John_HS (where _ is a space), it will read John__H_S__ or John__H__S_. Any ideas on how to get rid of this superfluous spacing? Thanks, Stavrogin. Stavrogin, I don't think this is the perfect solution but you can remove all spaces from your text except for single spaces betwee words using Excel You have to export your table to an Excel file then use the "Trim" function on the FirstName column then import it agin in your Access file Stavrogin, I don't think this is the perfect solution but you can remove all spaces from your text except for single spaces betwee words using Excel You have to export your table to an Excel file then use the "Trim" function on the FirstName column then import it agin in your Access file Fatiam "Stavrogin" <silentio@dccnet.com> wrote in news:1130363105.391667.287620@f14g2000cwb.googlegroups.com: > Hi, > > I have a database of about 10,000 individuals. One column is > devoted to a person's surname (LastName) and another column to > their first name and inititals (FirstName). > > One problem I have is that the spacing is all screwed up in > the FirstName column. For example...

Web resources about - Overloading / Getting rid of cout - comp.lang.c++

Operator overloading - Wikipedia, the free encyclopedia
In programming, operator overloading —less commonly known as operator ad hoc polymorphism —is a specific case of polymorphism , where different ...

Overloading loyal supporters a reflection of insecurity
JULIA Gillard has missed the opportunity to take advantage of Labor's latest crisis.

China mulls criminalizing speeding, overloading
China mulls criminalizing speeding, overloading China Daily Partners : - qstheory.cn - PeopleDaily - Xinhua.net - China.org.cn - cntv.com - ...

Chief of S.Korean sunken ferry operator arrested for overloading
Chief of S.Korean sunken ferry operator arrested for overloading People's Daily Online After acquiring the vessel, the Chonghaejin Marine had ...

Overloading, Unauthorized Route Likely Cause Fatal Kindergarten Bus Accident
Overloading, Unauthorized Route Likely Cause Fatal Kindergarten Bus Accident

“Twitch Plays Pokémon” is so big, it’s overloading Twitch’s servers
Even a dedicated server wasn't enough to contain the madness.

Larwyn's Linx: Obama Intentionally Overloading Immigration System, Creating Back Door for Jihadists
Send us tips ! Bloggers: install a Larwyn's Linx widget . Get real-time news, 24/7, at BadBlue . Nation Overloaded Immigration System Creating ...

Domestic Violence Overloading Courts
Nearly 22,000 battered women filed criminal charges against their abusers in Chicago last year, inundating the city`s two Domestic Violence Court ...

Reid overloading Chiefs before mandatory minicamp
KANSAS CITY, Mo. - Andy Reid is willing to admit he is overloading the Kansas City Chiefs with as much information as he possibly can ahead of ...

A Language-Design Puzzle in Operator Overloading
Resolving an overloaded function call involves finding a single possibility that is strictly better than all the others.

Resources last updated: 3/30/2016 11:49:14 AM