Tuesday, February 9, 2016

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

Jerry Stuckle <jstucklex@attglobal.net>: Feb 08 07:41PM -0500

On 2/8/2016 5:23 PM, Jorgen Grahn wrote:
 
>> you're only talking about 8 MB of additional memory.
 
> Yes.
 
> /Jorgen
 
It depends on the randomness and the operations being performed. A
simple sort of text could be quick . Other operations could take much
longer. How many applications have you had that actually have 1,000,000
objects in memory? I don't think in almost 50 years of programming I
have ever had it. But I have used databases with tens of billions of rows.
 
And, as Ian pointed out, your urandom may not be so random.
 
--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================
"Öö Tiib" <ootiib@hot.ee>: Feb 08 05:31PM -0800

On Tuesday, 9 February 2016 02:41:45 UTC+2, Jerry Stuckle wrote:
> longer. How many applications have you had that actually have 1,000,000
> objects in memory? I don't think in almost 50 years of programming I
> have ever had it. But I have used databases with tens of billions of rows.
 
Yes in 80s it happened rarely since good hard drive was 20 MB. Now it is
common, yet another damn 10MB xml file to chew or other crap like that.
Ian Collins <ian-news@hotmail.com>: Feb 09 02:48PM +1300

Jerry Stuckle wrote:
> longer. How many applications have you had that actually have 1,000,000
> objects in memory? I don't think in almost 50 years of programming I
> have ever had it. But I have used databases with tens of billions of rows.
 
Only one of mine - an in-memory file metadata database for a filesystem
with several million files in a million odd directories! It used about
4GB of RAM...
 
--
Ian Collins
Jerry Stuckle <jstucklex@attglobal.net>: Feb 08 09:15PM -0500

On 2/8/2016 8:31 PM, Öö Tiib wrote:
>> have ever had it. But I have used databases with tens of billions of rows.
 
> Yes in 80s it happened rarely since good hard drive was 20 MB. Now it is
> common, yet another damn 10MB xml file to chew or other crap like that.
 
You don't have tens of billions of rows on a 20MB drive, either.
 
A 10MB xml file will not have > 1M items - that would be less than 10
chars per item, including syntactical characters and newline characters.
And I'm not talking about PC's with 20MB disk drives. I'm also talking
about mainframes with terabytes of drives.
 
--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================
woodbrian77@gmail.com: Feb 08 06:41PM -0800

On Monday, February 8, 2016 at 7:31:29 PM UTC-6, Öö Tiib wrote:
 
Please don't swear here.
 
Brian
Ebenezer Enterprises
http://webEbenezer.net
Ian Collins <ian-news@hotmail.com>: Feb 09 03:49PM +1300

> On Monday, February 8, 2016 at 7:31:29 PM UTC-6, 嘱 Tiib wrote:
 
> Please don't swear here.
 
Do what? Have you anything useful to contribute?
 
--
Ian Collins
Chris Vine <chris@cvine--nospam--.freeserve.co.uk>: Feb 09 11:24AM

On Mon, 8 Feb 2016 18:41:00 -0800 (PST)
> On Monday, February 8, 2016 at 7:31:29 PM UTC-6, Öö Tiib wrote:
 
> Please don't swear here.
 
Can you explain one thing for me? I have heard that Americans of a
tender disposition find the word "damn" offensive, particularly if
they are in their 70s or older. Apparently, Clark Gable's "Frankly, my
dear, I don't give a damn" in Gone with the Wind was regarded there as
slightly daring at the time.
 
This doesn't seem to be the case in any other part of the English
speaking world. Its root as you probably know is, via Middle French,
from the Latin damnare, which has no connotation of "swearing" as you
rather oddly like to put it. It meant to censure in some way, usually
by judicial authorities.
 
What about the word "damn" do you regard as offensive?
 
Chris
David Brown <david.brown@hesbynett.no>: Feb 09 02:14PM +0100

On 09/02/16 12:24, Chris Vine wrote:
> rather oddly like to put it. It meant to censure in some way, usually
> by judicial authorities.
 
> What about the word "damn" do you regard as offensive?
 
Maybe his concern was the word "crap" - which is not really swearing
either. If I remember the derivation correctly, "crap" was the term for
the bits of impurities that floated to the top when rendering down whale
blubber to oil. (There is a popular myth that it comes from Thomas
Crapper, the inventor of the ball-and-cock mechanism of toilets.)
 
It is hard to imagine someone being so prudish as to be bothered by an
occasional "damn" or "crap". It is easy to imagine people being
irritated by repeated and pointless requests "please don't swear here".
Chris Vine <chris@cvine--nospam--.freeserve.co.uk>: Feb 09 02:13PM

On Tue, 09 Feb 2016 14:14:00 +0100
> occasional "damn" or "crap". It is easy to imagine people being
> irritated by repeated and pointless requests "please don't swear
> here".
 
Ah right. Yes, I guess it might be crap which he was finding a
problem with. But it was Brian's view of the American use of damn which
I was interested in, and which he has objected to previously. For
example, one might read in the newspaper here that an official
investigation had given a "damning assessment" or issued a "damning
report" about something. I wonder if that would be regarded as
offensive amongst his co-religionists.
 
Interesting about the whale blubber, that's not one I have heard.
https://en.wikipedia.org/wiki/Thomas_Crapper says about crap that:
 
"The word crap is actually of Middle English origin and predates its
application to bodily waste. Its most likely etymological origin is a
combination of two older words, the Dutch krappen: to pluck off, cut
off, or separate; and the Old French crappe: siftings, waste or
rejected matter (from the medieval Latin crappa, chaff). In English,
it was used to refer to chaff, and also to weeds or other rubbish.
Its first application to bodily waste, according to the Oxford
English Dictionary, appeared in 1846 under a reference to a crapping
ken, or a privy, where ken means a house."
 
It seems to have retained its meaning of some kind of rubbish, and
this might well suggest that the expression was also applied to the
unwanted side products of dealing with whale blubber. Today, one might
often hear the expression "XXX is a piece of crap", meaning that it is
no good rather than that it is composed of animal or human excrement.
However, there are probably occasions you might choose not to use the
word because of its wider meaning, but I don't think newsgroups are one
of them.
 
One interesting feature of religious fruitcakes is that it is often the
absence of circumlocution they object to rather than the intent, which
seems rather odd. So, if someone like Brian objects to "damn", they do
not object to "dang". I don't know if Brian is of that persuasion.
 
Chris
David Brown <david.brown@hesbynett.no>: Feb 09 03:36PM +0100

On 09/02/16 15:13, Chris Vine wrote:
> However, there are probably occasions you might choose not to use the
> word because of its wider meaning, but I don't think newsgroups are one
> of them.
 
Certainly this is all consistent with the use of "crap" as the flotsam
to be scraped off and thrown away when boiling up blubber. But it is at
least equally possible that the derivation is much older, and that this
was just one use of the word. What we can say, is that the word itself
is not a swear word as such, even if it is sometimes used as swearing
(but the same can be said of "sugar").
 
scott@slp53.sl.home (Scott Lurndal): Feb 09 02:55PM


>Yes in 80s it happened rarely since good hard drive was 20 MB. Now it is
>common, yet another damn 10MB xml file to chew or other crap like that.
 
say what? We had 1GB disks in 1982[*].
 
We also had 5MB HPT disks for speed. We also had SSDs (using DRAM chips, not flash).
 
[*] http://www.chipsetc.com/memorex.html
scott@slp53.sl.home (Scott Lurndal): Feb 09 02:58PM

>On Monday, February 8, 2016 at 7:31:29 PM UTC-6, =D6=F6 Tiib wrote:
 
>Please don't swear here.
 
Damn straight, none of that shit here, please.
scott@slp53.sl.home (Scott Lurndal): Feb 09 02:59PM

>rather oddly like to put it. It meant to censure in some way, usually
>by judicial authorities.
 
>What about the word "damn" do you regard as offensive?
 
 
I think it was the perfectly cromulent "crap" that he was complaining about.
Geoff <geoff@invalid.invalid>: Feb 09 09:19AM -0800

On Tue, 09 Feb 2016 14:55:58 GMT, scott@slp53.sl.home (Scott Lurndal)
wrote:
 
 
>say what? We had 1GB disks in 1982[*].
 
>We also had 5MB HPT disks for speed. We also had SSDs (using DRAM chips, not flash).
 
>[*] http://www.chipsetc.com/memorex.html
 
Don't forget bubble memory! But that had nothing to do with speed. :)
Jerry Stuckle <jstucklex@attglobal.net>: Feb 09 01:15PM -0500

On 2/9/2016 9:36 AM, David Brown wrote:
>> seems rather odd. So, if someone like Brian objects to "damn", they do
>> not object to "dang". I don't know if Brian is of that persuasion.
 
>> Chris
 
Actually, I think the U.S. usage anyway came from a Londoner - Thomas
Crapper. While the common belief is that he invented the flush toilet,
he really didn't. He did, however, increase its popularity.
 
And during WWI, soldiers visiting the facilities would "take a crap".
 
Now the usage on the other side of the pond may be different.
 
--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================
Jorgen Grahn <grahn+nntp@snipabacken.se>: Feb 09 07:26PM

On Tue, 2016-02-09, Jerry Stuckle wrote:
> simple sort of text could be quick . Other operations could take much
> longer. How many applications have you had that actually have 1,000,000
> objects in memory?
 
The one above, for example ... I didn't write sort(1) myself of
course, but I don't hesitate to operate on large data sets in Unix
pipelines.
 
And even I am frequently surprised when I see a badly written Perl
script chew up megabytes of data in almost no time at all.
 
> I don't think in almost 50 years of programming I have ever had it.
> But I have used databases with tens of billions of rows.
 
People do different things with computers, obviously.
 
I used to write simulators for mobile networks, and these were used to
simulate millions of cell phones doing stuff, each with one or more
data bearers (which also were modeled as objects, of course).
 
If you're asking because you still believe having a million objects is
a problem that needs special care, I can just say it never was, in my
experience.
 
I didn't have to do anything unusual to support that -- just normal
objects, and standard containers. I think at some point I analyzed
what used up memory in such an object, and split out things which were
shared by many similar CellPhone objects ... but that had more to do
with refactoring for clarity, and less with conservation of RAM.
 
> And, as Ian pointed out, your urandom may not be so random.
 
He did, but I fail to see how that's relevant. I just wanted to
produce a million lines of text, and forgot that I could use 'seq 1
1000000' instead of the head of an infinite sequence.
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
Geoff <geoff@invalid.invalid>: Feb 08 09:45PM -0800

On Mon, 8 Feb 2016 16:36:50 -0500, Jerry Stuckle
 
>> Andy
 
>Sure, but did they test every gate? Or did they just have access to
>every gate? Or did they just use the scan chains to debug problems?
 
The technology is JTAG IEEE 1149.1 and the chains allow every function
on a chip to be tested against the specification and/or the
simulation. Yes, they can and often do test every gate.
 
The code (VHDL) that expresses the design of the chip is tested
extensively in simulation before it's dedicated to silicon and the
JTAG simulation can also be tested at that time.
 
Once you have hardware you repeat the tests against the device and
verify it functions as designed and as verified by the designers.
 
Once the device is installed in a board the test suites that were
designed per the functional specifications for the board and its
components are run to verify the production version of the board.
 
JTAG tests can also be run on the production line to verify
functionality of samples or 100% of circuit boards or chips.
 
Design of the tests and hardware design are done concurrently against
the same specification.
 
>You have access to every expression in the source code. But do you test
>that every expression works? Or do you see if the unit does what it's
>supposed to?
 
That would depend on the specifications of the unit tests wouldn't it?
A correct unit test specification would test a function or method such
that every code path is exercised, return values are as expected for
arguments given and all corner cases are exercised.
Jerry Stuckle <jstucklex@attglobal.net>: Feb 09 08:33AM -0500

On 2/9/2016 12:45 AM, Geoff wrote:
 
> The technology is JTAG IEEE 1149.1 and the chains allow every function
> on a chip to be tested against the specification and/or the
> simulation. Yes, they can and often do test every gate.
 
The design is tested. Individual gates are not - or so I've been told
by Intel engineers - or any other hardware engineers I've worked with.
They don't even test individual gates in SSI chips, which have very few
gates. For instance, they don't test the individual gates in a 7473
flip-flop - they just ensure the chip operates correctly.
 
> The code (VHDL) that expresses the design of the chip is tested
> extensively in simulation before it's dedicated to silicon and the
> JTAG simulation can also be tested at that time.
 
Again, the design is tested. Not every single gate.
 
> Once you have hardware you repeat the tests against the device and
> verify it functions as designed and as verified by the designers.
 
Yes, and the operation of the device is tested - not every single gate.
 
> Once the device is installed in a board the test suites that were
> designed per the functional specifications for the board and its
> components are run to verify the production version of the board.
 
Sure. The operation is tested - not every single gate.
 
> JTAG tests can also be run on the production line to verify
> functionality of samples or 100% of circuit boards or chips.
 
Not to repeat myself - but the operation is tested - not every single gate.
 
> Design of the tests and hardware design are done concurrently against
> the same specification.
 
Do I need to repeat myself again?
 
> A correct unit test specification would test a function or method such
> that every code path is exercised, return values are as expected for
> arguments given and all corner cases are exercised.
 
I have never seen a test specification which tests individual
expressions. They test the operation of the unit.
 
--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================
scott@slp53.sl.home (Scott Lurndal): Feb 09 02:49PM


>> Andy
 
>Sure, but did they test every gate? Or did they just have access to
>every gate? Or did they just use the scan chains to debug problems?
 
We test every gate in simulation. Every block has both BIST and BISR.
 
Manufacturing uses the scan chains when testing individual processors.
Geoff <geoff@invalid.invalid>: Feb 09 09:13AM -0800

On Tue, 9 Feb 2016 08:33:41 -0500, Jerry Stuckle
<jstucklex@attglobal.net> wrote:
[snip]
 
>They don't even test individual gates in SSI chips, which have very few
>gates. For instance, they don't test the individual gates in a 7473
>flip-flop - they just ensure the chip operates correctly.
 
Your knowledge is outdated. Your knowledge is also second-hand and
most likely have misunderstood what you were told. As a practicing
engineer in the field who has practical experience with ASIC and SOC
designs I can tell you unequivocally that gates are tested, functional
blocks are tested and the entire design is tested at every step in the
process, especially before the silicon is produced. Once in production
the scan chains are tested against the expected patterns and defects
are investigated and root causes exposed and corrected.
 
SSI chips are another matter entirely and I never mentioned them and
now you bring them up as some kind of example. Then you cite 7400
series chips where JTAG is not even feasible due to pin count and TTL
technology isn't even used in most large scale projects where JTAG is
an essential part of the validation process. This shows how your
knowledge of this topic really out of date and obsolescent. Where
flip-flops (of any technology) are incorporated in the LSI and HSI of
an ASIC or SOC I can tell you with absolute certainty they are tested
at the gate level.
 
You don't need to repeat yourself. You need to shut up about a topic
you know nothing about. Your ignorance is exposed.
Ian Collins <ian-news@hotmail.com>: Feb 10 07:04AM +1300

Geoff wrote:
>> gates. For instance, they don't test the individual gates in a 7473
>> flip-flop - they just ensure the chip operates correctly.
 
> Your knowledge is outdated.
 
Not even that, just wrong... The ASIC designs I was involved with in the
mid 80s had to have full scan path test coverage. It was a requirement
for military avionics.
 
--
Ian Collins
Jerry Stuckle <jstucklex@attglobal.net>: Feb 09 01:05PM -0500

On 2/9/2016 12:13 PM, Geoff wrote:
> process, especially before the silicon is produced. Once in production
> the scan chains are tested against the expected patterns and defects
> are investigated and root causes exposed and corrected.
 
Not really - not when I was consulting with the programmers at Intel.
And I can tell you that every one of the millions of gates on a chip is
NOT tested. In fact, in the finished chip, there aren't even ways to
test the vast majority of the gates. What IS tested is the operation of
the chip.
 
Yes, the design is tested, and within that design, functional blocks are
tested. But if a half adder works, I don't need to test any of the
individual gates.
 
> flip-flops (of any technology) are incorporated in the LSI and HSI of
> an ASIC or SOC I can tell you with absolute certainty they are tested
> at the gate level.
 
I'm also not talking about SOC's - YOU brought those up. I'm talking
about Pentiums, I3's, I5's, I7's - these aren't even designed by
engineers. The engineers feed in design specs and the chips are
designed by computers. The output is a logical "chip" which can be
tested in pieces and as a whole. Each gate *could* be tested - but it's
a huge waste of time. A NAND gate is a NAND gate. It will always work
as a NAND gate, and there's no reason to think it won't.
 
Of course, not everything can be tested - timing, for instance, can
cause problems. So once the design is verified at this level, a mask is
created and prototypes are made. The prototypes are then tested - but
not every gate is tested.
 
And even with JTAG, it is not feasible to test any of the millions of
gates on a current microprocessor. There aren't nearly enough pins to
do it. In fact, the ration of gates to pins is lower on a 7400 series
chip than it is on any of the current microprocessors. If you can't do
it on a 7400 series chip, you sure as heck can't do it on an I7.
 
> You don't need to repeat yourself. You need to shut up about a topic
> you know nothing about. Your ignorance is exposed.
 
You should learn to take your own advice.
 
--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================
Jerry Stuckle <jstucklex@attglobal.net>: Feb 09 01:07PM -0500

On 2/9/2016 9:49 AM, Scott Lurndal wrote:
>> every gate? Or did they just use the scan chains to debug problems?
 
> We test every gate in simulation. Every block has both BIST and BISR.
 
> Manufacturing uses the scan chains when testing individual processors.
 
You check every NAND gate to ensure it works as a NAND gate? And you do
it on the chip?
 
That's different than doing it in simulation. And scan chains still do
not check every gate. They check the operation of small blocks.
 
--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================
SG <s.gesemann@gmail.com>: Feb 09 06:42AM -0800

Am Montag, 8. Februar 2016 22:52:07 UTC+1 schrieb Lynn McGuire:
> "Rust vs. C++: Fine-grained Performance"
> cantrip.org/rust-vs-c++.html
 
> Modules, modules, modules!
 
Rust also has constrained generics and does the kind of modular type
checking Doug Gregor promised to us for C++ in the 2009 Concepts
proposal. "Concepts lite" does not do that, by the way.
 
There is a lot to like about Rust. The core language as well as the
standard library is well-thought-out. The tools around Rust are nice
(the package and dependency manager cargo, rustdoc). Unit-Testing
is easy and painless. The process of adding to the language is open
and documented. I'm excited to see where this is all going.
 
Apart from the obviously small set of Rust libraries people have
developed so far due to the language being rather young (small
compared to what the C and C++ ecosystems have to offer), there are
only a handful of things I whish would improve, for example, "impl
specialization" [0] and "type-level integers" [1]. Oh, and the
compiler could be faster, too. :)
 
> And Go is coming up fast according to my son.
 
Go does not appeal to me for a mix of reasons. For example: no
support for generic programming. I also don't like the C-style error
handling [2]. Being able to return multiple things from functions is
nice but not much of an improvement if you are still supposed to
manually check the error value and can forget to do so. It seems
pairs are the wrong choice for a return type of a function that can
fail to do its job. This is my conclusion after being exposed to
programming languages that support sum types and pattern matching.
 
[0] https://github.com/rust-lang/rfcs/issues/1038
[1] https://github.com/rust-lang/rfcs/pull/1210/
[2] https://blog.golang.org/error-handling-and-go
 
Cheers!
sg
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Feb 09 05:32AM +0100

On 2/8/2016 9:23 PM, Paul N wrote:
> binary, regardless of the number of piles. It works best for the
> less-common "last man wins" version but can be easily tweaked for the
> more common "last-man-loses" version.
 
You're right, I mis-remembered this.
 
Huh.
 
But then, I remember the two-heap game's solution as involving Fibonacci
numbers, which I calculated using the golden ratio (before knowing that
they were Fibonacci numbers), and there's nothing about that in the
Wikipedia article. Indeed the simple strategy of keeping the heaps equal
size, until the last move, suffices for 2 heaps. So I'm at a loss as to
what game or rules I remember strategies for...
 
 
> does offer the solution (regardless of the number of piles). But this
> is much rarer - and it can't easily be tweaked for the
> "last-man-loses" version, as far as I know.
 
Oh. Thanks!
 
 
Cheers,
 
- Alf
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: