Monday, November 30, 2015

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

Wouter van Ooijen <wouter@voti.nl>: Nov 30 10:56PM +0100

Op 30-Nov-15 om 10:22 PM schreef Lynn McGuire:
 
> Here are the current top 50 computer languages by searches. Assembly is
> #11.
> http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
 
Wow, yet another generator of heaps of numbers, without any clear
indication how they are derived.
 
Wouter
Lynn McGuire <lmc@winsim.com>: Nov 30 04:56PM -0600

On 11/30/2015 3:56 PM, Wouter van Ooijen wrote:
>> http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
 
> Wow, yet another generator of heaps of numbers, without any clear indication how they are derived.
 
> Wouter
 
Here you go:
http://www.tiobe.com/index.php/content/paperinfo/tpci/programminglanguages_definition.html
 
I'm not sure how you can get more clear than that explanation.
 
Lynn
Paul <pepstein5@gmail.com>: Nov 30 09:18AM -0800

On Monday, August 10, 2015 at 10:28:32 AM UTC+1, Öö Tiib wrote:
 
> Simplest to me feels to try to type the sentence above in C++:
 
> std::priority_queue<int, std::vector<int>, decltype(&f)> pq( &f, vec );
 
> Was it what you asked?
Is the below also ok? Is this a context in which the type of a function is understood to be the function pointer?
 
Thank You,
 
Paul
std::priority_queue<int, std::vector<int>, decltype(f)> pq( f, vec );
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.

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

Paavo Helde <myfirstname@osa.pri.ee>: Nov 29 06:16PM -0600


> C was the first computer language to successfully change from line
> oriented (Fortran, Cobol, etc) to byte oriented. And, then C++ jumped
> from pure procedural to object oriented.
 
If you really think OO is the single or the main feature differentiating
C++ from C, then I'm afraid there has been some miscommunication at some
point. There are also for example RAII, templates, functional-programming
features (including lambdas), which all are tangential to OO and which
really make C++ a multi-paradigm language. The RAII concept alone is worth
at least as much as the whole OO paradigm, and yet by some reason it is not
often found in other languages, OO or not.
 
Cheers
Paavo
Lynn McGuire <lmc@winsim.com>: Nov 29 08:21PM -0600

On 11/29/2015 6:16 PM, Paavo Helde wrote:
> often found in other languages, OO or not.
 
> Cheers
> Paavo
 
Cool, you helped my argument that C and C++ are a major change in the
way that computer software is written.
 
I started writing software using Fortran IV on a Univac 1108 in 1975
with punch cards and a line printer. Today's software tools are simply
amazing even though I am a big C++ fan.
 
I've got 800,000 lines of Fortran code and 500,000 lines of C++ in our
application. The cost of maintaining the Fortran code is eating me
alive whereas the C++ code is extremely extensible and maintainable. If
I could wave a magic wand and convert my F77 code to C++, I would do it
right now.
 
Thanks,
Lynn
Wouter van Ooijen <wouter@voti.nl>: Nov 30 07:43AM +0100

Op 29-Nov-15 om 11:22 PM schreef Lynn McGuire:
>> Algol 60.
 
>> Bo Persson
 
> Sorry, Algol was not a successful computer language.
 
Even if you don't regard it as a sucessfull language as such, it has set
the standard for block-scoped goto-less line-agnostic syntax for
(nearly?) all subsequent languages.
 
Wouter
Christian Gollwitzer <auriocus@gmx.de>: Nov 30 09:17AM +0100

Am 30.11.15 um 03:21 schrieb Lynn McGuire:
> If
> I could wave a magic wand and convert my F77 code to C++, I would do it
> right now.
 
http://www.netlib.org/f2c/
 
(just kidding)
 
Christian
scott@slp53.sl.home (Scott Lurndal): Nov 30 02:07PM

>> Consider this quote from Rob Pike, one of the developers of the Go
>> programming language, which he gave in a speech in 2012:
 
>C was the first computer language to successfully change from line
 
I give you ALGOL, SPL/3000, BPL, Bliss, BCPL and a handful of other
languages predating C.
scott@slp53.sl.home (Scott Lurndal): Nov 30 02:08PM

>> Algol 60.
 
>> Bo Persson
 
>Sorry, Algol was not a successful computer language.
 
By what criteria? It is still in widespread use in certain
verticals on Unisys (nee Burroughs) hardware.
Lynn McGuire <lmc@winsim.com>: Nov 30 12:31PM -0600

On 11/30/2015 2:17 AM, Christian Gollwitzer wrote:
 
> http://www.netlib.org/f2c/
 
> (just kidding)
 
> Christian
 
I wish. The code from f2c is absolutely horrible.
 
We are going to try Fable next:
http://cci.lbl.gov/fable/
 
Lynn
Lynn McGuire <lmc@winsim.com>: Nov 30 12:32PM -0600

On 11/30/2015 8:07 AM, Scott Lurndal wrote:
 
>> C was the first computer language to successfully change from line
 
> I give you ALGOL, SPL/3000, BPL, Bliss, BCPL and a handful of other
> languages predating C.
 
None of these were successful in the marketplace of life.
 
Lynn
Lynn McGuire <lmc@winsim.com>: Nov 30 12:33PM -0600

On 11/30/2015 8:08 AM, Scott Lurndal wrote:
 
>> Sorry, Algol was not a successful computer language.
 
> By what criteria? It is still in widespread use in certain
> verticals on Unisys (nee Burroughs) hardware.
 
Mine.
 
Lynn
Lynn McGuire <lmc@winsim.com>: Nov 30 12:34PM -0600

On 11/30/2015 12:43 AM, Wouter van Ooijen wrote:
 
> Even if you don't regard it as a sucessfull language as such, it has set the standard for block-scoped goto-less line-agnostic syntax
> for (nearly?) all subsequent languages.
 
> Wouter
 
Great experimental language according to my Dad who wrote refinery optimization programs in it for Shell. But it did not make the
jump to common usage.
 
Lynn
Lynn McGuire <lmc@winsim.com>: Nov 30 12:36PM -0600

On 11/30/2015 8:07 AM, Scott Lurndal wrote:
 
>> C was the first computer language to successfully change from line
 
> I give you ALGOL, SPL/3000, BPL, Bliss, BCPL and a handful of other
> languages predating C.
 
BTW, my list of successful computer languages is:
1. Assembly language
2. Fortran
3. Cobol
4. C
5. C++
6. PHP
7. HTML
8. Objective C/C++
9. Perl
10. C#
11. Java
 
Lynn
Juha Nieminen <nospam@thanks.invalid>: Nov 30 06:54PM

> 1. Assembly language
 
Whether assembly can be considered a "programming language" is a matter
of opinion and definition.
 
Sure, it gives a readable name to each opcode, and the compiler will
calculate jump offsets and addresses for you, but... that's about it.
 
It's almost as much of a "programming language" as writing executable
binary code in raw bytes directly. Maybe not as hard, but not much
easier either.
 
--- news://freenews.netfront.net/ - complaints: news@netfront.net ---
scott@slp53.sl.home (Scott Lurndal): Nov 30 07:17PM


>> I give you ALGOL, SPL/3000, BPL, Bliss, BCPL and a handful of other
>> languages predating C.
 
>None of these were successful in the marketplace of life.
 
You wrote "C was the first computer language to successfully change
from line to byte".
 
I wrote that ALGOL, SPL/3000, BPL, Bliss, BCPL and a handful of
other languages which predated C were byte-oriented.
 
You made no claim about success, however, your claim that
the aforementioned languages weren't "successful in the marketplace
of life" is complete nonsense.
scott@slp53.sl.home (Scott Lurndal): Nov 30 07:18PM


>> By what criteria? It is still in widespread use in certain
>> verticals on Unisys (nee Burroughs) hardware.
 
>Mine.
 
Which is completely meaningless when you communicate
with others in the field.
Lynn McGuire <lmc@winsim.com>: Nov 30 03:16PM -0600

On 11/30/2015 12:36 PM, Lynn McGuire wrote:
> 10. C#
> 11. Java
 
> Lynn
 
Oops, I left off:
12. Basic
 
Lynn
Lynn McGuire <lmc@winsim.com>: Nov 30 03:22PM -0600

On 11/30/2015 12:54 PM, Juha Nieminen wrote:
 
> It's almost as much of a "programming language" as writing executable
> binary code in raw bytes directly. Maybe not as hard, but not much
> easier either.
 
Calculating those jumps and offsets is non-trivial. I took an IBM 370 Macro Assembly course in college and had to calculate those
jumps and offsets by hand. And not all opcodes translate into a single machine instruction.
 
Here are the current top 50 computer languages by searches. Assembly is #11.
http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
 
Huh, Pascal is #11 and #17. I would have never thought it was in the top 50 anymore.
 
Lynn
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Nov 30 04:38AM +0100

On 11/29/2015 9:27 PM, MikeCopeland wrote:
> I can, of course, construct a string constant of these bits, but it's
> tedious to code and completely lacking in good documentation...
> Is there an easy way to do so in source code? TIA
 
The answers so far have just presented short, easy to grasp code.
 
But a challenge to simplify one little aspect of notation requires lots
more code, to hone that little aspect down to the very simplest! Like
 
my::Bits<100> const bits = { 7, 9, 43, 47, Range( 51, 59 ), 66, 67 };
 
In the following I have however refrained from adding the most obvious
things like standard typedefs for iterators, or a formally correct
operator++(int); I leave those details to the reader!
 
<code>
#include <bitset>
#include <functional> // std::equal_to, std::less
#include <initializer_list>
#include <iostream>
#include <stddef.h> // ptrdiff_t
#include <utility> // std::move
 
namespace my {
using std::bitset;
using std::equal_to;
using std::initializer_list;
using std::less;
using std::move;
 
using Size = ptrdiff_t;
 
template< class Type >
auto n_items( Type const& o ) -> Size { return o.size(); }
 
template< class Type >
auto stdcmp( Type&& a, Type&& b )
-> int
{
using Eq = equal_to<Type>;
using Lt = less<Type>;
return (Eq()( a, b )? 0 : Lt()( a, b )? -1 : +1);
}
 
template< class State >
class Forward_iterator
{
private:
State state_;
 
public:
friend
auto operator==( Forward_iterator const& a, Forward_iterator
const& b )
-> bool
{ return (compare( a.state_, b.state_ ) == 0); }
 
friend
auto operator!=( Forward_iterator const& a, Forward_iterator
const& b )
-> bool
{ return (compare( a.state_, b.state_ ) != 0); }
 
auto operator++()
-> Forward_iterator&
{ state_.advance(); return *this; }
 
void operator++( int )
{
//Forward_iterator result = *this;
state_.advance();
//return result;
}
 
auto operator*() const
-> decltype( state_.referent() )
{ return state_.referent(); }
 
Forward_iterator( State state ): state_( move( state ) ) {}
};
 
template< class Type = int >
class Int_range
{
private:
Type first_;
Type last_;
 
class Iterstate
{
friend class Int_range<Type>;
private:
Int_range const* p_range_;
Type current_;
 
Iterstate( Int_range const& range, Type const where )
: p_range_( &range ), current_( where )
{}
 
public:
friend
auto compare( Iterstate const& a, Iterstate const& b )
-> int
{
if( int const r = stdcmp( a.p_range_, b.p_range_ ) ) {
return r; };
return stdcmp( a.current_, b.current_ );
}
 
void advance() { ++current_; }
auto referent() const -> Type { return current_; }
};
 
public:
using Iterator = Forward_iterator<Iterstate>;
 
auto begin() const
-> Iterator
{ return Iterator( Iterstate( *this, first_ ) ); }
 
auto end() const
-> Iterator
{ return Iterator( Iterstate( *this, last_ + 1 ) ); }
 
Int_range( Type const value )
: first_( value ), last_( value )
{}
 
Int_range( Type const a, Type const b )
: first_( a ), last_( b )
{}
};
 
template< Size n >
class Bits
: public std::bitset< n >
{
public:
Bits( initializer_list<Int_range<>> const& one_bits )
{
for( Int_range<> const& r : one_bits )
{
for( int const i : r )
{
this->set( i );
}
}
}
};
} // namespace my
 
auto main() -> int
{
using Range = my::Int_range<>;
my::Bits<100> const bits = { 7, 9, 43, 47, Range( 51, 59 ), 66, 67 };
 
std::cout << "Bits ";
for ( int i = 0; i < n_items( bits ); i++)
{
if( bits.test(i) )
{
std::cout << i << ' ';
}
}
std::cout << "are set." << std::endl;
}
</code>
 
Cheers, & hth.,
 
- Alf
"Öö Tiib" <ootiib@hot.ee>: Nov 29 10:25PM -0800

On Sunday, 29 November 2015 22:27:32 UTC+2, MikeCopeland wrote:
> I can, of course, construct a string constant of these bits, but it's
> tedious to code and completely lacking in good documentation...
> Is there an easy way to do so in source code? TIA
 
To set 15 concrete bits you can just use 'set':
 
#include <iostream>
#include <bitset>
 
int main()
{
std::bitset<100> myBits;
myBits.set( 7).set( 9).set(43).set(47).set(51)
.set(52).set(53).set(54).set(55).set(56)
.set(57).set(58).set(59).set(66).set(67);
 
std::cout << myBits << '\n';
}
 
Magic numbers make it to look like binary dump, better name your bits.
Paavo Helde <myfirstname@osa.pri.ee>: Nov 30 02:31AM -0600


> But your requirement reminds me of the Pascal way to do the same:
 
> var myBits: set of 1..100;
 
> myBits := [7, 9, 43, 47, 51..59, 66, 67];
 
In C++ there are two different containers for holding such things,
std::set and std::bitset. I guess the Pascal sets are internally
implemented similarly to C++ std::set. Coincidentally, initializing a
std::set would indeed be one line in C++:
 
std::set<int> myBits {7, 9, 43, 47, 51, 52, 53, 54, 55, 56, 57, 58, 59,
66, 67};
 
Alas, integer type range restriction is not present here. One could use a
custom class (e.g. boost::constrained_value) instead of int here, but
this is not in standard.
 
std::bitset is a different beast which encapsulates an array of bits.
Coincidentally, it suits better for emulating Pascal subrange type 'set
of 0..N', for small values of N. Alas, it is lacking a convenience
constructor taking a list of bits, I guess this might be just an
oversight.
 
Cheers
Paavo
Juha Nieminen <nospam@thanks.invalid>: Nov 30 09:24AM

> using std::initializer_list;
> using std::less;
> using std::move;
 
Why?
 
--- news://freenews.netfront.net/ - complaints: news@netfront.net ---
"K. Frank" <kfrank29.c@gmail.com>: Nov 30 06:39AM -0800

Hi Juha (and Alf)!
 
On Monday, November 30, 2015 at 4:24:51 AM UTC-5, Juha Nieminen wrote:
> > using std::less;
> > using std::move;
 
> Why?
 
Why?
 
Because this is a c++ newsgroup where people explore
ideas with like-minded (or sometimes unlike-minded)
members of the community. It's a good place to try
things out that might be interesting but not fully
baked, and might not have a place in production code.
 
Personally, I welcome Alf's posts. Some of them I
find to be gratuitous overkill, but others I find
to be informative and thought-provoking, even if I
wouldn't use them in "real" code.
 
It's good to experiment.
 
And in fairness, Alf did begin his post with:
 
 
> But a challenge to simplify one little aspect of
> notation requires lots more code, to hone that little
> aspect down to the very simplest!
 
which I take to be Alf-speak for "others have already
posted the practical solution, but let's go ahead and
have a little fun here ..."
 
Or, in short, why not?
 
 
Happy Hacking!
 
 
K. Frank
David Brown <david.brown@hesbynett.no>: Nov 30 03:52PM +0100

On 30/11/15 10:24, Juha Nieminen wrote:
>> using std::less;
>> using std::move;
 
> Why?
 
My guess is that Alf wants to simplify the code that uses these common
identifiers, but does not want a global "using std" to fill up his
namespace.
 
It is also possible that he uses a common #include file in his
programming that lists a number of these "using" clauses, but for the
example here he has copied them in directly. Perhaps in his normal code
he simply writes #include "using_std.h" to bring in a few dozen common
identifiers.
"Öö Tiib" <ootiib@hot.ee>: Nov 30 08:18AM -0800

On Monday, 30 November 2015 16:53:13 UTC+2, David Brown wrote:
 
> My guess is that Alf wants to simplify the code that uses these common
> identifiers, but does not want a global "using std" to fill up his
> namespace.
 
You meant 'using namespace std'.
 
> example here he has copied them in directly. Perhaps in his normal code
> he simply writes #include "using_std.h" to bring in a few dozen common
> identifiers.
 
That is unlikely. It was still about declaring names in namespace 'my'.
 
The row of using declarations (that replace less flexible 'typedef' of
C++03) is like "terms and abbreviations" at start of document.
 
IOW that:
 
namespace my {
using std::bitset;
}
 
It means that 'bitset' in context of 'my' means 'std::bitset'.
Or that:
 
namespace my {
template<std::size_t N>
using Flags = std::bitset<N>;
}
 
It means that 'Flags' in namespace 'my' means 'std::bitset'.
 
Such aliasing perhaps gives diminishing returns on case of 'std::bitset'
but can make usage of types with long names (like
std::chrono::high_resolution_clock) or very flexibly configurable
templates (like 'boost::multi_index_container' or
'boost::adjacency_matrix') notably more readable.
 
However once we use aliasing to some names from other scopes then it
can be considered cleaner and more uniform to alias every "foreign"
name used.
Juha Nieminen <nospam@thanks.invalid>: Nov 30 06:56PM

> members of the community. It's a good place to try
> things out that might be interesting but not fully
> baked, and might not have a place in production code.
 
My objection was not to his program or his contribution.
My objection was to his needless abuse of 'using'.
 
--- news://freenews.netfront.net/ - complaints: news@netfront.net ---
woodbrian77@gmail.com: Nov 30 09:55AM -0800

> I hope you will consider becoming an early adopter
> of this approach. There are still some tier-1
> user IDs available.
 
I'm happy to say there are fewer of these tier-1 accounts
available today than when I started this thread. I believe
these top tier account numbers will be like Boardwalk and
Park Place in the future. This is your chance to get in
on the ground floor.
 
Brian
Ebenezer Enterprises - So far G-d has helped us.
http://webEbenezer.net
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.

Sunday, November 29, 2015

Digest for comp.lang.c++@googlegroups.com - 9 updates in 2 topics

MikeCopeland <mrc2323@cox.net>: Nov 29 01:27PM -0700

Is there a way to initialize a non-contiguous number of bits in a
std::bitset (other than with a string of 0 or 1 bits with those desired
bits as 1)? That is, I have a declration of:
std::bitset<100> myBits;
and I want to set the following bits:
7, 9, 43, 47, 51-59, 66, 67
I can, of course, construct a string constant of these bits, but it's
tedious to code and completely lacking in good documentation...
Is there an easy way to do so in source code? TIA
 
 
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
BartC <bc@freeuk.com>: Nov 29 09:19PM

On 29/11/2015 20:27, MikeCopeland wrote:
> I can, of course, construct a string constant of these bits, but it's
> tedious to code and completely lacking in good documentation...
> Is there an easy way to do so in source code? TIA
 
I just saw this post by chance and know nothing of the capabilities of C++.
 
But your requirement reminds me of the Pascal way to do the same:
 
var myBits: set of 1..100;
 
myBits := [7, 9, 43, 47, 51..59, 66, 67];
 
So exactly as you've denoted except for using .. for the range (I assume
you don't mean -8).
 
This can serve as a target anyway.
 
--
Bartc
Paavo Helde <myfirstname@osa.pri.ee>: Nov 29 04:07PM -0600

MikeCopeland <mrc2323@cox.net> wrote in news:MPG.30c50d893dd76c039896b7
> and I want to set the following bits:
> 7, 9, 43, 47, 51-59, 66, 67
> I can, of course, construct a string constant of these bits, but
it's
> tedious to code and completely lacking in good documentation...
> Is there an easy way to do so in source code? TIA
 
Not quite one line, but close (C++11):
 
#include <iostream>
#include <bitset>
 
int main() {
std::bitset<100> mybitset;
for (auto bit:
{7, 9, 43, 47, 51, 52, 53, 54, 55, 56, 57, 58, 59, 66, 67})
{
mybitset.set(bit);
}

std::cout << mybitset.to_string() << "\n";
}
 
or more fancy & verbose:
 
#include <iostream>
#include <numeric>
#include <bitset>
#include <iterator>
 
int main() {
using b100 = std::bitset<100>;
 
const int bits[] =
{7, 9, 43, 47, 51, 52, 53, 54, 55, 56, 57, 58, 59, 66, 67};
 
b100 mybitset =
std::accumulate(std::begin(bits), std::end(bits), b100(),
[](b100 bset, int bit) {bset.set(bit); return bset; });
 
std::cout << mybitset.to_string() << "\n";
}
Geoff <geoff@invalid.invalid>: Nov 29 03:31PM -0800

On Sun, 29 Nov 2015 13:27:11 -0700, MikeCopeland <mrc2323@cox.net>
wrote:
 
> I can, of course, construct a string constant of these bits, but it's
>tedious to code and completely lacking in good documentation...
> Is there an easy way to do so in source code? TIA
 
I don't see a way to express the range 51-59 but here's my solution:
 
#include <iostream>
#include <bitset>
 
int main (void)
{
std::bitset<100> myBits;
const int mySets[] =
{7, 9, 43, 47, 51, 52, 53, 54, 55, 56, 57, 58, 59, 66, 67};
 
for (int i = 0; i < sizeof(mySets)/sizeof(int); i++)
myBits.set(mySets[i]);
 
std::cout << "Bits ";
for (size_t i = 0; i < myBits.size(); i++) {
if (myBits.test(i)) {
std::cout << i << " ";
}
}
std::cout << "are set." << std::endl;
}
Lynn McGuire <lmc@winsim.com>: Nov 29 01:42PM -0600

On 8/19/2015 3:46 AM, Juha Nieminen wrote:
> moderately successful, the vast majority of them have been forgotten.
> But they are still better than C++, dammit!
 
> --- news://freenews.netfront.net/ - complaints: news@netfront.net ---
 
C was the first computer language to successfully change from line
oriented (Fortran, Cobol, etc) to byte oriented. And, then C++ jumped
from pure procedural to object oriented. All in all, good enough. And
the high speed of the resultant programs is a big plus.
 
Lynn
Bo Persson <bop@gmb.dk>: Nov 29 11:14PM +0100

On 2015-11-29 20:42, Lynn McGuire wrote:
> oriented (Fortran, Cobol, etc) to byte oriented. And, then C++ jumped
> from pure procedural to object oriented. All in all, good enough. And
> the high speed of the resultant programs is a big plus.
 
No, it wasn't.
 
C++ is inspired by the classes of Simula 67, which is an extension of
Algol 60.
 
 
Bo Persson
Lynn McGuire <lmc@winsim.com>: Nov 29 04:22PM -0600

On 11/29/2015 4:14 PM, Bo Persson wrote:
 
> C++ is inspired by the classes of Simula 67, which is an extension of
> Algol 60.
 
> Bo Persson
 
Sorry, Algol was not a successful computer language.
 
Lynn
Robert Wessel <robertwessel2@yahoo.com>: Nov 29 04:32PM -0600

On Sun, 29 Nov 2015 16:22:39 -0600, Lynn McGuire <lmc@winsim.com>
wrote:
 
>> Algol 60.
 
>> Bo Persson
 
>Sorry, Algol was not a successful computer language.
 
 
Sure it was. Just not in the US.
Lynn McGuire <lmc@winsim.com>: Nov 29 05:00PM -0600

On 11/29/2015 4:32 PM, Robert Wessel wrote:
 
>>> Bo Persson
 
>> Sorry, Algol was not a successful computer language.
 
> Sure it was. Just not in the US.
 
I don't even regard Pascal as a successful language and I wrote software
in Turbo Pascal for half a decade.
 
Lynn
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.

Digest for comp.programming.threads@googlegroups.com - 5 updates in 4 topics

prashantdb.611@gmail.com: Nov 28 03:26PM -0800


> u guyz r rude. serouslee, the brew Ian axed a str8t up qestion.
> shur, he haz limited bakground knowledge but that doesn't meen you should tear into hymn about the complexity of your work. OK, you're a programmer, we're past that... Now answer our god dam qestions about compooters without being a snoody.
> "Given how poorly your question is asked"... get over yourshelf
 
I also agree with you ..............As if question is not an abuse , then question itself justifying ,,,,that ....why i am in dictionary ????????????
Ramine <ramine@1.1>: Nov 28 01:10PM -0800

Hello,
 
You can run my Scalable Parallel implementation of Conjugate Gradient
Linear System solver library that is NUMA-aware and cache-aware version
1.2 on the following multicores NUMA architecture, for example on the
following 16-socket system with many NUMA nodes, read the following from HP:
 
http://www8.hp.com/h20195/v2/GetPDF.aspx%2F4AA5-1507ENW.pdf
 
You can download my new Scalable Parallel implementation of Conjugate
Gradient Linear System solver library version 1.2 from:
 
https://sites.google.com/site/aminer68/scalable-parallel-implementation-of-conjugate-gradient-linear-system-solver-library-that-is-numa-aware-and-cache-aware
 
 
Thank you,
Amine Moulay Ramdane.
bleachbot <bleachbot@httrack.com>: Nov 28 03:40PM +0100

bleachbot <bleachbot@httrack.com>: Nov 28 07:07PM +0100

Ramine <ramine@1.1>: Nov 28 09:42AM -0800

Hello,
 
 
I have updated my Scalable Parallel implementation of Conjugate Gradient
Linear System solver library that is NUMA-aware and cache-aware to
version 1.2, in the previous version, the FIFO queues
of the Threadpools that i was using was not Allocated in different NUMA
nodes, i have enhanced it and now each FIFO queue of a Threadpool is
allocated in different NUMA node, and the rest of my algorithm is
NUMA-aware and cache aware, so now all my algorithm has become fully
NUMA-aware and cache-aware, so it is now scalable on multicores and
on NUMA architectures of the x86 architecture.
 
You can download my new Scalable Parallel implementation of Conjugate
Gradient Linear System solver library version 1.2 from:
 
https://sites.google.com/site/aminer68/scalable-parallel-implementation-of-conjugate-gradient-linear-system-solver-library-that-is-numa-aware-and-cache-aware
 
 
Thank you,
Amine Moulay Ramdane.
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.programming.threads+unsubscribe@googlegroups.com.

Saturday, November 28, 2015

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

bleachbot <bleachbot@httrack.com>: Nov 28 03:56PM +0100

bleachbot <bleachbot@httrack.com>: Nov 28 07:13PM +0100

Ramine <ramine@1.1>: Nov 28 01:16PM -0800

Hello....
 
You can run my Scalable Parallel implementation of Conjugate Gradient
Linear System solver library that is NUMA-aware and cache-aware version
1.2 on the following multicores NUMA architecture, for example on the
following 16-socket system with many NUMA nodes, read the following from HP:
 
http://www8.hp.com/h20195/v2/GetPDF.aspx%2F4AA5-1507ENW.pdf
 
You can download my new Scalable Parallel implementation of Conjugate
Gradient Linear System solver library version 1.2 from:
 
https://sites.google.com/site/aminer68/scalable-parallel-implementation-of-conjugate-gradient-linear-system-solver-library-that-is-numa-aware-and-cache-aware
 
 
Thank you,
Amine Moulay Ramdane
Ramine <ramine@1.1>: Nov 28 09:58AM -0800

Hello.....
 
 
I have updated my Scalable Parallel implementation of Conjugate Gradient
Linear System solver library that is NUMA-aware and cache-aware to
version 1.2, in the previous version, the FIFO queues
of the Threadpools that i was using was not Allocated in different NUMA
nodes, i have enhanced it and now each FIFO queue of each Threadpool is
allocated in different NUMA node, and the rest of my algorithm is
NUMA-aware and cache aware, so now all my algorithm has become fully
NUMA-aware and cache-aware, so it is now scalable on multicores and
on NUMA architectures of the x86 architecture.
 
You can download my new Scalable Parallel implementation of Conjugate
Gradient Linear System solver library version 1.2 from:
 
https://sites.google.com/site/aminer68/scalable-parallel-implementation-of-conjugate-gradient-linear-system-solver-library-that-is-numa-aware-and-cache-aware
 
 
Feel free to port it to C++ and to other programming languages...
 
Thank you,
Amine Moulay Ramdane.
"Öö Tiib" <ootiib@hot.ee>: Nov 27 06:14PM -0800

On Friday, 27 November 2015 18:41:29 UTC+2, J. Clarke wrote:
> > need to resort to low-level trickery to achieve this speed.
 
> Do qsort and std::sort() implement the same algorithm? If not then you
> are not comparing languages, you are comparing libraries.
 
The exact algorithm is not required for either but it is often
single-threaded quick sort with a fallback to heap sort in recent years.
 
The speed difference typically stays about same when amount of sorted
data grows. It is not about algorithms used but micro-optimizations
made by compiler. Since 'std::sort' is template it is simpler to
optimize for compiler.
 
When the performance matters seriously then both C and C++ developers
can implement a sort that does best match with nature of sortable
data and situation under hand. There is quite large pile of sorting
algorithms invented and some are more parallelizable than others.
When the performance does not matter much then it is irrelevant
non-issue anyway.
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Nov 28 04:53AM +0100

On 11/28/2015 3:14 AM, Öö Tiib wrote:
> algorithms invented and some are more parallelizable than others.
> When the performance does not matter much then it is irrelevant
> non-issue anyway.
 
This is an interesting exercise. With 4 cores available, when is it
faster to partition the sort into 4 threads, each on its own core, and
merge the results? Doing a perhaps too simple math inequality said this
would be faster for anything above a handful of items, but that didn't
include the setup time for the threads. I wonder what actual
measurements would say. I would guess a cross-over point (to more
efficient) for a few hundred items.
 
Cheers,
 
- Alf
"Öö Tiib" <ootiib@hot.ee>: Nov 27 11:37PM -0800

On Saturday, 28 November 2015 05:53:46 UTC+2, Alf P. Steinbach wrote:
> include the setup time for the threads. I wonder what actual
> measurements would say. I would guess a cross-over point (to more
> efficient) for a few hundred items.
 
I am afraid I haven't even tested that, can't find any notes. The logic
is that it is typically about hundreds of thousands of items that we
humans start to perceive like difference in performance.
 
Still something I have. Intel's TBB has 'tbb::parallel_sort' that by
my notes always beats 'std::sort' somewhat even with small sequences
but with hundreds of thousands or more items it is about 3 times faster
on quad core.
 
Note that few hundred of items we have to sort thousands of times
to alter performance. That means we likely have thousands of such
unrelated little chunks to sort. So we sort these little buggers on
different cores. ;)
 
Other thing is that the GPU is worth using for so mundane things
like sorting only when data (or index of it) is already on GPU.
Transporting it there and back cripples the results and sum only
barely beats TBB.
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.

Friday, November 27, 2015

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

"J. Clarke" <j.clarke.873638@gmail.com>: Nov 27 11:44AM -0500

In article <ms0v4a$2qv8$1@adenine.netfront.net>, nospam@thanks.invalid
says...
> quintessential example). And we don't even need some highly-twinkered
> artificial constructed example for this. The code for std::sort() doesn't
> need to resort to low-level trickery to achieve this speed.
 
Do qsort and std::sort() implement the same algorithm? If not then you
are not comparing languages, you are comparing libraries.

Robert Wessel <robertwessel2@yahoo.com>: Nov 27 12:53PM -0600

On Fri, 27 Nov 2015 11:44:11 -0500, "J. Clarke"
>> need to resort to low-level trickery to achieve this speed.
 
>Do qsort and std::sort() implement the same algorithm? If not then you
>are not comparing languages, you are comparing libraries.
 
 
Sometimes they do, and sometimes they don't. The advantage of
std:sort is that the comparison function can be trivially inlined by
the compiler, and the code specialized for the particular array being
compared. So particularly for relatively simple arrays of elements
with modest size and simple comparisons, that's a pretty big win for
std:sort.
 
Now that's not impossible for qsort(), particularly with LTCG, but
I've not seen a standard library that shipped in the intermediate form
needed to make that work, or the code for qsort included in the
header, probably as a "static inline" function. FWIW, I posted the
following earlier this year:
 
 
Rosario19 <Ros@invalid.invalid>: Nov 27 10:15AM +0100

On Thu, 26 Nov 2015 12:20:11 +0100, Rosario19 wrote:
 
>in C if one has one string has "\n"
>the buffer is fhush when it meet "\n"
>if i remember well
 
if i understand well there are case
it is useful sys not flush when meet "\n" ...
if one has to do a pipe or interprocess comunication,
it has to flush only when EOF, or buffer full, or explicit flush
"Öö Tiib" <ootiib@hot.ee>: Nov 26 09:26PM -0800

On Thursday, 26 November 2015 19:09:06 UTC+2, Puppet_Sock wrote:
> > after some years of usage. It is more like an art to know when to reuse the
> > existing and when exactly the wheel needs reinventing.
 
> I'm not talking about reinventing.
 
Forgot to reply to that one. If your program involves lot of linear algebra
and matrices then it seems that currently the winner open source C++
library for that is Eigen3. It uses OpenMP. It uses explicit vectorization
instructions of most popular processors. It is licensed MPL2 that means
with weak copyleft. Eigen is popular and used so you may find people who
are already familiar with it.
1971 powerChina <chinapower1971@gmail.com>: Nov 26 09:04PM -0800

pwwMap has update
http://sourceforge.net/projects/pwwhashmap/files/stats/timeline
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.

Digest for comp.programming.threads@googlegroups.com - 1 update in 1 topic

joyfish8@gmail.com: Nov 26 10:03PM -0800

hi Guido,
 
I encountered the same issue today.
How did you solve this problem at last?
Could you share with us?
 
Regards,
Joyce
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.programming.threads+unsubscribe@googlegroups.com.

Thursday, November 26, 2015

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

JiiPee <no@notvalid.com>: Nov 26 12:03AM

On 25/11/2015 19:41, Luca Risolia wrote:
>> beginning of the run.
 
> Consider using std::clog instead of std::cout. Any output sent to the
> former is immediately flushed (although this is not the only difference).
 
But here I was more like wanting to deside myself when to flush
everything. But it seems like Microsoft flushes when it wants.
Jorgen Grahn <grahn+nntp@snipabacken.se>: Nov 26 12:17AM

On Thu, 2015-11-26, JiiPee wrote:
>> former is immediately flushed (although this is not the only difference).
 
> But here I was more like wanting to deside myself when to flush
> everything. But it seems like Microsoft flushes when it wants.
 
Well, if I look at your original posting, you wanted to print to cout
 
Start...
End
 
but not make it actually print until later, when you flush.
 
It seems to me that if you want something printed later, you have to
print it later. For example, you can't expect cout to keep a gigabyte
of text, waiting for your permission to actually output it. That's
not its job.
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
Rosario19 <Ros@invalid.invalid>: Nov 26 12:20PM +0100

On Tue, 24 Nov 2015 20:09:17 +0000, JiiPee wrote:
 
 
>ok, so cout might or might not flush if I do:
>cout<< "Hello";
>at any time.
 
in my understand when buffer of stdoud is full there is the flush
 
in C if one has one string has "\n"
the buffer is fhush when it meet "\n"
if i remember well
JiiPee <no@notvalid.com>: Nov 26 06:56PM

On 26/11/2015 00:17, Jorgen Grahn wrote:
> of text, waiting for your permission to actually output it. That's
> not its job.
 
> /Jorgen
 
ye sure I could print it later. Not sure why would I want to wait ...
but there might be situations where you want to wait.. not sure...
Just wanted some logic for this
JiiPee <no@notvalid.com>: Nov 26 06:56PM

On 26/11/2015 00:17, Jorgen Grahn wrote:
> Well, if I look at your original posting, you wanted to print to cout
 
> Start...
> End
 
ye sure in that example we want it like that. But am talking generally....
JiiPee <no@notvalid.com>: Nov 26 06:58PM

On 26/11/2015 11:20, Rosario19 wrote:
>> cout<< "Hello";
>> at any time.
> in my understand when buffer of stdoud is full there is the flush
 
But even if I cout only character:
 
cout<< "s";
 
it flushes it straight away.
Vir Campestris <vir.campestris@invalid.invalid>: Nov 26 09:33PM

On 26/11/2015 18:58, JiiPee wrote:
> But even if I cout only character:
 
> cout<< "s";
 
> it flushes it straight away.
 
It can flush whenever it wants. There are ways to force it to flush, but
AFAIK no way to make it hold on to characters you've told it to write.
Why would it?
 
Andy
"Öö Tiib" <ootiib@hot.ee>: Nov 26 01:54PM -0800

On Thursday, 26 November 2015 20:58:32 UTC+2, JiiPee wrote:
 
> But even if I cout only character:
 
> cout<< "s";
 
> it flushes it straight away.
 
Yes, Alf P. Steinbach already wrote that *Visual Studio* flushes *terminal
output* after every character. There are no output buffer/lazy output.
 
You must make it clear to yourself what you want. Then it is easy to see
what to do:
* If you want to wait with output then wait. Do not output.
* If you do not care then just output.
* If you want to be sure that output is complete then flush the buffer (or
with C++ streams use std::endl instead of '\r').
JiiPee <no@notvalid.com>: Nov 26 10:07PM

On 26/11/2015 21:54, Öö Tiib wrote:
> * If you do not care then just output.
> * If you want to be sure that output is complete then flush the buffer (or
> with C++ streams use std::endl instead of '\r').
 
sure, those are the options
Ian Collins <ian-news@hotmail.com>: Nov 26 12:45PM +1300

Richard wrote:
 
> If your team doesn't agree with the values in the agile manifesto,
> then you have a tougher time of it. Sometimes you can transform a
> team from inside, sometimes not.
 
I've had a mixed experience introducing agile into teams. Two
successful, one not for the reasons you cite above.
 
As the old Meatloaf song goes, two out of three ain't bad!
 
--
Ian Collins
woodbrian77@gmail.com: Nov 25 07:46PM -0800

On Monday, November 23, 2015 at 5:47:03 PM UTC-6, Paavo Helde wrote:
 
> IMO, the main issue with large scale projects is that no single person
> has a clear overview what the system does.
 
Sorry, but I have to disagree.
 
"The L-rd looks from heaven;
He sees all the sons of men;
From His dwelling place He looks out
On all the inhabitants of the earth,
He who fashions the hearts of them all,
He who understands all their works." Psalms 33:13-15
 
"For who has known the mind of the L-rd, that he will
instruct Him? But we have the mind of Christ." First Corinthians 2:16
 
"Unless the L-rd builds the house, they labor in vain
that build it." Psalms 127:1
 
"And we know that G-d causes all things to work together
for good to those who love G-d, to those who are called
according to His purpose." Romans 8:28
 
G-d leads us through difficulties. He uses the difficulties
to draw us closer to Him.
 
Brian
Ebenezer Enterprises
http://webEbenezer.net
 
Ian Collins <ian-news@hotmail.com>: Nov 26 04:56PM +1300


>> IMO, the main issue with large scale projects is that no single person
>> has a clear overview what the system does.
 
> Sorry, but I have to disagree.
 
There's a time and a place for proselytising, c.l.c++ isn't it.
 
--
Ian Collins
Bo Persson <bop@gmb.dk>: Nov 26 04:59PM +0100

> according to His purpose." Romans 8:28
 
> G-d leads us through difficulties. He uses the difficulties
> to draw us closer to Him.
 
 
Easy on the sausages.
woodbrian77@gmail.com: Nov 26 08:33AM -0800

On Thursday, November 26, 2015 at 10:00:04 AM UTC-6, Bo Persson wrote:
 
> > G-d leads us through difficulties. He uses the difficulties
> > to draw us closer to Him.
 
> Easy on the sausages.
 
I believe in a different/better way. We should be
able to do more with less. The way that others have
been discussing will do less with more. It has
diminishing returns.
Puppet_Sock <puppet_sock@hotmail.com>: Nov 26 09:08AM -0800

On Wednesday, November 25, 2015 at 6:20:03 PM UTC-5, Paavo Helde wrote:
> to write their own. Sometimes the defects and problems would come out only
> after some years of usage. It is more like an art to know when to reuse the
> existing and when exactly the wheel needs reinventing.
 
I'm not talking about reinventing.
 
One of my big complaints about the existing tools is
that they don't use standard libraries, nor even
commercial code base that is widely available. Standard
stuff like a matrix inversion routine has been done
from scratch. Often three or four different ways in
one code. And sadly often in an obfuscated way such
that verifying it is correct is a total pain.
 
So, for example, one code I have flattened my forhead
on the terminal over has a matrix inversion routine
with a fixed size matrix. So the code can only
analyze one size array. Indeed, it would not be
straightforward to change that size in the source
code and re-compile, because the size appears in
a bunch of places. So when the manager wanted to
explore the consequences of changing the number of
things this matrix represented, I had to tell him no.
At least, not in the budget he suggested.
 
This is FORTRAN from the 1970s in many cases.
It started life when punch cards were the rage.
I've even found Hollerith codes in there. It is
really difficult to use, to understand, to maintain,
and to verify as correct. And moving it to another
platform is an Odyssey level task.
 
I'm quite sure I could do better.
"Öö Tiib" <ootiib@hot.ee>: Nov 26 01:43PM -0800

On Thursday, 26 November 2015 19:09:06 UTC+2, Puppet_Sock wrote:
> from scratch. Often three or four different ways in
> one code. And sadly often in an obfuscated way such
> that verifying it is correct is a total pain.
 
Matrix inversion is controversial topic. Inverting matrices is expensive
and if code-base inverts matrices a lot then things are likely bad with
it. Majority (likely all) of the problems solved with matrix inversion
can be solved with cheaper methods. We can use use a variety of direct
(like LU, QR, SVD or Cholesky decomposition), semi-direct (like conjugate
gradients), or iterative (like multi-grid or over-relaxation) methods.
The methods tend to make solution way cheaper than inverting matrices.
It is possible that there are problems where inverting matrices can
not be avoided or is more optimal but it is hard to find such examples.
 
> and to verify as correct. And moving it to another
> platform is an Odyssey level task.
 
> I'm quite sure I could do better.
 
Yes, what you wrote makes it sound likely that you can do same thing better
even in FORTRAN. ;) The only trouble might be to find a team of people
proficient with both math and C++.
asetofsymbols@gmail.com: Nov 26 08:38AM -0800

) Use the memory allocated by std::vector<POD>::reserve() without
constructing elements by bypassing std::vector's modification functions
(e.g. push_back).
 
Use this newsgroup with caution.
 
/Flibble
-------
For me, as the function variables
Malloc function has to
minimize operation alloc -free as a stack too
 
Example
m=malloc(size)
r=malloc(size)
...
free(r)
free(m)
Minimize free() as 1 operation as
It was in one stack memory operation
 
One can use the debugger for see
Malloc - free alloc
dealloc
always the same
address ... Or the same set of
address
 
I don't know if that minimize
malloc instruction 100% for sure.
But it would be good, if one thinking
on the cpu, and memory already load
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.