Monday, March 23, 2015

Digest for comp.lang.c++@googlegroups.com - 23 updates in 8 topics

Pavel <pauldontspamtolk@removeyourself.dontspam.yahoo>: Mar 22 11:34PM -0400

Bo Persson wrote:
> is killed and the other one has to move to a place called Nod. There he
> gets himself a wife (what?!) and has a son, who has another son, etc.
 
> I have always wondered where all the wives came from. Science?
From Adam and his first wife, Lilith.
Martijn Lievaart <m@rtij.nl.invlalid>: Mar 23 11:02AM +0100

On Sun, 22 Mar 2015 10:22:38 -0700, Öö Tiib wrote:
 
 
> We need to understand nuances of our ever-changing work and doing
> anything blindly is extremely bad advice. It leads to disasters and
> rarely to useful results.
 
Amen! :-)
 
M4
Juha Nieminen <nospam@thanks.invalid>: Mar 23 10:23AM

> Yeshua (aka Jesus) is the only one I know who can play that role.
> A company made up of followers of Yeshua will be able to provide
> the servant leadership that's needed for C++ going forward.
 
What exactly do you think you are doing?
 
I think that even your god, if he existed, would consider you insane.
 
--- news://freenews.netfront.net/ - complaints: news@netfront.net ---
Glen Stark <mail@glenstark.net>: Mar 23 09:21PM

On Mon, 23 Mar 2015 10:23:59 +0000, Juha Nieminen wrote:
 
 
> What exactly do you think you are doing?
 
> I think that even your god, if he existed, would consider you insane.
 
> --- news://freenews.netfront.net/ - complaints: news@netfront.net ---
 
I can't imagine that the post was anything but a joke. I mean c,mon, get
a sense of humor. I found it pretty funny.
legalize+jeeves@mail.xmission.com (Richard): Mar 23 08:39PM

[Please do not mail me a copy of your followup]
 
ram@zedat.fu-berlin.de (Stefan Ram) spake the secret code
 
>jononanon@googlemail.com writes:
>>print((const char* const []){word1, word2, word3});
 
> Compound literals are not part of C++ IIRC.
 
It's a C++11 initializer list.
--
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
The Computer Graphics Museum <http://computergraphicsmuseum.org>
The Terminals Wiki <http://terminals.classiccmp.org>
Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com>
Doug Mika <dougmmika@gmail.com>: Mar 23 12:24PM -0700

Hi to all
 
I'm reviewing my C++ notes, and I noticed that I can't open a file for I/O from a string variable. For example
 
string fname;
ofstream out;
 
cout<<"Enter the output file name:";
cin>>fname;
out.open(fname);
 
Why not, how do I get around it?
 
Thanks
Doug Mika <dougmmika@gmail.com>: Mar 23 12:30PM -0700

I found it, you have to use fname.c_str();
 
 
 
On Monday, March 23, 2015 at 1:24:21 PM UTC-6, Doug Mika wrote:
Melzzzzz <mel@zzzzz.com>: Mar 23 08:38PM +0100

On Mon, 23 Mar 2015 12:24:10 -0700 (PDT)
> cin>>fname;
> out.open(fname);
 
> Why not, how do I get around it?
 
String is not included to reduce dependencies , you call fname.c_str().
 
guinness.tony@gmail.com: Mar 23 06:02AM -0700

On Saturday, 21 March 2015 19:03:53 UTC, محمد رجب wrote:
> case 4: n=n/2; cout<<"BBB\n";
> case 5: n=n%2; cout<<"CCC\n";
> default: cout<<"DDD\n";} }
 
http://www-igm.univ-mlv.fr/~dr/CPP/c++-faq/how-to-post.html#[5.2]
"Lőrinczy Zsigmond" <zsiga@nospam.for.me>: Mar 23 03:35PM +0100

> Yes but your answer was against rules of the game too.
 
Strictly speaking, it is still no *proved*
that it was a homework question;
plus, funny false answers were already provided by other posters.
"Öö Tiib" <ootiib@hot.ee>: Mar 23 11:41AM -0700

On Monday, 23 March 2015 16:36:04 UTC+2, Lőrinczy Zsigmond wrote:
 
> Strictly speaking, it is still no *proved*
> that it was a homework question;
> plus, funny false answers were already provided by other posters.
 
Sorry, but the situation, that محمد رجب is Egyptian programmer who
did meet the OP puzzle during his work, is unimaginable for me.
He is clearly studying it. Hard to understand what *proof* for
that you are talking about. Can you try to elaborate the logic?
Bonnedav <bonnedav@gmail.com>: Mar 23 12:53AM -0700

On Sunday, March 22, 2015 at 10:33:08 AM UTC-6, Christian Gollwitzer wrote:
> set. If so, invoke that tool. If nothing is set, invoke vi. If that does
> not work, write an error.
 
> Christian
 
How do i do it on windows?
Bonnedav <bonnedav@gmail.com>: Mar 23 12:56AM -0700

On Sunday, March 22, 2015 at 8:51:34 AM UTC-6, Bonnedav wrote:
> How do I make a console text editor in C++?
 
This is a windows project.
Robert Wessel <robertwessel2@yahoo.com>: Mar 23 03:20AM -0500

On Mon, 23 Mar 2015 00:53:12 -0700 (PDT), Bonnedav
>> not work, write an error.
 
>> Christian
 
>How do i do it on windows?
 
 
Invoke notepad?
Bonnedav <bonnedav@gmail.com>: Mar 23 01:39AM -0700

On Sunday, March 22, 2015 at 8:51:34 AM UTC-6, Bonnedav wrote:
> How do I make a console text editor in C++?
 
in console no gui programs.
Christian Gollwitzer <auriocus@gmx.de>: Mar 23 10:12AM +0100

Am 23.03.15 um 08:53 schrieb Bonnedav:
>> set. If so, invoke that tool. If nothing is set, invoke vi. If that does
>> not work, write an error.
 
> How do i do it on windows?
 
Do you insist, that the editor itself also does not open a GUI window?
32 bit Windows comes with a console editor, which you get by invoking
"edit". Just try it on the command line first to see it. However, 64 bit
versions of Windows do not ship this tool, as Windows generally expects
for user interaction that you show a GUI window. You have several
options, you can run the application linked to .txt files. This is done,
for instance, by "start something.txt", usually you invoke "cmd /c start
something.txt". Or you can run Notepad, which is guaranteed to exist,
but is a very basic and limited editor. The problem is to decide when
the user has closed the application. start runs the app in the
background. If you exec Notepad directly, you probably can wait until it
terminates.
 
Christian
red floyd <no.spam@its.invalid>: Mar 23 09:55AM -0700

On 3/23/2015 12:56 AM, Bonnedav wrote:
> On Sunday, March 22, 2015 at 8:51:34 AM UTC-6, Bonnedav wrote:
>> How do I make a console text editor in C++?
 
> This is a windows project.
 
In which case, you're in the wrong newsgroup. Please see
FAQ 5.9, and/or look for a newsgroup with "windows" in its name.
 
Your problem is language independent, and therefore does not belong
here.
 
Please consider the following:
 
"Does my question make sense if I replace C++ with some other language?"
If so, you are in the wrong newsgroup, and you probably need to go to
a programming newsgroup rather than this language group.
 
"Does my question make sense if I replace 'Windows' with some other OS?"
If it doesn't, you have a Windows specific question,a nd again, you need
to go to a Windows group rather than this language group.
Paavo Helde <myfirstname@osa.pri.ee>: Mar 23 01:17PM -0500

Bonnedav <bonnedav@gmail.com> wrote in
 
> On Sunday, March 22, 2015 at 8:51:34 AM UTC-6, Bonnedav wrote:
>> How do I make a console text editor in C++?
 
> in console no gui programs.
 
In Windows the underlying functionality for console access is provided
by Windows SDK console functions:
"https://msdn.microsoft.com/en-us/library/windows/desktop/ms682010%
28v=vs.85%29.aspx"
 
See especially "Console Reference" - "Console functions". This section
documents the functions which need to be ultimately called either directly
by the text editor program or by some suitable library or framework it
uses.
 
How exactly to use them is off-topic for this group as this has nothing to
with C++ and everything to do with the Windows SDK.
 
hth
Paavo
Martijn Lievaart <m@rtij.nl.invlalid>: Mar 23 08:45AM +0100

On Sun, 22 Mar 2015 11:06:17 +0100, David Brown wrote:
 
> never perfect, but in most European countries you get solid public
> health care without having to have private health insurance - it is all
> covered by your standard taxes.
 
Well, not in the Netherlands, and I think actually not that many other
countries.
 
What we have is a mandated basic health insurance. This basic health
insurance provides the same basis at every insurance company. You can
choose the insurance company, you can choose extra health insurance
programs, you can choose your but you cannot choose not to be insured.
 
Sounds to me just like Obamacare, but I don't know enough about Obamacare
to say if they are actually alike.
 
By the way, there is a very good reason why it is set up like this. If
you provide free health care (pay by tax is very indirect), people will
not use it as the precious resource it is. By making them pay every month
(and raising that yearly, or not) people are more aware of the cost and
will (in general) be more conscious.
 
M4
David Brown <david.brown@hesbynett.no>: Mar 23 09:33AM +0100

On 23/03/15 08:45, Martijn Lievaart wrote:
> insurance provides the same basis at every insurance company. You can
> choose the insurance company, you can choose extra health insurance
> programs, you can choose your but you cannot choose not to be insured.
 
The mandated health insurance (which is a common model in Europe) is a
tax by a different name. You pay a certain amount, either a fixed sum
per person or a percentage of your income (or a combination), to a state
body. It is not dependent on your state of health, and does not come
with different options. It's a tax. Most European countries have a
similar thing that covers unemployment benefits, etc. In the UK, it's
called "National Insurance". But since it is handled like a tax, and
collected like a tax, it's easier just to refer to it as a tax.
 
In addition, you can also choose to arrange for a third-party private
health insurance - but that is in addition to the state mandated "tax".
This is a normal private commercial insurance system - companies charge
what the market will pay, they make a profit from it, and the insured
person can use it for private medical care beyond the public health
service (such as to get a nicer room, better food, quicker treatment,
etc.). European countries are capitalist economies - there are people
happy to pay for additional health care, and therefore companies happy
to provide that service.
 
But it is all on top of the full coverage public health system paid for
by taxes (even if the tax is called "health insurance"). And although
no health care system is perfect, European governments strive to give as
good public health care as possible at a reasonable public cost, and
they usually do quite well.
 
> Sounds to me just like Obamacare, but I don't know enough about Obamacare
> to say if they are actually alike.
 
I believe Obama wanted to make such a system, but the forces against it
in the USA are too strong. Too many people there would rather that
/their/ money went to paying for /their/ health care, and not spread
around amongst everyone. The people with power and money, who can
currently afford world-class health care in the USA, fear that that
quality will be reduced if there is a move to public health care. And
there is a vast industry in the USA involving health care insurance and
payments - there are armies of insurance salesmen, accountants, lawyers,
administrators, bankers, who all depend on the flow of health care money
for their jobs. Of course, they are part of the reason why the US
spends more than twice as much per capita on health care than other
developed countries, yet is rated so low in the average quality of the
health care. (There are /many/ reasons for this - the extraordinary
inefficiency of the health insurance system is just one part.) There is
also the idea that public health care is socialist, and therefore
practically communist, and goes against the "American spirit" of working
for your own reward.
 
The inevitable result is that Obamacare /added/ to this system, as yet
another health insurance option, rather than revolutionising it, and I
believe most statistics show that the total health care costs in the USA
have gone up. I don't know whether or not it has led to better average
health care - I think it's too early to tell.
 
> not use it as the precious resource it is. By making them pay every month
> (and raising that yearly, or not) people are more aware of the cost and
> will (in general) be more conscious.
 
There may be psychological reasons for calling the financing "public
health insurance" rather than "tax", but I suspect it is more about
keeping budgets somewhat separate to ensure that the public health
service gets fairly consistent financing despite variations on the main
state finances.
bleachbot <bleachbot@httrack.com>: Mar 23 09:03AM +0100

woodbrian77@gmail.com: Mar 22 07:04PM -0700

On Sunday, March 22, 2015 at 11:48:08 AM UTC-5, Öö Tiib wrote:
> > prepared in the relatively small areas where we /do/ need performance.
 
> Yes, that was what I was writing ... people who quickly see what should
> be done to make an annoyingly slow thing 20 times faster are rare.
 
I haven't heard this "Optimized C++" book mentioned on the
newsgroup yet:
 
http://www.amazon.com/Optimized-C-Kurt-Guntheroth/dp/1491922060/ref=sr_1_12?s=books&ie=UTF8&qid=1427075517&sr=1-12&keywords=c%2B%2B
 
 
 
> that why don't we write a framework that logs and counts what calls
> what and how many times run time. Others said that because profiler
> does it already finely among lot of other useful things. :)
 
Does anyone use hwpcm on FreeBSD. I was trying to use it
recently but couldn't figure it out.
 
pcmstat ls
 
gave me a help page and
 
pcmstat -S instructions -T
 
said something about a library not loading. I may need to
install something.
 
 
Brian
Ebenezer Enterprises - In G-d we trust.
http://webEbenezer.net
seeplus <gizmomaker@bigpond.com>: Mar 22 08:40PM -0700


> I haven't heard this "Optimized C++" book mentioned on the
> newsgroup yet:
 
> http://www.amazon.com/Optimized-C-Kurt-Guntheroth/dp/1491922060/ref=sr_1_12?s=books&ie=UTF8&qid=1427075517&sr=1-12&keywords=c%2B%2B
 
Last I looked he had written the first 3 chapters out of a scheduled
11 chapters, and it has a proposed August release.
 
A bit early to be able comment on it and the Ebook has too high a $ tag to just
purchase on spec.
But sounds like it has good ideas.
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com.

No comments: