« first day (562 days earlier)      last day (4612 days later) » 

21:00
@RMartinhoFernandes I wanted to undelete it. But I only joked about redditing it.
I'm always amused when I can use google translate as a proxy. I can't seem to find the GUID question though
> Dairy cows can produce up to 35 gallons of saliva a day
@R i voted to delete
@MooingDuck Martinho just linked it.
21:01
All 4 legs belong to the COW. If you cut one leg, there is one other leg copied.
xD
> Studies have shown that classical music helps cows produce more milk
@DeadMG he linked the SO link, not the reddit
@MooingDuck ah
@classdaknok_t what’s gold about this is people trying to rationalise the problem
FWIW I agree that this particular edge case in a parser is probably hard to avoid in general and not that important but it’s weird nonetheless, and a sign of bad QA
(QA in PHP? Don’t make me laugh!)
@DeadMG If you're wondering how this all started, it was because one of my posts got reddited yesterday. And them we started talking about getting massively upvoted.
21:04
@KonradRudolph First I wanted to title it "Who was the moron who wrote the lexer?" but then I realized /r/php wasn't Lounge<C++> and that you have to be nice.
Then @CatPlusPlus hinted at getting massively downvoted. And I made a joke about redditing the GUID question...
and here we are...
Nice? On Reddit?!
what is this site you are using?
@KonradRudolph why you protect question?
why you deleting it xD
it made people show how dumb they are, so it's best to delete it
21:07
argh
need piss but flatmate in bathroom
piss on the question
@DeadMG Thanks for letting us know you need piss.
Ell
Ell
do it in your mouth?
Aghh I'm sorry I don't know why I suggested that
that's difficult because he needs strong pressure even at the start
unless he has a good feature set
Ell
Ell
unless he handstands? That is how guys pee right?...
@classdaknok_t he he
> closed as not constructive
No, it should be closed as too localized.
People y u no choose right close reason.
@classdaknok_t reopen and try again
closed as offtopic
21:10
@CheersandhthAlf posted on reddit, stupid-ass question = bound to garner non-answers
it belongs to #math. it'S research area
If it were about C++ it'd belong on /r/wtf.
Everything about C++ belongs on /r/wtf.
Arrrrgh, all my friends top-post. I need new friends.
Ell
Ell
what is top post?
Ugh, I try not to top-post while using Outlook, but it fights SO HARD to make me do it
21:14
@RMartinhoFernandes hey
Xeo
Xeo
@RMartinhoFernandes "I need new friends." - "hey"
What do you call a bird with glasses?

A bird watcher
@RMartinhoFernandes Don't I count as a friend? :(
Why did the elephant cross the road?

