Wednesday, February 28, 2018

Digest for comp.lang.c++@googlegroups.com - 7 updates in 3 topics

"Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid>: Feb 28 01:40PM -0800

On 2/28/2018 12:35 PM, Rick C. Hodgin wrote:
> of substance, or seeking out solidity in things. I want to grab you by the ears
> and shake you back and forth screaming into your thinking: WAKE UP!! WAKE UP!!
> WAKE UP!!
 
Is that a threat?
 
> But I fear it would do no good. I fear you'll have to go through the
> hardest things, being hurt significantly as you go, before you will wisen up.
 
Is that some kind of other threat as well?
 
[...]
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Feb 28 02:06PM -0800

On Wednesday, February 28, 2018 at 4:40:56 PM UTC-5, Chris M. Thomasson wrote:
> > hardest things, being hurt significantly as you go, before you will wisen up.
 
> Is that some kind of other threat as well?
 
> [...]
 
How do you conclude "threat" from what I wrote?
 
The statement is that you are so hard-headed that nothing will teach
you until go through it yourself. Life will pound you to the ground,
and then, and only then, will you begin to seek those things you
should've been seeking all along.
 
I hope I'm wrong. I hope you find out long before then.
 
I am serious, Chris. You do not realize what you're mocking with your
flippant attitude toward God. You think it's all a joke. It isn't.
These things I teach you about sin, condemnation, Hellfire, and salvation
from sin by and through Jesus Christ are real. And unless you come
to realize this for real, that final day when you stand before God
being judged will consume you.
 
I hope you get this meaning. It is no threat from me to you. It is
the way things will go for you without repentance. It will be the
final relationship you have with God Himself, and it will end very
badly for you ... unless you repent and ask forgiveness fir your sin
before that day.
 
It is my teaching to you only, the teaching that comes from the Bible,
and the teaching that is for all people. The entirety of what will
happen to you is between you and God, and whether or not you accept
Jesus Christ. Romans 12:
 
https://www.biblegateway.com/passage/?search=Romans+12%3A19&version=KJV
 
19 Dearly beloved, avenge not yourselves, but rather give
place unto wrath: for it is written, Vengeance is mine;
I will repay, saith the Lord.
 
Christians do not harm people, Chris. We warn them of the destruction
that is coming their way if they persist in the rebellion against God.
 
Good luck.
 
--
Rick C. Hodgin
"Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid>: Feb 28 03:26PM -0800

On 2/28/2018 2:06 PM, Rick C. Hodgin wrote:
>>> and shake you back and forth screaming into your thinking: WAKE UP!! WAKE UP!!
>>> WAKE UP!!
 
>> Is that a threat?
 
If we ever meet, please do not try to grab me.
 
[...]
red floyd <dont.bother@its.invalid>: Feb 28 09:52AM -0800

On 2/28/2018 3:36 AM, Jorgen Grahn wrote:
> again. The documentation in Stroustrup's book isn't enough, not for
> me anyway.
 
> ISTR that James Kanze had a web page on the subject.
 
Langer and Kreft wrote a book on it. I have it somewhere:
 
"Standard C++ IOStreams and Locales: Advanced Programmer's Guide and
Reference"
 
https://www.amazon.com/Standard-IOStreams-Locales-Programmers-Reference/dp/0201183951
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Feb 28 08:51PM +0100

On 28.02.2018 12:16, Chris Vine wrote:
> namely when you want to construct a stream object for a pre-opened
> file descriptor. I find it surprising that, on unix-like platforms at
> least, gcc and clang do not provide built in streambuffers for this.
 
But g++ does.
 
__gnu_cxx::stdio_filebuf
 
<url: https://gcc.gnu.org/onlinedocs/gcc-4.6.2/libstdc++/api/a00069.html>
 
 
 
> So in a unix-like environment you either have to write your own
> streambuffer (which is what I have done) or you take the easier route
> of using POSIX fdopen() and C streams instead.
 
Cheers & hth.,
 
- Alf
Chris Vine <chris@cvine--nospam--.freeserve.co.uk>: Feb 28 10:49PM

On Wed, 28 Feb 2018 20:51:49 +0100
 
> __gnu_cxx::stdio_filebuf
 
> <url:
> https://gcc.gnu.org/onlinedocs/gcc-4.6.2/libstdc++/api/a00069.html>
 
Ah, OK, I didn't know that. Thanks.
Jorgen Grahn <grahn+nntp@snipabacken.se>: Feb 28 10:05PM

> std::string db;
 
> protocol://[username:password@]host[:port]/db
 
> [...] designates the optional parts
 
That looks suspiciously like an URL, or URI or whatever it's called.
Can't you rely on the formal definition in some RFC instead of
describing it vaguely yourself? You can add extra limitations if you
want to (e.g. you seem to mandate a cleartext password with the user
name)?
 
> My algorithm uses std::string::find_first_of heavily.
 
I personally don't like the std::string methods, the string::npos and
all that business. Consider using <algorithm> on begin(s) .. end(s),
which IMO feels more idiomatic.
 
> In fact I don't like it. It doesn't look clean.
 
A parser doesn't have to look clean. Dump it in a well-documented
function, and write unit tests.
 
> a standard C++ (11+ allowed) or boost (C++ standard preferred)
> Idealy would be to have only a single pass through the string.
 
> Could you please give me some hints or provide some kind of code snippet.
 
I second the recommendation of std::regex, or splitting it up a bit by
other means and then using std::regex on some of the parts.
 
But there are some issues you need to clarify for yourself (e.g. by
using an existing formal definition of the syntax; see above):
 
- Can the username:password part contain :, @ or /? That would mean
you cannot start by splitting on the third / in the string.
 
- Can the host contain a :, and how would that work with host:port?
Host names don't contain colons, but IPv6 addresses do. In an URL,
you'd write it like this [::1]:80.
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
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: