« first day (561 days earlier)      last day (4385 days later) » 

8:00 PM
"Android" and "crap" go well together in one sentence.
 
Is there a stable version of heap sort? Or something I can use in its place?
 
Any other sort?
 
Merge sort?
 
Merge is stable.
 
Bogosort!
 
8:01 PM
And is simpler anyway.
 
@KonradRudolph but there would never be a law suit?
 
You would have to sue whoever is using your work licensed with an invalid licence.
 
sigh... what am I missing here foo(bar& obj){ unique_ptr(obj); } I think I am needing another & which could either be doing via taking a bar&& or passing &obj to the unique_ptr
 
Or vice versa.
@thecoshman Lots of things. What are you trying to do?
 
@thecoshman why are you constructing a unique_ptr and then discarding it? You miss a new statement too. obj isn't a pointer.
 
8:03 PM
@rubenvb Why would you think that? People sue for all kinds of reasons … some lawyers seem to do it just to distinguish themselves in front of their peers, without any gains
 
@classdaknok_t Not stable.
 
@RMartinhoFernandes whenever somebody recommends bogosort it isn't meant seriously anyway. :P
 
I am wanting to create an object (which will be done via a factory class, you know you love them) which I want to be able to pass to this class to take ownership of it
 
@thecoshman do you mean foo(bar& obj){ unique_ptr(new bar(obj)); }?
 
Still not right.
 
8:05 PM
This makes no sense.
 
make_unique<bar>(obj)?
 
@classdaknok_t no, I do not want to create the object in this class
 
function
 
@thecoshman So?
 
@thecoshman then foo(bar&& obj){ make_unique<bar>(std::move(obj)); }?
 
8:06 PM
"I am wanting to create an object"... "I do not want to create the object in this class" Make up your mind!
@classdaknok_t make_unique dammit!
 
@RMartinhoFernandes that's not in the standard library! D:
But you are right, yes. :P
 
(Or at least pass template arguments to unique_ptr, so it compiles).
 
struct bar; struct foo { void take_ownership(bar*&& x) { ptr.reset(x); x = nullptr; } std::unique_ptr<bar> ptr; };
 
@RMartinhoFernandes yeah, create it in a factory class, and then pass it to this other class.
 
foo x; bar *y = new bar; x.take_ownership(std::move(y));
 
8:08 PM
bar*&& x isn't that the same as bar& x?
 
I think it was Luc's idea to force user to use move to make ownership transfer clear.
 
@CatPlusPlus I do like it when code is clear :D
 
And I don't think pure ref is a good idea when it's supposed to be heap thing.
 
@thecoshman no. bar*&& is an rvalue reference to a pointer to a bar, bar& is an lvalue reference to a bar. AFAIK.
Or whatever.
 
8:09 PM
bar& is an lvalue reference to bar.
 
Guys! Please help me with designing the queues with each request , trying to do different stuff, but no success :(

I shall be very thankful for your help! Thank you very much!
0
Q: How to organize queues for each request-handling in new thread?

user1131997I need help with organizing each request-handling for incoming connection in new thread (code is at the bottom of this topic). I don't know at all how to organize manually ( without using boost/threadpool ) queue with handling each request? How should I solve such problem with non-using boost et...

 
@thecoshman Why is the factory a class anyway?
 
(That code above ain't tested, YMMV.)
 
Oh yeah, Mac OS X Lion, you are so helpful!
 
@CatPlusPlus could I do myVec.push_back(uniqie_ptr<bar>(x) instead, so I can build up a collection of them?
 
8:11 PM
I still don't understand what you're trying to do. I hope it's my fault.
 
XY alert.
 
@thecoshman can you give us your real code? Not just the function signature without the return type, and without a return statement and whatnot.
 
I think a proper function signature would be awesome.
 
I intend to pass a 'script' file to work out what objects I need to create, and then this particular element will hold some of them
@CatPlusPlus probably :D
 
Anthony Williams, Penzance, United Kingdom
16.6k 1 22 53
didn't know he was here too
 
8:17 PM
I have uploaded GCC 4.7.0 builds without the fancy winpthreads stuff to make <thread> work.
 
@bamboon Who's that?
 
Cause people reported issues.
 
You build GCC from Cygwin, or cross-compile?
 
@classdaknok_t Author of just::thread the library that served as the basis for std::thread and boost::thread.
 
@classdaknok_t mulitthreading god, author of boost thread
 
8:18 PM
@RMartinhoFernandes @bamboon cool.
 
Also, author of C++ Concurrency in Action, lovely book.
 
@CatPlusPlus cross compile from Arch.
 
That’s a tricky one:
0
Q: Implicit conversion lookup on template fails for out-of-line defined friend function

Konrad RudolphThe following code #include <cassert> #include <cstddef> template <typename T> struct foo { foo(std::nullptr_t) { } //friend bool operator ==(foo lhs, foo rhs) { return true; } template <typename U> friend bool operator ==(foo<U> lhs, foo<U> ...

eh, code in onebox … crappy as ever …
 
fucking markdown
Feel free to fix that for me. I don't seem to understand how
 
8:19 PM
@rubenvb Two messages.
 
@KonradRudolph still fighting with friends?
 
@classdaknok_t I’m keeping my friends close
 
Gah, Java.
 
Java! <3
 
@classdaknok_t o_0 GTFO
 
8:21 PM
Where's the Java?
 
@CatPlusPlus meh, too late.
 
It might be time for a policy limiting the size of oneboxed images.
 
I agree, or a bug report.
 
8:22 PM
Bug request?
 
Typo.
 
That could work on Friday.
 
I do remember a post on meta tagged .
But I guess it's already deleted.
That said, meta is a joke.
 
this is something I am never sure about, if I know that I will never return a negative value, should I return an unsigned type?
 
8:24 PM
No.
 
UNSIGNED IS EVIL!111
It depends on domain of returned value, really.
 
@KonradRudolph could you edit your question again? I think I've found a bug with the "this post has been edited, click here to reload" box.
 
well, it's a size value; you can't have a negative size can you :D
 
@RMartinhoFernandes you got the book now, too?
 
@bamboon Yes.
 
8:26 PM
@classdaknok_t Uhm, I didn’t really edit it, just add the tag
(which, yes, technically is an edit)
 
@thecoshman So? Don't return a negative size!
 
@KonradRudolph same thing. :P
 
should I edit anyway?
ok
 
Do you use a power_of_two int if you have something that can only be a power of two?
 
8:27 PM
@RMartinhoFernandes how far have you read so far?
 
@classdaknok_t edit saved!
 
@KonradRudolph yeah, that would be awesome.
 
@bamboon Not much yet. I plan to pick it up this week or the next.
 
so are unsigned more or less only for when you want to do bit wise trickery
 
Stupid Chrome stop asking me about Acrobat Reader I do not want Acrobat Reader if I wanted Acrobat Reader I would install it myself I never want Acrobat Reader JUST SHUT UP.
4
 
8:29 PM
try opera?
warning: safari sucks in windows
 
@CheersandhthAlf lol, your a funny man
 
Whoop!
0
Q: Code doesn't highlight after pressing "an edit has been made to this post; click to load"

WTP'--I was looking at this question while it got edited, so the "an edit has been made to this post; click to load" button popped up. After I clicked it, it reloaded the question but the syntax highlighting was gone. Not a big issue, reloading the page helped but it might be annoying. I'm using ...

 
@thecoshman Use it when you want them for their behaviour: well-defined overflow, always well-defined bitwise ops, always well-defined shifts of proper sizes, their increased range.
 
@KonradRudolph thanks.
 
@RMartinhoFernandes got ya!
 
8:30 PM
@classdaknok_t Oh yes, I’ve already noticed that
 
Oh God why did I ever post this?
19
Q: Chat shouldn't highlight commas that come after mentions if they are not part of the user's name

WTP'-- The comma should not be highlighted in green, as it's not part of my name. (daknøk is my other account.)

19 ups already -_-
 
> (daknøk is my other account.)
You have two accounts?
That's, well, against the rules.
Suspension-worthy and shit.
 
@RMartinhoFernandes It's only against the rules if he uses them at the same time.
There's some guy who's name I can't remember that creates a new account every time he reaches 10k.
And it was discussed on Meta and deemed okie dokie.
 
@RMartinhoFernandes there are no rules regarding having multiple accounts. As long as you don't fiddle with your own posts from your other accounts it's fine.
12
A: What's the SO policy about having multiple user accounts?

Jeff AtwoodIt is not a problem to have multiple accounts, as long as they aren't voting for each other and doing other sockpuppet-y things. Though it is generally discouraged, as what legitimate reason would you need for multiple accounts? Idle hands are the devil's playground, etc etc. That said, for thi...

 
8:35 PM
@GManNickG What.
 
Dammit, now I slept too much.
 
I think one "legitimate reason" for using an alternate account would be if there is a question you want to ask that you would find particularly embarrassing to have on your "official" accounts records. I never let the two accounts cross each other, so I think that's acceptable use. — AgentConundrum Jan 14 '10 at 16:05
 
@RMartinhoFernandes ok cool, wanna ping me when you are at chapter 5?
 
haha.
@bamboon No problem. I'll try to remember (my memory may be famous around here, but it's not perfect, though).
 
Blasphemy.
 
8:36 PM
@GManNickG he thinks SO has a great replay value.
 
@EtiennedeMartel It was quite a long time ago and now I can't find it.
 
It's almost May!
 
That may be.
 
New Haskell Platform!
 
8:40 PM
What?
 
GHC 7.4 is awesome btw.
 
The Robot not excited about new Haskell feature?
 
Did I mention you can now make type definitions in the interpreter?
 
Robot uses Linux.
 
@StackedCrooked I've been using those same features for a while now.
 
8:41 PM
@StackedCrooked Color me intrigued.
 
On Windows it's safer to use λP.
 
My distro doesn't use the Haskell Platform release schedule, so I get new things as they come.
And sometimes it borks and I'm pissed off, but that's another matter.
 
Ok, that explains.
 
@RMartinhoFernandes Are you on Debian or Arch? I forgot
 
@Pubby Arch.
 
8:43 PM
He said he gets new things as they come.
Not 5 years later.
 
For the curious few want to know what I have been working on, I present HaM (bracing for onslaught of things I did wrong)
 
Debian is very conservative.
 
@thecoshman That sucks!
opens link to check it out
 
Eh, Haskell Platform is flagged out of date
 
8:44 PM
bitbucket logged me out again.
shakes fist
 
@RMartinhoFernandes glad we got that out of the way :P
 
@StackedCrooked You mean it's against abortion?
 
Perhaps.
 
FYI hardly even close to a pre-alpha phase :D
 
@Pubby Haskell Platform was moved to AUR some months ago. The official repos use separate packages for each component.
 
8:45 PM
Initialise all fields in a ctor init list.
 
@RMartinhoFernandes The AUR one is out of date and it has missing dependencies :(
 
@EtiennedeMartel Better analogy would be to say that it's rather unlikely to get pregnant.
 
Also inconsistent indenting.
 
I haven't been able to get Haskell working in a whole month
 
@StackedCrooked Oh, so it's not conservative then.
 
8:46 PM
@EtiennedeMartel :D
 
@Pubby Uninstall haskell-platform and install cabal-install and ghc.
 
Heh, that's what I have but I always forget how to use cabal
 
Lol, this comment was downvoted to -4 until I added the edit.
 
cabal install thing
 
8:47 PM
@thecoshman Why have you written an IntPair class?
 
cabal: There is no package named 'thing'.
 
Haskell related packages from the official repos or AUR use cabal install anyway.
 
help plz
Na, got it to work
 
Something like $ pacman -S haskell-llvm runs $ cabal install llvm somewhere in the process.
 
@EtiennedeMartel opposed to std::pair<int,int> you mean?
 
8:49 PM
@thecoshman Yeah. Or even a tuple.
 
@EtiennedeMartel what does position.first mean?
 
@RMartinhoFernandes You sure? I Don't see cabal in the PKGBUILD
 
where as, position.x
 
@Pubby Well, some do :S
 
@thecoshman Oh. So it's a vector2D then.
 
8:49 PM
@thecoshman why do you pass the IntPairs by reference? Probably a bad question.
 
std::tuple.
If you really want named attributes, there's something in Boost.Fusion.
map, probably.
 
@classdaknok_t where you looking?
 
@thecoshman Element.h
 
For vectors, Eigen::Vector2f eh.
 
void setSize(const Size& value);
 
8:51 PM
I also want to provide functions for comparison and addition of my IntPair
 
Accessing parts of a vector is not very common in client code anyway.
 
@classdaknok_t mostly habit I guess
oh and @cat, when you finishing support for linux :P
 
By the way I'm writing a very basic GUI library. xD
 
    onExitCallbacks.insert(std::make_pair(nextListenerID, callBack));
    return ++nextListenerID;
Bug!
children.push_back(std::unique_ptr<Element>(newElement)); can be children.emplace_back(newElement);.
 
Also, design of an UI library is not easy thing.
Wherever I wouldn't get, I look at it 5 minutes later and thought "gawd, it sucks".
 
8:54 PM
@RMartinhoFernandes by 'can' do you mean 'should'
 
@RMartinhoFernandes Followed by return children.size() . Seems nicer indeed.
 
I'd make it std::list and just return an iterator.
 
Why list?
 
@thecoshman No, just "can" really. It must the code less talky, but has the same effect.
 
I rarely use list.
 
8:56 PM
list is poopy
 
So iterators don't get invalidated by removing other callbacks.
 
Who removes callbacks?
:)
 
list's iterators are rather resilient to modifying the source thing.
That Element getters/setters for size and position are ugly.
You redraw on every frame anyway, you don't have to do anything on move/resize.
 
Seen out of context, it's rather intriguing that this post got so many upvotes.
 
It's reddit.
 
8:59 PM
@RMartinhoFernandes so where is this bug you speak off?
 
So no, it's not.
 
@CatPlusPlus yeah, I just idly stuck them in. not sure if they will stay or not
 

« first day (561 days earlier)      last day (4385 days later) »