Because it was the Chicken's day off.
(Sorry, eating laffy taffy)
Xeo
Xeo
21:15
@DeadMG You count as a pet
Ok, I was referring to friends I know face-to-face.
oic
@RMartinhoFernandes Is that IRL or face-to-face?
People on Omegle are getting dumber and dumber these days. -_- gist.github.com/2562762
Ell
Ell
21:17
wait - you guys have friends? real friends? face to face friends?
@CaptainGiraffe Aren't those the same thing?
Ell
Ell
haha I don't know where the netherlands is. Is it the same as denmark?
@RMartinhoFernandes face-to-face could easily be kissing, as IRL is not necessairly so.
@Ell top post is where you reply to a message above the origional. It's very common with email.
@CaptainGiraffe Oh, the latter then.
21:18
@MooingDuck cool, will definitely have a look at it
Ell
Ell
why is top posting bad? surely it lets you see the message quickly?
@RMartinhoFernandes Sorry to obfuscate a not at all unclear expression.
A: No.
Q: Should I include quotations after my reply?
@Ell Because of this ^
@MooingDuck When did O(1) == O(N) I must have missed that lecture.
I think he means O(1) extra space.
21:20
@CaptainGiraffe O(1) extra space technically. Obviously the data will take space.
Ah, isn't that vanilla quicksort?
@CaptainGiraffe vanilla quicksort puts O(log(n)) stack frames+stuff on the stack
This is purely iterative
of course.
@CaptainGiraffe it also does a MASSIVE amount of comparisons, causing it to be slower overall.
Sorry, I had to add the missing asserts ideone.com/Cjrrf.
21:24
@RMartinhoFernandes I had a similar signature. It ended up in some database FAQ.
@MooingDuck I might read it incorrectly but I cant find any quicksort about it besides the partitioning. Neat algorithm though.
@CaptainGiraffe it picks a pivot, partitions on that pivot, then repeats on the results. Sounds like a quicksort to me.
It's crazy hard to read, I was focused on debugging the fool thing more than comments.
@MooingDuck You're probably right, at a first glance it just felt very unfamiliar.
21:27
@RMartinhoFernandes I can't find any differences easily, what'd you change?
Seriously funny stuff @406. What comes after pico?
@MooingDuck Added two asserts to make sure it worked.
(I'm sure you did test it yourself, obviously)
@RMartinhoFernandes oh heh, didn't see them because my code on my machine had those >.<
I'm not stalking you.
Are you: Mooing and R., hackathoning this quicksort? Any benchmarks yet?
21:30
@Mysticial Not exactly (if it starts causing network issues, yes). But that's not a bad idea...
@CaptainGiraffe I benchmarked. It's 3x slower than std::sort for 10000 elements, and the more elements, the worse the ratio. But I knew it was slow before I started.
std::sort isn't quicksort though.
@MooingDuck not N log N? The idea is still impressive.
@RMartinhoFernandes especially on N < 1000 (oops 10000)
@CaptainGiraffe should be N log N, but measurements imply otherwise.
I'm having trouble understanding it :S Would it be too much to ask for loop invariants?
21:34
@MooingDuck N log N would be a hard requirement for the emulation of quicksort. Any guesstimate of the O?
@CaptainGiraffe it's still a quicksort, it should be O(NlogN)
Ok, so wich ideone should I use to run away with to run O() timings on?
@Mysticial also:
14
Q: Show whether a question was "reddited"

Johannes Schaub - litbI sometimes find a question has like 50000 views and later I find most of those were reddit users that got in rage or glee about something of it. Yesterday there was an answer of a page-one user that upset reddit folks, and within minutes that post were downvoted to -70. It looks like reddit ha...

ok so i googled it. it's even in wikipedia. but no reference to the earlier faqs, or credit to me. but then it was in the faqs that i stole it somewhere, so in a way that's ok.
@Shog9 Ah, thanks for that link.
21:39
Quick question: if I have a smart pointer ptr<T>, should I implement equality comparison for pointer-to-base and pointer-to-subclass, i.e. should ptr<base>() == ptr<derived>() compile, and should it work?
@RMartinhoFernandes The first loop partitions the data into chunks where each chunk is [pivot][unsorted data less than pivot], followed by additional chunks made of the data greater than pivot. Then the sort can get started.
@RMartinhoFernandes Actually, I'll just go in and comment the fool thing
13 mins ago, by R. Martinho Fernandes
"foul"
@Shog9 reddit is a sad bunch when it comes to groupthink.
@CaptainGiraffe true 'nuff, but keep in mind - gotta have an account here (with some nominal rep) to vote.
@Shog9 Yes I did notice Pekkas comment and the response. I still prefer to credit that to groupthink.
21:47
posted on April 30, 2012 by Herb Sutter

I just posted the following panel announcement to the C++ and Beyond site. The three-day event (plus evening-before reception) with me, Scott Meyers, and Andrei Alexandrescu will be held on August 5-8, and early-bird registration is open until May 31.   C++11 is kind of like “C++ Dreamliner.” It’s built with world-class modern materials. It [...]

Did Herb just hack into the SO chat system with a new user 'Feeds' with a promo for his new book? Respect Herb =)
@Mooing Well, it does seem to be sub-quadratic: ideone.com/HUrzs
Now if only I knew how to perform a logarithmic regression or whatchamacallit...
@RMartinhoFernandes Lemme jump on that
I like reddit actually.
I'll be back with the results in a few (pick you favourite unit here)
22:02
@CaptainGiraffe Ninja-years
@DeadMG I'm at the stop at 1 second per measurement, but yes that unit is approved for this experiment.
@RMartinhoFernandes Edited in comments plus your tracer: ideone.com/6trDX
I set it tracing on std::sort as well, as an extra comparison aid: ideone.com/howBM. Seems yours takes about five times more comparisons, but it seems to have the same growth rate.
For 1000000 elements I do about 3x the comparisons, and it's about 3x slower.
@MooingDuck My results say otherwise!
22:08
@RMartinhoFernandes I was amused that you put your tracer in the overload that simply provides a default predicate, instead of passing the tracer from main.
omfg
From the GCC stdlibc++ implementation:
  explicit operator bool() const noexcept
  { return get() == pointer() ? false : true; }
posted on April 30, 2012 by Herb Sutter

I’m seeing many younger programmers picking up C++. The average age at C++ events over the past year has been declining rapidly as the audience sizes grow with more and younger people in addition to the C++ veterans. But this one just beats all [Facebook link added]: A six-year-old child from Bangladesh is hoping to [...]

@KonradRudolph What class is that?
22:09
std::unique_ptr
Oh, pointer() is the null pointer.
@RMartinhoFernandes really, why would you use that?
whoa, I have two starred messages!
Xeo
Xeo
The sentence above is false.
22:12
@RMartinhoFernandes that arguably makes it stupider still – they could’ve just gone with ! get() … but even without that observation the pattern is just brain-dead stupid, and since the guy implementing this class does a lot of clever things I suspect that I may be the brain-dead one
@RMartinhoFernandes: fixed comments: ideone.com/6trDX
@KonradRudolph The standard says the semantics are get() != nullptr. All they had to do was copy that.
or like this
@KonradRudolph return get();?
@MooingDuck Yes
22:16
@KonradRudolph haha, you had me super confused
Actually, I prefer the get() != nullptr variant anyway :p
sbi
sbi
@MooingDuck Would produce a warning with a certain, rather well-used, compiler.
damn it!
sbi
sbi
@KonradRudolph There's nothing we can do. (Groan.)
22:18
ok, fuck this, even they implemented separate versions of the equality comparison operator for a == nullptr and nullptr == a and they didn’t even use friends … I give up.
@KonradRudolph Those separate versions are required.
@RMartinhoFernandes I hate that. So much boilerplate code :(
sbi
sbi
On a side note, I just watched Winter's Bone for the third time. (That film seems to not to get old.) I watched it with my daughter. She's a bit overwhelmed, I think.
I guess they could use Barton-Nackman for that.
@KonradRudolph Boost.Operators!
@RMartinhoFernandes shooting sparrows with cannons.
Also, does this actually help here? This works if both arguments are of identical type
ah yes, it works
member functions
ugh
22:22
Boost.Operators supports both scenarios.
I object to member function operators on ethical grounds ;)
Who said anything about member function operators?
scratch that, I’m gonna use that
I’m getting sick of this problem :p
Barton–Nackman trick is a term coined by the C++ standardization committee (ISO/IEC JTC1/SC22 WG21) to refer to an idiom introduced by John Barton and Lee Nackman as Restricted Template Expansion. The idiom The idiom is characterized by an in-class friend function definition appearing in the base class template component of the Curiously Recurring Template Pattern (CRTP). // A class template to express an equality comparison interface. template class equal_comparable { friend bool operator(T const &a, T const &b) { return a.equal_to(b); } friend bool operator!=(T const &a, T co...
@RMartinhoFernandes I know how Boost.Operators works
22:26
Baaah, 20 rep stolen.
Mod deleted a question from year ago. :<
I WANT MY 20 REP BACK.
ok, I’m really too tired
I don’t think Boost.Operators really work here at all …
This link leads to a page with the words "Some shit ad I made in 5 mins in Microsoft Paint."
that I noticed
it took him a whole five minutes to make that? :P
@DeadMG He's clearly spoiled by Photoshop.
22:32
@RMartinhoFernandes It is extremely close to quadratic.
std::1.3009e-05s inplace0.000190259s 0.000185185
std::2.79072e-05s inplace0.000739645s 0.000740741
std::6.04376e-05s inplace0.00308642s 0.00296296
std::0.000130822s inplace0.0120482s 0.0118519
std::0.000282965s inplace0.0434783s 0.0474074
@CaptainGiraffe Oh, @MooingDuck may want to know about this, then.
The last column is expected O(N²)
@CaptainGiraffe interesting. I made a O(n²) quicksort? Cool.
@MooingDuck Yep, I agree with your assessment that it is cool =) Not so much that it is quicksort =)
Stats save the day.
22:35
@CaptainGiraffe pft, it's the same general algorithm, just needs a few tweaks. :D
I should buy a good book on that.
@RMartinhoFernandes did you see the comments/figure out how it works or did you lose interest?
Is there a The Definitive Stats Book Guide and List post?
@RMartinhoFernandes Knuth is always on the lookout for more proofreaders. And you get a plaque (if you find a fault that is)
I have always wanted to write a book "Maths for programmers"
@MooingDuck Yes, I have some understanding now.
22:38
@CaptainGiraffe those measurements are more precise than my code had O.o
@RMartinhoFernandes neat
But programming new cool stuff has always crept in the way of the progression of the manuscript.
@CaptainGiraffe Concrete Mathematics?
@RMartinhoFernandes Yes exactly
But not shying away from the maths stuff, just making it very apparent and not proof based, but rather code based.
I have that on my Amazon to-buy list. I keep buying other stuff before that :S
Every programmer understands PointD / RectD most programmers does not understand complex numbers.
22:41
source?
I love my TAoP Knuths I read them and try to do exercises as often as I can.
> 1 British pound = 1.22624263 Euros
I guess this is a good time to order from Amazon :)
@StackedCrooked sry anectodal, from me teaching thousands of students.
Rounded it's 1.23. An easy to remember sequence.
@StackedCrooked not like 3.141592653589793238462643383279502884197169399375105....
22:43
Yes, unlike other numbers :D
unrelated: fractional bases for counting get confusing
@CaptainGiraffe Don't tell me it's over 9000?
@StackedCrooked : no i don't think so, no yet. I have only been doing this for about 12 years. And a lot of people insists on coming to multiple classes.
I find it surprising that programmers don't know about complex numbers. It's standard high school math IIRC.
@StackedCrooked Not anymore in Sweden.
22:46
@StackedCrooked maybe there's a difference between "knowing about" and "understanding"
@MooingDuck for sure, I need -understanding.
Depending on the prof's standards he may decide that I do not understand addition.
Well let me tell you another anecdote.
@StackedCrooked Not here.
22:47
It is here.
It's one of the major blunders in the exams.
The concept of a bitmap I find quite simple
with a series of bytes and pixels on screen
Amazon Y U NO SELECT FREE Super Saver Delivery BY DEFAULT?
It is not a trivial concept for 1'st grade students at my university
@RMartinhoFernandes $$$
@RMartinhoFernandes To make more profit by default
22:49
@MooingDuck But they goad me with it!
Does anyone know if C++ has a mechanism to make all derived classes of a given class only instantiatable by a certain function
Luckily I can edit my order.
@SethCarnegie private constructors and a friend function (only kinda)
@SethCarnegie private + friend
Xeo
Xeo
@SethCarnegie You mean by doing something in the baseclass or something?
22:50
@SethCarnegie force drevied classes to only have private constructors?
@Xeo yes
@CaptainGiraffe how do you do that
using constriction and not convention
@SethCarnegie not possible imo.
@StackedCrooked That doesn't prevent anything in the deriveds. Other than having them at all.
@SethCarnegie I don't think it can be. I think derived classes are free to do almost anything, nothing youc an do about it.
Xeo
Xeo
I don't think that's possible, really
22:51
So the situation is that I have complete control over the base class but not over the derived classes, but I need them to only be instantiatable by a certain function because I need to do some work before the most derived destructor is called
So I am wrapping them in another class which will do said work in it's destructor
That's weird.
Xeo
Xeo
Then just do it in an intermediate constructor?
Or in the base class ctor?
but if the user instantiates one of the derived classes without the wrapper class, it'll break
@SethCarnegie Yep you have an unfortunate design
Xeo
Xeo
Wait nevermind, I read that as "constructor"
22:52
@Xeo I need the object to be valid so I can't do that
What is your exact case? The semantics?
Xeo
Xeo
What specifically do you need to do?
@CaptainGiraffe the situation is complicated and it would be hard to explain
@SethCarnegie that's bizzare
@SethCarnegie have you considered redesigning that part?
I think having complete control over the base class, but not over the derived classes amounts to no having control of anything.
22:54
@SethCarnegie Hard to explain and complicated, then I think you just reinforced the idea that you have an unfortunate design in your lap.
Most changes to the base class that have any effect in the derived classes are potentially breaking for the derived classes.
@CaptainGiraffe no, it just requires lots of background
@MooingDuck I can't because I require this library to have certain properties that would be lost and negate a major benefit of the library if I do it another way
@SethCarnegie Some would say (not me, but google people) that is the same as a poor design.
I think you need some form of indirection using composition. Decorator and bridge pattern come to mind.
Do you have the ability to reengineer the design/hierarcy?
22:56
@CaptainGiraffe yes, it's my library
If you end up in twisted situations like this then that's a sign something is wrong.
Well maybe this will help: I am writing a class to manage a resource that can be invalidated spontaneously by some external events, and if it's not invalidated by an external event (that is independent of the class) then it has to be destroyed when the container class is destroyed. So the problem is that I need a user-defined function to be called whenever the managed resource "dies" either by an external event or by the destructor of the manager class.
I can't use virtual functions because they don't work in destructors.
I'd like to link you to a few google code talks. Bear in mind I'm not at all as dogmatic as they are in the talks, it is sound advice though.
And this manager class is extended by being inherited from
@SethCarnegie Make it so that destruction can only go through the manager class.

« first day (562 days earlier)      last day (4612 days later) »