Sunday, March 22, 2015

Digest for comp.lang.c++@googlegroups.com - 25 updates in 6 topics

Bonnedav <bonnedav@gmail.com>: Mar 22 07:51AM -0700

How do I make a console text editor in C++?
Barry Schwarz <schwarzb@dqel.com>: Mar 22 08:25AM -0700

On Sun, 22 Mar 2015 07:51:06 -0700 (PDT), Bonnedav
 
>How do I make a console text editor in C++?
 
Create a comprehensive unambiguous set of requirements.
 
Analyze as many different options that could satisfy those
requirements that you can think of.
 
Select the option for each requirement that best seems to suit your
intent.
 
Carefully design the software (data, user interface, program flow,
error handling, etc) that implements each option.
 
Code the software following the design.
 
Test the software.
 
For each problem detected, determine whether it is a coding error, a
design error, the wrong option, an undesirable requirement, etc and go
back to the previous step corresponding to that determination.
 
When you are all done, sit back and bask in the joy of accomplishment.
 
--
Remove del for email
Bonnedav <bonnedav@gmail.com>: Mar 22 08:32AM -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++?
 
Wow ok. I just want to make a simple text editor for my database program.
And by database I mean a folder with a bunch of files in it, each one being an entry.
Christian Gollwitzer <auriocus@gmx.de>: Mar 22 05:32PM +0100

Am 22.03.15 um 16:32 schrieb Bonnedav:
>> How do I make a console text editor in C++?
 
> Wow ok. I just want to make a simple text editor for my database program.
> And by database I mean a folder with a bunch of files in it, each one being an entry.
 
Forget it, it's a seriously complex task. Instead, call an external
program. On Unix, typically the environment variable EDITOR or VISUAL is
set. If so, invoke that tool. If nothing is set, invoke vi. If that does
not work, write an error.
 
 
Christian
Christian Gollwitzer <auriocus@gmx.de>: Mar 22 05:34PM +0100

Am 22.03.15 um 17:32 schrieb Christian Gollwitzer:
> program. On Unix, typically the environment variable EDITOR or VISUAL is
> set. If so, invoke that tool. If nothing is set, invoke vi. If that does
> not work, write an error.
 
PS: PLease reply to the message that you are replying to. Your message
showed up as a reply to your own mesage, not to Barry's answer.
 
Johannes Bauer <dfnsonfsduifb@gmx.de>: Mar 22 06:16PM +0100

On 22.03.2015 17:34, Christian Gollwitzer wrote:
 
> PS: PLease reply to the message that you are replying to. Your message
> showed up as a reply to your own mesage, not to Barry's answer.
 
Oh the irony.
 
Cheers,
JOhannes
 
--
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich!
Ah, der neueste und bis heute genialste Streich unsere großen
Kosmologen: Die Geheim-Vorhersage.
- Karl Kaos über Rüdiger Thomas in dsa <hidbv3$om2$1@speranza.aioe.org>
Paavo Helde <myfirstname@osa.pri.ee>: Mar 22 12:31PM -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++?
 
There are no builtin tools for that in standard C++. Tasks like this are
usually done by GUI frameworks like Qt or wxWidgets. However these are
for real GUI programs so do not meet your "console" requirement.
 
> Wow ok. I just want to make a simple text editor for my database
> program. And by database I mean a folder with a bunch of files in it,
> each one being an entry.
 
These requirements are totally different than "make a console text editor
in C++". I would just suggest launching an external editor for each file
you want to modify.
 
The next option would be to use some framework for console UI
programmings. I recall vaguely these were popular about 20 years ago,
maybe there is something which can be used also now. This would give
provide more control over the behavior than just launching external
editors.
 
Finally, you can code your own console text editor, with or without
helper libraries like ncurses. Beware this is a major project which would
distract you from the database project for several months or years.
 
hth
Paavo
Christian Gollwitzer <auriocus@gmx.de>: Mar 22 06:56PM +0100

Am 22.03.15 um 18:16 schrieb Johannes Bauer:
 
>> PS: PLease reply to the message that you are replying to. Your message
>> showed up as a reply to your own mesage, not to Barry's answer.
 
> Oh the irony.
 
I use to put additions/corrections as an answer of my own post, to make
that clear - do you consider this wrong?
 
Christian
Melzzzzz <mel@zzzzz.com>: Mar 22 07:51PM +0100

On Sun, 22 Mar 2015 07:51:06 -0700 (PDT)
 
> How do I make a console text editor in C++?
 
Write line editor for a start ;)
red floyd <no.spam.here@its.invalid>: Mar 21 08:09PM -0700

On 3/21/2015 1:01 PM, Lőrinczy Zsigmond wrote:
>> DDD
 
>> reason: lack of 'break' statements.
 
> BCC5.5 proved me right.
 
Dude, you should NOT have answered. He's trying to get us to
do his homework.
"Lőrinczy Zsigmond" <nospam@for.me>: Mar 22 10:50AM +0100

> Dude, you should NOT have answered. He's trying to get us to
> do his homework.
 
That might be so:)
He will fail nonetheless
if he cannot even compile and execute a trivial example program...
"Osmium" <r124c4u102@comcast.net>: Mar 22 07:21AM -0600

"red floyd" wrote:
 
 
>> BCC5.5 proved me right.
 
> Dude, you should NOT have answered. He's trying to get us to
> do his homework.
 
That seems very unlikely. Why in the world would any school teach such an
ancient version of the language? Consider the difficulty of finding
something like 20 copies of an ancient text book.
Victor Bazarov <v.bazarov@comcast.invalid>: Mar 22 10:03AM -0400

On 3/22/2015 9:21 AM, Osmium wrote:
 
> That seems very unlikely. Why in the world would any school teach such an
> ancient version of the language? Consider the difficulty of finding
> something like 20 copies of an ancient text book.
 
Considering that the OP is in Egypt it's not an unlikely scenario that
they are using second-, third-, or even higher order-hand books along
with software and equipment... Still doesn't justify doing their
homework for them.
 
V
--
I do not respond to top-posted replies, please don't ask
"Öö Tiib" <ootiib@hot.ee>: Mar 22 11:49AM -0700

On Sunday, 22 March 2015 11:51:01 UTC+2, Lőrinczy Zsigmond wrote:
 
> That might be so:)
> He will fail nonetheless
> if he cannot even compile and execute a trivial example program...
 
Yes but your answer was against rules of the game too. You should
either avoid answering at all, link FAQ 5.2 or give some entertaining
to read but wrong answer to homework questions.
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Mar 22 02:34AM

On 21/03/2015 21:55, Robert Wessel wrote:
> then he fills their net with so many fish they can't haul it in, so
> they *still* have no fish, and have probably lost their net in the
> process.
 
It is really quite simple.
 
According to the New Testament Jesus was related to David.
According to the Old Testament David was related to Adam.
According to evolution (science) humans evolved so there was no first
human called Adam.
 
So science falsifies the New and Old Testament and in the process kills
Jesus and the Abrahamic god.
 
Conclusion: Judaism, Christianity and Islam are all based on a lie.
Time to get a new religion: try science!
 
/Flibble
 
P.S. Sausages.
Robert Wessel <robertwessel2@yahoo.com>: Mar 22 12:23AM -0500

On Sun, 22 Mar 2015 02:34:08 +0000, Mr Flibble
>> they *still* have no fish, and have probably lost their net in the
>> process.
 
>It is really quite simple.
 
 
Why tell me? I'm the one making fun of a famous biblical allegory.
 
 
 
>So science falsifies the New and Old Testament and in the process kills
>Jesus and the Abrahamic god.
 
>Conclusion: Judaism, Christianity and Islam are all based on a lie.
 
 
Logically that argument applies only to the relatively modest subset
of followers* of one of the Abrahamic religions who believes the Old
and New Testaments** are the literal, and inerrant, word of God. For
example, no Roman Catholic should*** believe such a thing, and that's
half the people calling themselves Christians right there. The same
applies to most orthodox sects as well. And while Muslims consider
the Quran inerrant****, but the other inspired books (very roughly the
parts of the Old and New Testament accepted by Islam), are *not*
granted that status. Genesis is *specifically* held to be
allegorical. So that's something like three-quarters of the followers
of the Abrahamic religions right there, and most of the rest don't
assume inerrancy either.
 
Of course the people to whom this argument would actually apply, are
pretty likely to simply reject evolution in the first place.
 
 
*Or at least claimed followers.
 
**Obviously not all sects accept quite the same versions of those.
 
***The Church's doctrine is quite clear on the matter, but lots of
people do get it wrong.
 
****At least in its Arabic form.
 
 
>Time to get a new religion: try science!
 
 
Again, why tell me? But science makes for a very odd religion. No
absolute truths, no faith, no unalterable doctrine...
David Brown <david.brown@hesbynett.no>: Mar 22 11:31AM +0100

>> has C++ as his single major interest in his life and work. Then maybe
>> C++ developers can look to him as a "visionary" for C++.
 
> Here's a quote from Yeshua (aka Jesus):
 
You mean, a quotation from a translation of copies of something that
someone wrote down because someone told them that someone heard a
preacher saying...
 
The Bible has some interesting philosophy in parts, and some of it is
worth following. But it has no evidence or justification for claims to
authority. /You/ may believe it has special authority, but that's
/your/ business - you can't expect anyone else to agree or even to
understand your position.
 
>> personal matter.)
 
> I'm letting others know the source of my help. He likes
> helping people.
 
That's fine, but this is not the place for it. An occasional hint is
not unreasonable, but most people here already know that your religious
beliefs are a major driving force in your life and work - we don't need
to be told again. If you want to persuade people to join your religion,
do so by demonstrating its benefits through your words and deeds - show
us how it makes you a better person or a better programmer. (And no,
reposting complaints about swearing does not show that you are a better
person. Nor do Biblical quotations.) That's your challenge.
 
(But please, for the sake of others in c.l.c++ who dislike such OT
posts, try to keep religious threads to a minimum here. I already
mentioned sci.electronics.design as a group where on-topic threads are
so rare that they are practically off-topic - you might consider it as
an option.)
Bo Persson <bop@gmb.dk>: Mar 22 01:59PM +0100

On 2015-03-22 03:34, Mr Flibble wrote:
 
> According to the Old Testament David was related to Adam.
> According to evolution (science) humans evolved so there was no first
> human called Adam.
 
It doesn't prove anything. Once upon a time, there could very well have
been a man called Adam. We don't know.
 
 
All we know is that there a are some serious gaps in the story told by
the Genesis:
 
There are these two people Adam and Eve. They have two sons. One of them
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?
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Mar 22 05:12PM

On 22/03/2015 05:23, Robert Wessel wrote:
 
>> Conclusion: Judaism, Christianity and Islam are all based on a lie.
 
> Logically that argument applies only to the relatively modest subset
> of followers* of one of the Abrahamic religions who believes the Old
 
Nonsense. Abraham never existed. The Abrahamic god is predicated on
the Bible being true; if the Bible is not true then that god doesn't
exist and you are talking about some other god not the Abrahamic one.
 
/Flibble
"Öö Tiib" <ootiib@hot.ee>: Mar 22 10:22AM -0700


> Here's a quote from Yeshua (aka Jesus):
 
> "The poor you will always have with you, but you will not
> always have Me." Matthew 26:11
 
What you write does not insult us as much as it does insult yourself.
Yeah ... search for poor idiots in C++ group. You, Brian, are like
that recent "How to make $100,000 in 20-90 days" Kristina C. in it,
no difference.
 
<snip story about Jesus some hunter-gatherers>
 
We programmers are manufacturers not hunter-gatherers. We do no need
luck of catching wild animals to be successful. When we do our work
well, with hearth and brain then other humans buy it from us. Advice
from others (regardless if it is Jesus or Bjarne Stroustrup) is always
worth to listen but never (even if it is holy scripture or latest
edition of "The C++ Programming Language") to blindly follow.
 
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.
woodbrian77@gmail.com: Mar 22 10:32AM -0700

On Sunday, March 22, 2015 at 7:59:39 AM UTC-5, Bo Persson wrote:
 
> There are these two people Adam and Eve. They have two sons. One of them
> 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 don't think Cain found a wife in Nod, but he "knew"
her sexually there. His wife may have been one of his
sisters. According to the historian Josephus, Adam and
Eve had 33 sons and 23 daughters. G-d had told them to
"be fruitful and multiply." Also Abraham was married to
his half-sister according to Genesis 20.
 
Brian
"Öö Tiib" <ootiib@hot.ee>: Mar 22 09:47AM -0700

On Saturday, 21 March 2015 17:33:39 UTC+2, Jorgen Grahn wrote:
> I meant we could write most C++ code as if it was Python or something.
> Not avoid heap allocation, not avoid copying objects etc -- ignoring
> all the performance-oriented tricks we have been taught.
 
Indeed it is typically wast majority of code-base that may be written
without considering performance. Also it takes expert to just guess
what the "tiny minority" likely is before application is written.
It is because the goals and focus of applications tend to shift and
change during writing. So it is always worth to require clarity,
robustness and maintainability even in modules whose performance is
irrelevant because software tends to change and evolve rapidly before
it becomes mature.
 
Performance and robustness are orthogonal but not totally orthogonal
things. I have found that hard to follow algorithm or I/O communication
logic or data layout often tends to have (or after some defect fixing
lead to) performance issues as well.
 
> We would
> still meet the performance requirements ... but then we would be badly
> 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'm not necessarily disagreeing with what you write, except I hope
> more than 10% know how to use a profiler (if they don't we should
> teach them).
 
If work is going in decent-sized teams then most actually even don't
need to learn to handle profiler at all unless they are really
interested about it. Anecdotal example: a young coworker suggested
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. :)
 
What bothers me more is that lot of C++ programmers can't use debugger
unless it is integrated to IDE (by someone else). It is usually done
for desktop applications but more than half of work is about embedded
stuff. Need an IDE then integrate embedded debugger to it yourself. :(
David Brown <david.brown@hesbynett.no>: Mar 22 11:06AM +0100

On 18/03/15 18:59, Ian Collins wrote:
>>> healthcare get the best of both worlds!
 
>> Where you living Ian? I want to get citizenship elsewhere before I die.
 
> New Zealand
 
The same applies to most of Europe. Healthcare, public or private, is
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.
David Brown <david.brown@hesbynett.no>: Mar 22 11:12AM +0100

On 18/03/15 23:25, Chris Vine wrote:
> about. Brian appears to be neither a left wing nut job nor a centrist
> nut job - unless you have evidence to the contrary I doubt such groups
> would be to his taste.
 
By a process of elimination, that means you classify Brian as a "sane
radical" !
 
Anyway, the newsgroup you are looking for is sci.electronics.design.
Occasional electronics or technical subjects are allowed, but for the
most part it is a home for grumpy old right-wing Americans complaining
about the state of their health insurance and the nasty global warming
conspirators who want to take away their monster trucks. Sometimes the
debates can be quite interesting, if you don't take them too seriously -
as long as they don't get swamped by the three or four regulars who only
post insults. (Brian beware - swearing /is/ allowed in s.e.d., and you
will have no chance of stopping it.)
"Kristina C." <kristinaconaway@gmail.com>: Mar 21 09:35PM -0700

HOW TO MAKE 100000 DOLLARS IN 20 -90 DAYS!
Send $1.00 to each of the 6 names and addresses stated in the article. You then place your own name and address in the bottom of the list at #6, and post the article in at least 200 newsgroups. No catch, that was it. So after thinking it over, and talking to a few people first, I thought about trying it. I figured: "what have I got to lose except 6 stamps and $6.00, right?" Then I invested the measly $6.00. Well GUESS WHAT!?... within 7 days, I started getting money in the mail! I was shocked! I figured it would end soon, but the money just kept coming in. In my first week, I made about $25.00. By the end of the second week I had made a total of over $1,000.00! In the third week I had over $10,000.00 and it's still growing. This is now my fourth week and I have made a total of just over $42,000.00 and it's still coming in rapidly. It's certainly worth $6.00, and 6 stamps, I have spent more than that on the lottery!! Let me tell you how this works and most importantly, WHY it works... Also, make sure you print a copy of this article NOW, so you can get the information off of it as you need it. I promise you that if you follow the directions exactly, that you will start making more money than you thought possible by doing something so easy! Suggestion: Read this entire message carefully! (print it out or download it.) Follow the simple directions and watch the money come in! It's easy. It's legal. And your investment is only $6.00 (Plus postage) IMPORTANT: This is not a rip-off; it is not indecent; it is not illegal; and it is 99% no risk - it really works! If all of the following instructions are adhered to, you will receive extraordinary dividends. PLEASE NOTE: Follow these directions EXACTLY, and $50,000.00 or more can be yours in 20 to 60 days. This program remains successful because of the honesty and integrity of the participants. Please continue its success by carefully adhering to the instructions. You will now become part of the Mail Order business. In this business your product is not solid and tangible, it's a service. You are in the business of developing Mailing Lists. Many large corporations are happy to pay big bucks for quality lists. However, the money made from the mailing lists is secondary to the income which is made from people like you and me asking to be included in that list. Here are the 4 easy steps to success: STEP 1: Get 6 separate pieces of paper and write down your name and address followed by the words "PLEASE ADD ME TO YOUR MAILING LIST" on each of them. Now get 6 US $1.00 bills and place ONE inside EACH of the 6 pieces of paper so the bill will not be visible through the envelope (to prevent thievery). Next, place one paper in each of the 6 envelopes and seal them. You should now have 6 sealed envelopes, each with a piece of paper stating the above phrase, your name and address, and a $1.00 bill. What you are doing is creating a service. THIS IS ABSOLUTELY LEGAL! You are requesting a legitimate service and you are paying for it! Like most of us I was a little skeptical and a little worried about the legal aspects of it all. So I checked it out with the U.S. Post Office (1- 800-725-2161) and they confirmed that it is indeed legal. Mail the 6 envelopes to the following addresses: 1.) Kyle P. 1325 Tonti St. LaSalle, IL.USA 61301 2.) Rucci 418 Wilcox Street Carnegie, Pa. 15106 3.) Cody Neely, P.O. box 472, Sylvania Ga. USA 30467 5.) Sarah Mccully, 8818 w 88th st overland park, ks, USA 66212 6.) Kristie C. P.O. Box 3034 Kalispell MT 59903 STEP 2: Now take the #1 name off the list that you see above, move the other names up (6 becomes 5, 5 becomes 4, etc...) and add YOUR Name as number 6 on the list. STEP 3: Change anything you need to, but try to keep this article as close to original as possible. Now, post your amended article to at least 200 newsgroups. (I think there are close to 24,000 groups) All you need is 200, but remember, the more you post, the more money you make! You won't get very much unless you post like crazy. This is perfectly legal! If you have any doubts, refer to Title 18 Sec. 1302 & 1341 of the Postal lottery laws. Keep a copy of these steps for yourself and, whenever you need money, you can use it again, and again. PLEASE REMEMBER that this program remains successful because of the honesty and integrity of the participants and by their carefully adhering to the directions. Look at it this way. If you are of integrity, the program will continue and the money that so many others have received will come your way. NOTE: You may want to retain every name and address sent to you, either on a computer or hard copy and keeps the notes people send you. This VERIFIES that you are truly providing a service. (Also, it might be a good idea to wrap the $1 bill in dark paper to reduce the risk of mail theft.) So, as each post is downloaded and the directions carefully followed, six members will be reimbursed for their participation as a List Developer with one dollar each. Your name will move up the list geometrically so that when your name reaches the #1 position you will be receiving thousands of dollars in CASH!!! What an opportunity for only $6.00 ($1.00 for each of the first six people listed above) Send it now, add your own name to the list and you're in business! ---DIRECTIONS ----- FOR HOW TO POST TO NEWSGROUPS---------- Step 1) You do not need to re-type this entire letter to do your own posting. Simply put your cursor at the beginning of this letter and drag your cursor to the bottom of this document, and select 'copy' from the edit menu. This will copy the entire letter into the computer's memory. Step 2) Open a blank 'notepad' file and places your cursor at the top of the blank page. From the 'edit' menu select 'paste'. This will paste a copy of the letter into notepad so that you can add your name to the list. Step 3) Save your new notepad file as a .txt file. If you want to do your postings in different settings, you'll away, after you get the hang of it, it will take about 30 seconds for each newsgroup! **REMEMBER, THE MORE NEWSGROUPS YOU POST IN, THE MORE MONEY YOU WILL MAKE! BUT: YOU HAVE TO POST A MINIMUM OF 200** That's it! You will begin receiving money from around the world within days! You may eventually want to rent a P.O. Box due to the large amount of mail you will receive. To find newsgroups type in a topic and newsgroup list into google and you should be able to find some. If you put the newsgroup into the search engine it will pull it up and likely it will say google groups if it is free to post. Google lets you post about 15 posts and then you have to wait for a little while, an hour is usually good. You may have to post less adds more frequently. Can also post to facebook groups, youtube, craigslist (don't post more than one or two a day or you will be flagged). Unless you are part of the group already you cannot post to moderated groups.
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: