comp.lang.ada
 help / color / mirror / Atom feed
From: brbarkstrom@gmail.com
Subject: Re: Question on bounded / unbounded strings
Date: Sun, 25 Sep 2016 16:35:33 -0700 (PDT)
Date: 2016-09-25T16:35:33-07:00	[thread overview]
Message-ID: <fe8f9119-b49d-4266-bb50-6e207197b243@googlegroups.com> (raw)
In-Reply-To: <ns833q$1s2m$1@gioia.aioe.org>

On Sunday, September 25, 2016 at 4:50:13 AM UTC-4, Dmitry A. Kazakov wrote:
> On 2016-09-24 20:59, John Smith wrote:
> > On Saturday, September 24, 2016 at 1:45:14 PM UTC-4, Dmitry A. Kazakov wrote:
> 
> >> Searching for a pattern / skipping irrelevant parts of the input do not
> >> require that. No need to split anything.
> >
> > Then how would you accomplish this?
> 
> In a loop over the string. There are many algorithms for pattern 
> matching and many pattern languages, e.g. wildcards, regular 
> expressions, SNOBOL/SPITBOL etc.
> 
> BTW splitting does work anyway if search is not anchored, e.g. you need 
> to find first occurrence of a pattern.
> 
> >> I would use a stream on top of a segmented buffer, e.g.
> >>
> >> http://www.dmitry-kazakov.de/ada/components.htm#Storage_Streams
> >>
> >> Or a FIFO if the producer of the content and the SMTP client are run by
> >> different tasks.
> >>
> >> You don't need to build all attachment in the memory in order to be able
> >> to send it.
> >
> > I disagree. If I write out the attachment to disk and then e-mail
> > it,  that's even more overhead. Why do this? Create a neat package in memory,
> > e-mail it out and then forget about it. Doing this operation in memory
> > would be easier and faster. And I don't have to worry about temporary
> > files or any other files (as well as deleting the files, testing this
> > additional logic, etc.)
> 
> No, the idea is that the generator of the attachment sends parts of as 
> soon as they are ready. It is a pipeline. The SMTP stack sits on TCP/IP 
> stream that sends chunks away.
> 
> The stream used as pipeline between the producer and consumer need not 
> to be able to hold all attachment. Its internal FIFO buffer can be 
> limited, the producer is blocked when the buffer is full and consumer is 
> when the buffer is empty.
> 
> But my point is that Unbounded_String is almost always a poor substitute 
> for more clever and efficient data structures / algorithms. The only 
> excuse to use the former is programmer's laziness.
> 
> -- 
> Regards,
> Dmitry A. Kazakov
> http://www.dmitry-kazakov.de

I use bounded strings in all of my applications.  They're useful for avoiding
buffer overflows.  Also, I use the Bounded_Strings.Append function for a variety
of purposes.  I expect Dimitry wouldn't like putting Bounded_Strings into 
Direct_IO files, where they're useful for fields in records that act like
variable length character strings in databases.  My applications are probably
outside of the realm that Dimitry usually encounters.

Bruce B.


  reply	other threads:[~2016-09-25 23:35 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-13  8:46 Question on bounded / unbounded strings Arie van Wingerden
2016-09-13  9:04 ` Dmitry A. Kazakov
2016-09-22  2:10   ` John Smith
2016-09-22  7:24     ` Dmitry A. Kazakov
2016-09-22  9:01       ` J-P. Rosen
2016-09-22  9:53         ` Dmitry A. Kazakov
2016-09-22 10:58           ` G.B.
2016-09-22 12:05             ` Dmitry A. Kazakov
2016-09-22 14:14               ` G.B.
2016-09-22 17:18                 ` Dmitry A. Kazakov
2016-09-22 11:08           ` J-P. Rosen
2016-09-22 12:05             ` Dmitry A. Kazakov
2016-09-22 13:18           ` Maciej Sobczak
2016-09-22 13:52             ` Dmitry A. Kazakov
2016-09-22 14:51               ` Maciej Sobczak
2016-09-22 17:13                 ` Dmitry A. Kazakov
2016-09-23  5:50                   ` Maciej Sobczak
2016-09-23  6:36                     ` Simon Wright
2016-09-23  7:48                       ` Dmitry A. Kazakov
2016-09-28 20:55                     ` Randy Brukardt
2016-09-23 23:58       ` John Smith
2016-09-24  7:52         ` Dmitry A. Kazakov
2016-09-24 16:25           ` John Smith
2016-09-24 17:44             ` Dmitry A. Kazakov
2016-09-24 18:33               ` John Smith
2016-09-24 18:37               ` John Smith
2016-09-24 18:59               ` John Smith
2016-09-25  8:50                 ` Dmitry A. Kazakov
2016-09-25 23:35                   ` brbarkstrom [this message]
2016-09-26  7:28                     ` Dmitry A. Kazakov
2016-09-26 12:39                       ` brbarkstrom
2016-09-28 21:09             ` Randy Brukardt
2016-09-30  7:59               ` Björn Lundin
2016-09-13  9:35 ` gautier_niouzes
2016-09-13 10:41 ` Alejandro R. Mosteo
2016-09-13 17:41 ` Jeffrey R. Carter
2016-09-13 17:59 ` Björn Lundin
2016-09-14 11:23 ` Arie van Wingerden
2016-09-14 12:26   ` Arie van Wingerden
2016-09-14 12:28   ` Arie van Wingerden
2016-09-14 12:57 ` Arie van Wingerden
2016-09-14 19:39   ` Jeffrey R. Carter
2016-09-17 16:35     ` Arie van Wingerden
2016-09-16 14:43 ` Olivier Henley
2016-09-17 16:35   ` Arie van Wingerden
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox