« first day (660 days earlier)      last day (4288 days later) » 

1:01 PM
that good?
 
@FredOverflow dude, that book is almost a steal. 30€ + eBook
 
I know, but I can't use the content yet, so I'd rather wait for the 2nd print with the first wave of errata fixed.
 
Is it in bad form to say hello here? :-)
good fucking god. I must really be a prick.
 
@FredOverflow Also, the weakness of the Standard concurrency mechanisms compared to the offerings of TBB/PPL makes learning the Standard facilities a potentially unattractive prospect.
 
@Chimera You should just bring up an interesting topic. We have heard "hello" a thousand times before ;)
@DeadMG Right. I really want stuff like asynchronous blocking queues. TBB/PPL have that, right?
 
1:07 PM
@FredOverflow They are lockless, I think.
but yes, they have asynchronous queues- multiple producer and consumer, IIRC.
 
awesome, prod/con is exactly what I'm excited about.
 
in addition, concurrent vector, unordered map, and unordered set
 
@FredOverflow Oh ok... I do out of habit, seems like the thing to do when you start talking to a group of people.
 
probably and a couple others by now
also parallel algorithms, task-based parallelism, and actor models.
 
@Chimera The lounge is a bit unusual in that respect.
 
1:09 PM
I'd like to see C++ have the concurrency classes similiar to what C# has.
@FredOverflow Guess so.
 
@Chimera It does.
 
Xeo
3
Q: Which smart pointer should I use?

BazI'm woring against a model which consists of a number of different types (Properties, Parent, Child, etc). Each type is associated with a set of functions from a c api. For example: Type "Properties": char* getName(PropertiesHandle); char* getDescription(PropertiesHandle); Type "Parent" P...

 
It does?
 
Xeo
So much bad advise...
 
the .NET TPL and the C++ PPL are basically the same library.
they're even jointly designed, IIRC.
 
1:11 PM
Hi, I am slightly modifying my question now. Given a bi-partite graph, disconnected graph, color it maximizing the colored nodes of 1 type and minimizing the nodes of the other color. Is there a known algorithm.
 
Is that part of C++11 that isn't fully available?
 
@Chimera What? No, it's an MS-specific lib.
 
Xeo
@Chimera the PPL isn't part of the standard.
 
just as all the decent concurrency support in C# is.
 
@jalf The greedy approach doesn't work. I found a wrong test for it. :(
 
Xeo
1:11 PM
However, we have std::future and std::async, hooray... :D
 
although Intel also offer a mostly equivalent TBB
 
Can you get PPL for multi-platforms?
 
TBB is that, give or take
 
Oh cool. I will consult the google.
@DeadMG thanks :-)
 
haha
saw a typo on a job advert
"Agile SCUM"
 
Xeo
1:16 PM
lol
 
If I see this correctly, your only argument against unique_ptr is that Google Mock can’t work with them. This is a bad argument. A testing framework shouldn’t proscribe fundamental aspects of your design (granted, mocking always does this to some extent). — Konrad Rudolph 7 secs ago
2
 
What is Google Mock?
For what it's worth, "mock" is a German word for "stench" :)
 
@FredOverflow sure? I’ve never heard that
regional at most
 
Mokke in dutch means pretty girl. Mok means cup (as in coffee cup).
 
Google Mock is a mock testing framework
 
1:30 PM
@KonradRudolph Have you never seen Voll Assi Toni? ;)
 
@FredOverflow Never heard of that
 
> Und dann gehst du unter die Dusche, da kommt dir ein Mock hoch alter, uähhh, da kriegste voll de Brechreiz HUÄÄHH
 
@FredOverflow don't you mix it with "muff"?
 
^ what he said
 
What he said?
 
1:35 PM
Google Mock is what we do to Google Style Guide
 
Google style guide is that document that says "Don't use exceptions", right?
 
Among other things, yes.
 
@CatPlusPlus I keep wanting to see that as an equation that Google can be removed from.
By dividing both sides by Google.
 
-5
Q: How to find elements that are present in array A but not in array B?

somSuppose I have two arrays A and B initialized as : A ={1,2,3,4,6,7} B= {2,3,7,5,8} Then the output should be { 1,4 }

 
Google isn't a term on its own here.
 
1:41 PM
Indeed. I can't eliminate Google.
 
We need Homework Overflow, where all questions are automatically set to -99 and closed as too localised.
2
 
I would serve as a place to migrate homework questions to.
 
lol
i just wonder how many more downvotes he will get
 
If I understand correctly the return type of std::chrono::high_resolution_clock::now() depends on the implementation. So that means it can only be captured using auto or decltype, right?
Wait, I'm wrong. The return type is known. It's time_point<high_resolution_clock>. Let me test. Ok it workds.
 
You should use auto anyway.
3
 
1:48 PM
Yeah.
 
Also use member types.
high_resolution_clock::time_point
Or something like that.
 
puppy :)
 
good looking puppy
 
thats the kitten
 
1:57 PM
@closevoters: as you could see at the time you voted, this question has a single, correct answer. in other words, what you were saying with your votes, was already refuted by the information available to you when you voted. please do comment and explain why you still chose to vote in an opinion that at that time you had to know was in direct conflict with reality? — Cheers and hth. - Alf 1 min ago
^ Two of the silly-voters were from this Lounge: @ruben and @catplusplus.
 
which thread?
 
just click on the "1 min ago"
 
ahh, I clicked on the name before xD
thx
 
What kind of data structure is easy to implement in gc languages but troublesome if you have to manage the mem yourself?
 
@FredOverflow the "mock" is short for "mockup".
 
2:07 PM
@Nils Practically all persistent immutable data structures.
 
anyone? this is more c++ related that the pics above
 
@Nils self-referential mathematical expressions.
 
Anything with circular references.
 
@FredOverflow Persistent immutable? If it is immutable I do not have to care how to persist it, right?
@Cheersandhth.-Alf humm like?
@ecatmur one point for the candidate :D
 
@Nils Persistence has nothing to do with storing it on a hard drive, in this case :)
 
2:09 PM
@FredOverflow could you explain a bit further..?
 
"It's not just you! en.wikipedia.org looks down from here. "
 
"persistent" in the context of immutable collections means a) you share state and b) a particular collection's performance does not degrade over time.
 
@Nils i don't remember, sorry. i just remember that example being used by a functional language fan-boy. in response somebody linked to a proposal for boost which would make it possible to collect the memory via shared_ptr like thing, but i don't remember that either... :-(
 
There are mutable Haskell arrays that get slower and slower the longer you hold on to them. Those are not persistent.
 
@ecatmur Didn't have to use one so far.. but you could just use a strong reference from outside to the circ structure and weak references inside, right?
 
2:11 PM
@Cheersandhth.-Alf Hm?
 
@Cheersandhth.-Alf ok..
 
Ah, close votes.
It's a terrible, useless question.
 
@CatPlusPlus well that's an opinion. for one, I don't think so. certainly those who have voted to re-open don't think so.
 
@FredOverflow still not getting it how should an immutable collection's performance degrade over time?
 
Well that's an opinion expressed as a close vote.
And I don't really care.
It's a question from yesterday, why would I care.
 
2:14 PM
@Nils That's simple. You have a reference a to an array, then you say b = a.with(index, newValue). Now b is an array that has the new value at that index, whereas a still has the old value, but there is only one physical array in memory; there is some bookkeeping data added to a to make it remember the old value at the index. So a gets slower and slower each time the array is updated.
 
Because close-voting stops free information interchange. I.e. it stops learning. So it is fundamentally ungood, an evil that should only be used to stop more evil evil, so to speak.
 
When I pop a stack element from a queue does it call its destructor ?
 
@NeelBasu yes.
 
yes
 
@NeelBasu Is it a stack of T or a stack T*? Note that the destructor of a T* does nothing.
 
2:15 PM
no stack of T
 
There wouldn't be much point in having a destructor if you can't rely on it being called
 
@Nils Rich Hickey explains it nicely here IIRC.
 
but How ? because poping is just unlinking the element from a node
 
@NeelBasu no
 
So?
 
2:16 PM
If you really think the question is terrible and useless, why not just downvote it and add a comment explaining how it is useless. Which is communication. As opposed to stopping communication.
 
@FredOverflow intersting :)
 
unlinking is not same as object going out of scope
so how it calls the dtor ?
 
@NeelBasu popping is "removing the object from the queue and destroying it
 
@FredOverflow looks like clojure is this years in programming lang, maybe I need to have a look at it..
 
@NeelBasu std::stack probably has code that calls the destructor explicitly.
 
2:17 PM
I also backed LightTable.
 
@NeelBasu the exact details depend on the implementation, but it probably just calls the destructor explicitly
 
@FredOverflow It calls the destructor explicitly ?
 
yes
 
It'd be nice for std::queue::pop to return an rvalue reference... would that be feasible?
 
but calling the destructor explicitely doesn't dealloc an object from memory
ami I wrong ?
 
2:19 PM
@NeelBasu So? The queue is responsible for making sure that everything that needs to be done gets done
 
@FredOverflow b = myArray.with(index, newValue) in which lang can you do this?
 
Haskell.
 
@NeelBasu That is correct. But it doesn't matter. The pop function can do as much as it likes to ensure the correct behavior
 
Ah I'm not familiar with Haskell
 
@Nils (the avatar is a hint.)
 
2:20 PM
ic
 
yes but if its a circuler queue and it pops automatically. and elements are being inserted at a very high rate will soon get a big memory leak ?
 
@Nils That was pseudo-code, I don't know the Haskell syntax off the top of my head.
 
T &&pop_top() {
    T t{std::move(top())};
    pop();
    return std::move(t);
}
would that work?
 
@NeelBasu why would it be a circular queue? Why would it pop automatically? Why would it leak memory?
Assuming we are talking about std::queue, then it behaves exactly like the C++ standard says it should behave. It doesn't say "you are allowed to implement it as a circular queue which leaks memory"
so if you implement it as a circular queue which leaks memory, you're doing it wrong.
 
@Nils let b = a // [(index, newValue)] seems to be the actual syntax, but what matters is the semantics, not the syntax.
 
2:23 PM
@jalf because here I've a boost::circular_queue where I store boost::shared_ptr
 
@NeelBasu So you have a circular queue. Why would it leak memory?
 
So my fear is. is that leakingmemory ?
 
@ecatmur I normally do not write in capital letters, but PLEASE DO NOT RETURN RVALUE REFERENCES.
 
You seem to be dreaming up completely random things. Why should it leak memory? Should we also fear that it might launch the nuclear missiles?
 
@FredOverflow oops :)
 
2:24 PM
too many lambda derived gravatars! It's an infestation
 
no no. its being deposited from one thread
 
A class which leaks memory is broken. Boost doesn't usually design broken code
 
and poped from another thread
 
@jalf :)
 
@NeelBasu with no synchronization?
 
2:25 PM
> Rvalue references are still references, and as always, you should never return a reference to an automatic object; the caller would end up with a dangling reference if you tricked the compiler into accepting your code [...] Moving is exclusively performed by the move constructor, not by std::move, and not by merely binding an rvalue to an rvalue reference.
 
Try reading the documentation. Does it say that using pushing and popping from different threads simultaneously is safe?
 
Producer is producing in circular_queue and consumer is pop'ing. and I want some element to be lost. If consumer takes more time consuming
 
So you want a blocking queue?
 
ah, std::move is OK because it's returning a reference to its argument. Yeah.
 
2:26 PM
hm, it seems I have a serial upvoter on my heels
 
user1182183
any (free) volunteers who want to make a dead game alive? ; p
 
I guess I just rely on RVO.
 
@jalf and yes it is syncronized but producer produces at a higher rate than consumer can consume. and I allow some elements to be lost from the queue. so that the consumer always get the updated one.
 
it trickles in random upvotes just at a slow enough rate to not be caught by the bots, I think
 
@ecatmur Note that std::move does not actually move, it just casts an expression to rvalue.
 
2:27 PM
@StackedCrooked I don't. Radek might :)
 
@NeelBasu so read the documentation. It describes what the class does
 
T pop_top() {
    T t{std::move(top())};
    pop();
    return t;
}
perfectly good candidate for NRVO.
 
This could throw an exception, thus the STL doesn't provide it.
 
@jalf I've mutex gaurded the deposit and withdraw operations in the storage object holding the circular_buffer
> The circular_buffer implements assignment
Oh! I see
So assignment on shared_ptr calls the reset() . right ?
 
@NeelBasu You new around here? Welcome!
 
2:30 PM
Ya new in chat
thanks
> There was a discussion what exactly "overwriting of an element" means during the formal review. It may be either a destruction of the original element and a consequent inplace construction of a new element or it may be an assignment of a new element into an old one. The circular_buffer implements assignment because it is more effective.
 
1
Q: gcc 4.7 about Variadic Templates/ decltype /std::forward

Ѫ 晏 char foo() { std::cout<<"foo()"<<std::endl; return 'c'; } void foo(char &&i) { std::cout<<"foo(char &&i)"<<std::endl; } struct pipe {}; template<class OP> struct Flow; te...

This need edit help. Badly.
 
If so the while making place for new element and replacing old. it has to move elements by doing assignments in a chain on ll n elements
 
World rejoice: (/cc @R.MartinhoFernandes)
> It appears that finally, a decade after .NET 1.0 has been release[d], 3 interfaces IReadOnlyCollection<T>, IReadOnlyList<T>, IReadOnlyDictionary<T> will be presented by the .NET v4.5
> As commonly said, it is never too late to do things right, but in the case of an API with ascendant compatibility used by millions of developers world-wide, this proverb doesn’t fit that well.
 
@FredOverflow ah, thanks.
 
2:35 PM
2
Q: Add a personal "Bookmarks" section for quick reference

Wesley MurchThis is something I've been eager to have for a long time, and I realize it's not a trivial request. I propose adding a section to each Stack Exchange site for your own personal bookmarks. This would be useful for quick access to things like: Links to specific answers, comments, or questions f...

Lol "I won't bother using bookmarks, so implement bookmarks again so I can use it".
 
stars are my bookmarks
 
@Nils favourites, is what they are called:
13
A: What are favourites for?

Richard aka cyberkiwiI use them for these purposes: Useful information - I might need it in the future Rare/unique/fabulous code snippet - I might need it in the future (can you actually search among favs? I don't have too many at the mo, so I just scan) to mark ambiguous questions that I may be interested in, so t...

 
3:02 PM
@Cheersandhth.-Alf How is closing that as not constructive "silly"?
But never mind. @cat already made my point.
 
good morning everyone :)
 
Mornin'
 
what is everyone up to? :)
 
I am reading stuff on the internet :o
 
oh man, raining again in Britain
 
3:13 PM
Isn't it raining like two thirds of year in Britain?
 
probably
pfff what a slow day
 
xd
Do something with it.
 
@EtiennedeMartel pretty accurate. But git push -f is handy for semi-starting over.
and cherry-pick is just plain awesomeness.
 
3:22 PM
What should be the class name for a collection of Poem, Story, Song, Drama, 'Novel' etc ..
 
@NeelBasu literary_work
 
@rubenvb it's anti-social, a wrong thing to do, since it reduces the information exhange. also, it's plain wrong that there is anything non-constructive about the question. even given the wooly nature of the term "non-constructive" which makes it fit almost anything and thus favorite of non-technical people. secondly, the cat has only stated that his interest is constrained to the present and future. that's not a point that i would try to associate myself with.
 
1 hour ago, by Cat Plus Plus
It's a terrible, useless question.
The question has no practical, nor theoretical value.
 
"it's a terrible, useless statement"
if you really meant that, then you should downvote the question, and explain your downvote
 
The answer is even incomplete: a freestanding C++ implementation doesn't even require main.
 
3:25 PM
@rubenvb that doesn't mean a collection on which some operation will be done on a bulk
 
given that many other people disagree, you can be sure that reducing people's ability to express contra opinions is unethical
 
@NeelBasu ah, collection. library, obviously :)
 
it's like trying to win an argument by taping the other persons' mouths shut
that's the silly part, by the way
 
There is no argument.
There are opinions, cast in stone.
 
Hmm kind of a collection of these things on them I'll collate
LiteratureCollection ?
 
3:28 PM
@rubenvb that is an unreasonable interpretation. if you had cared to make that comment, i am sure that people would have corrected you. in the same vein, "standard" is assumed, and "complete" is assumed, and "compiling and linking" is assumed, and a certain year, namely 2012, is assumed, and so on. without such assumptions any question admits a multitude of nonsense-pedantic answers.
 
0
Q: UInt throwing Overflow exception--- C#

kushalOn entering negative values in textbox i get an error saying **Overflow exception unhandled** .No is too smal or too large for UInt32" Here is my code : UInt32 n= Convert.ToUInt32(textBox2.Text); if(n>0) //code else //code

what has SO come to???
don't people know their types anymore??
UInt is Unsigned Int... the answer is in the title
 
that said, an answer would have been even better if it had mentioned freestanding implementations.
then we're into Quality Of Answer considerations, not the technical of whether there is an answer
 
I never mentioned "wether there is an answer".
That's not a point of argument.
@NeelBasu if you're in a boring mood, that would do, wouldn't it :P?
 
@rubenvb LOL
@papergay removed his smile
 
@NeelBasu I figured that I was acting to mean xD
 
3:34 PM
@TonyTheLion so vote down. I just did
 
ok
0
Q: using *void as a buffer for static_cast

nahprSo I go this: class A; class B : public A; class C : public B; vector<A*> *vecA; vector<C*> *vecC; And I want to cast a vectC into a vecA. vector<A*> *new = static_cast< vector<A*>* >(vecC); //gives an error So I used void pointer as a buffer and the cast: ...

bad bad bad
please downvote
 
delicious void*
 
why downvote? he did not say that it is a good method, he even asks for other methods
 
Isn't the point of asking a question is to learn that the bad approaches are bad?
3
 
3:44 PM
@TonyTheLion no
 
yea, but it's clear that OP has seemingly never read a decent C++ book
anyways, I had an attempt at answering
despite my downvote
 
@TonyTheLion The dynamic_cast in your answer is unnecessary
 
Terribly unnecessary.
 
Bonsoir ici le France.
 
Salut.
 
3:49 PM
@Cicada Arhem.
 
Hint: try / and % operators. — timrau 25 secs ago
 
Smoooth.
 
Enlève ton commentaire, calisse.
 
0
Q: print part of the int variable in C++

AliI declare some variables int area_code; int telephone_number; when I get the input from user like cout << "Enter the area code"; cin >> area_code; cout << "Enter your local telephone number"; cin >> telephone_number; now when I want to display them if their phone num...

 
@Prætorian not sure I get why it's unnecessary. That because it's derived classes and the cast is implicit?
 
3:51 PM
3 near identical comments
let's spam more of them :P
 
@Mysticial o rly
 
@Cicada Toujours aussi délicate à ce que je vois.
 
Eh oui, caribou !
 
je vois = i see?
 
3:53 PM
Oui.
 
Yay. My french is quite rusty though
 
Comment allez-vous, camarade d'outre-mer ?
Fait-il aussi chaud de par chez vous qu'ici ?
 
@Cicada argh! French typography … full of idiot blanks
 
@TonyTheLion correct
 
jawohl
 
3:56 PM
lol
chaud = warm?
 
@KonradRudolph Je suppose que vous parlez des blancs avant la ponctuation composée monsieur ?
 
@TonyTheLion Exactly, if you were going to other direction the cast would be needed
 
Wow, I understood another 2 sentences :P
 
I managed to get through 4 years of french classes and remember nothing
 
3:57 PM
Je trouve au contraire que cela aère la phrase de façon très agréable et c'est pour ça que les ! et ? de l'anglais me font horreur.
 
@Prætorian ah ok
 
ALSO IDIOT BLANKS THAT'S RACIST
/french pun
 
@melak47 same here
 
@Cicada yup
 
I think it makes the sentences easier to read
 
3:58 PM
@TonyTheLion :)
 
wtf are blancs?
 
@Cicada brainwash and indoctrination. That is all.
 
I don't like the english way of directly putting !, :, ;, ?
Yes it might be
 
(that, and the fact that the French use a lot of italics where it makes sense to space punctuation)
 
Culture has a very strong influence on our perception of things
What do you mean
 
3:58 PM
@Cicada But French does the same for “,” and “.” …!
 
Because they're not compound
 
@Cicada huh? it's not an "English way"
 
whatever
 
@Abyx Relatively to French, of course it is
@KonradRudolph let's argue
lol
 
lol
 
3:59 PM
@Cicada The original reason for the space before punctuation is that if you write italic and have a tall letter (such as “f”) then it gets in the way of the punctuation: fff!
 
@KonradRudolph French does weird things.
 
@Cicada you bored? :P
 

« first day (660 days earlier)      last day (4288 days later) »