« first day (873 days earlier)      last day (4077 days later) » 

6:00 PM
Alrighty
time to compile my memory stream
 
0
A: remove_if with boost::bind is slow

Tony The LionYou could perhaps solve your problem using a simple functor that you pass to your std::remove_if. This way you don't need to pass any args to it in the remove_if and save yourself a boost::bind struct functor { public: bool operator()(MyData& mydata) { return mydata.IsDone();...

 
new shiny iterator-based template version
 
does this look right?
 
Oh boy....
 
Why is it so hard to find working Twitter client for fuck's sake
How does everyone use this crap
 
6:01 PM
@CatPlusPlus iDevice
Mac OS has twitter builtin...
 
Anyone else I should add/groups I should join while I'm logged in SC2 EU?
 
just sent you an invite to Lounge
 
Sweet :)
 
Guise.
How do I include a file and then have its contents as a string?
Basically what I'm trying to do is:
"
#include <BigAssShader>
"
 
6:03 PM
=[
 
@ThePhD Iseek to end, get position, seek to beginning, allocate string size of file, istream.read.
 
I don't think it can be done.
 
@ThePhD Can't do with PP
 
@ThePhD oh, no
 
Well. That's.... ... shitty.
 
6:05 PM
@ThePhD do it at runtime
 
I'm trying to pack as little data into this thing as possible.
 
@ThePhD or use a perl script to prepend an append ", and to escape internal " characters.
 
Ell
∫12x⁵ -3x³ +4x⁽⅓⁾ dx
Hmm. Does chat have mathjax? :3
 
Alright, let's get myself in EU Bronze League xD
 
I didn't want to stick files into my DLL.
Maybe I could ship arond a little pack though...
 
6:06 PM
i recommend the second because the other two are deprecated. — Johannes Schaub - litb 1 min ago
trolling much?
 
@R.MartinhoFernandes what type should I take if I want to read from range? I am confus.
 
@Ell No
 
Mmm... this is gonna be a bitch to figure out...
 
@TonyTheLion Johannes? Troll? Impossible!....oops, I meant "!impossible". :-)
 
@R.MartinhoFernandes Also, assuming that the real loading function just needs a contiguous memory block, can I make templated Load taking whatever, create that buffer using for example boost::begin and end and then call the "real" function?
 
6:10 PM
@ThePhD No, it's gonna be a virgin. Bitches are easy.
 
q.push(std::forward<std::string>(filename)); is this a way to use std::forward?
1
Q: C++11 thread-safe queue

slavik262A project I'm working on uses multiple threads to do work on a collection of files. Each thread can add files to the list of files to be processed, so I put together (what I thought was) a thread-safe queue. Relevant portions follow: // qMutex is a std::mutex intended to guard the queue // popul...

from here
 
Hmm, compatibility decompositions mess everything up :/. I guess I'll have to implement a modified bubblesort by hand.
 
Ell
Bubblesort? o.O
 
@R.MartinhoFernandes Implement a modified bubblesort by hand? Please tell me you're joking.
 
posted on March 07, 2013 by OfekShilon

Hi. My name is Ofek Shilon and I blog mostly about various VC++ tricks I come by. Today I’d like to explicitly introduce a debugging feature we all use daily but seldom refer to it by name – the native expression evaluator (abbreviated EE below). The Basics Every time you use the Watch window, a lot is going on behind the scenes. Whenever you type a variable name, something needs

 
6:15 PM
@R.MartinhoFernandes why bubble?
 
@JerryCoffin I still dunno if I'm joking or not.
FTR, bubblesort is one of the most common implementations, since these are very-small-sized arrays (1-4) unless crazy stuff.
 
Fuck that ubuntu, it won't let me move its launcher to the right edge -.-
 
Ell
Heh :3
 
@TonyTheLion I think std::forward always makes sense when you take by T&&
 
where's the spirit of "customizable"?
 
Ell
6:16 PM
You can do it somehow
 
The alternative is a bit more complicated, I think.
 
Why can't I just move it to the right -.-
 
@bamboon the becomes why OP takes a T&&, because there's no need for it, as I see
 
@R.MartinhoFernandes Insertion sort will still essentially always win.
 
I need to find the various places where to partition the array, and sort each one.
 
6:17 PM
@TonyTheLion I don't think so, forward really only makes sense in contexts where you don't know the type of T. You wrote std::string, so you should be using std::move.
 
std::forward is not the same as std::move
 
@JerryCoffin Yeah, but bubblesort is an easier starting point (for writing the algorithm, I mean), and can do the whole thing in one pass. Insertion sort can't.
I won't use bubblesort, though.
 
@MooingDuck it's from the question I posted underneath, and also, yea, it doesn't make sense why OP is even using T&& here
 
Ell
but apparently it's officially intended to not be moveable xD
 
@TonyTheLion with T&& I meant a uref T
 
6:19 PM
@Ell Ctrl+Alt+F1 it is then
 
@bamboon uref T?
 
Ell
@BartekBanachewicz Hah that's the spirit
 
@Ell Or go back to Windows.
 
Ell
But srs just hide it then open a terminal? how else will you ctrl-c & ctrl-v without an x server!?
@MartinJames Or go to linux mint
Much more sensible :P
 
6:20 PM
@R.MartinhoFernandes yes right.
 
@Ell I need reasonable support for everything, thank you very much
 
Or maybe don't conflate the distribution with DE
 
I don't know why nobody ever thought of making a black-magic #include.
 
You want to use Unity then suffer
 
Ell
@BartekBanachewicz linux mint is very supported
 
6:21 PM
@Ell my ass.
 
You don't want to use Unity then guess what, stop using Unity
 
Ell
@BartekBanachewicz it's an ubuntu shoot off
 
@BartekBanachewicz Support for what from whom
 
nah, I don't care, just trolling Ell a bit
 
Ell
it's basically ubuntu + proprietary codecs & different desktop :P
 
6:22 PM
@CatPlusPlus I am going to run minicraft on it, so for graphic drivers
 
Hi everybody
 
hi @Chucky
 
You know those are the same everywhere right
 
Been stuck on using find from <algorithm> for about an hour now
 
G'day
 
6:22 PM
3 hours ago, by Lightness Races in Orbit
New to this room? Here's a chilling idea: read this! You won't regret it. Promise.
 
@Chucky What's the problem?
 
I swear I'm bad at computers but you people are worse to the point of being record-breaking bad
 
@CatPlusPlus I want it hassle free, besides, I already have ubuntu running
 
Is there a stable sort in the standard library?
 
@CatPlusPlus :(
 
6:23 PM
That might just work.
 
@R.MartinhoFernandes stable_sort? :P
 
Yeah, testing.
 
okay, I have git, build-essential and vim
 
On this bit of code: std::list<int>::iterator it = std::find(manage_list.begin(), manage_list.end(), 1);

I get an error "no suitable user defined conversion from [type a] and [type b]"
 
use auto it
 
6:24 PM
Then there's probably no suitable user defined conversion from type a to type b
 
classic.
 
Yeah, I think I'd benefit from a struct FileString : public StringBase<...> { };
 
@Chucky what is the type of manage_list including const/volatile?
 
Basically I'm trying to search an stl list, rather than a vector,
 
I'd have to rewrite all the constructors but it'd probably be worth it.
 
6:25 PM
std::list<int> manage_list;
 
No, wait, stable sort does not work.
 
Also don't use std::list
 
There is no order to the whole array :/
 
@R.MartinhoFernandes Haha what
 
There is only order in chunks.
 
6:25 PM
what
 
It can be [0, 0, 0, 8, 0] :(
 
stable_sort chunks then?
 
you fucked something bad
 
@R.MartinhoFernandes I don't find bubble sort any easier than insertion sort, though it it's always done after only one pass, it may be perfectly fine as far as speed/complexity goes.
 
@CatPlusPlus Yeah, but then I need to look for them, which is what I was trying to avoid :(
 
6:26 PM
@Chucky then no, that line of code should not produce the error you mentioned. (IE, you something you told us is wrong.) Write a SSCCE, and then write an SO quetsion.
 
Whoa deja vu
 
@JerryCoffin there's this great sort when you just take maximum and recursively sort the rest; very functional
 
@BartekBanachewicz s/functional/disfunctional/
 
@BartekBanachewicz selection sort variant
 
Ell
@BartekBanachewicz imho linux mint is even less hassle than ubuntu, but like you said you got that running already :)
 
6:27 PM
Oh, @MooingDuck, since you are there, and you are the author of such great buffer_from_file
I am in need of buffer_from_range now :P
 
@BartekBanachewicz I don't recall whatever you're talking about
 
@Chucky Why? (I.e., why are you using a list?)
 
Uh, I should write it myself anyway
 
std::vector<T> buffer(first, last);
 
oho!
yea, just wanted to ask about that one
we cool.
 
6:29 PM
Wait I think I figured it out
 
	std::unique_ptr<Image> Image::_internalLoad(std::vector<unsigned char> const& data);

public:
	template<class Range>
	static std::unique_ptr<CImage> Load (Range range) {
		return _internalLoad(std::vector<unsigned char>(range.begin(), range.end()));
	}
 
my function header was first void Manager::Print() const
but now that I've taken the const out it works. Why is this?
 
@Chucky so the type is not std::list<int> the type was const std::list<int>. Ergo, the return type of find should be std::list<int>::const_iterator.
 
Um... no? I'm definitely looking at std::list<int> manage_list; in the header
 
@Chucky You probably still want the const there (but with it, you need to use a const_iterator instead of an iterator. Most of the time a member named Print is a mistake though -- it should probably be an overload of operator<< instead.
 
6:32 PM
@Chucky is it a member of a class?
 
yeah
 
Then it's const
 
@Chucky is the find function being called in a const member function of that class?
 
Yeah it was but I removed it
So I should put it back?
 
@Chucky so the type is not std::list<int> the type was const std::list<int> in that function.
 
6:33 PM
...ok
Still fairly new to this const stuff
 
@Chucky it can be tricky, especially with iterators :(
 
@Chucky Read this as a starting point.
 
@Chucky easiest to just use auto for iterators
 
9 mins ago, by Bartek Banachewicz
use auto it
 
thx.🍌🍌🍌🍌🍌🍌 — user1131467 1 min ago
 
6:36 PM
@R.MartinhoFernandes You've done well.
 
Okay auto seems a way safer bet
 
Ugh, I hate to write these weird looking loops :(
 
while (🍌)
 
UGH
freeimage_OpenMemory(BYTE* data);
no. fucking. const.
are they kidding me?
 
That and just that is what const_cast is for.
 
6:39 PM
god no.
who knows what kind of scary stuff they are going to do
 
C used to have no const
 
oh.
I am afraid :<
 
            auto l = current.begin();
            auto r = l;
            do {
                while(r != current.end() && ucd::get_combining_class(*r) != 0) ++r;
                if(r - l > 1)
                    std::sort(l, r,
                              [](code_point a, code_point b) {
                                  return ucd::get_combining_class(a) < ucd::get_combining_class(b);
                              });
                l = r++;
            } while(r != current.end());
 
Also if it's not const, then you just don't pass const pointers in
 
6:39 PM
somebody hold my hand while I const_cast that away
 
Segfaults. That shit is too messy.
 
Wow.
 
user142019
@EtiennedeMartel Great.
 
=l
 
@BartekBanachewicz Asking for trouble
 
6:40 PM
It looks good.
 
@EtiennedeMartel looks good
 
@CatPlusPlus sigh copy?
 
0
Q: Bananas in comments?

nneonneoOn this question, I'm seeing bananas in two of the comments: Am I going bananas?

 
> warning C4996: 'std::_Copy_impl': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'
 
@Mysticial lololololol
Lemme answer that.
 
6:41 PM
Goodbye Clutter
(How to hide everything)
-1
A: Bananas in comments?

Bartek BanachewiczThey are invisible for users on non-Apple and non-unicode devices, so guys just use them as invisible separator. Sometimes everything you want to say in a comment is "yes", and because of the limit, you can't, hence the need for a placeholder.

What
 
Then, why a banana? Is it because it's a banana? — Etienne de Martel 7 secs ago
Honestly, @Bartek, I think you missed the point.
 
btw did you know that bananas are radioactive — Cat Plus Plus 22 secs ago
Lol
Cat, helpful as always.
 
thank's for downvotes guys.
 
@BartekBanachewicz No problem.
 
6:48 PM
I upvoted you. :c
 
🐒 + 🍌 = 💕 ! 😄 — nneonneo 14 secs ago
 
I improved it significantly
 
user142019
@Mysticial I only see the smiley. :( (Pun not intended.)
 
@animuson Why not? When someone asks a crappy question, perhaps they need some trolling in comment form. — Etienne de Martel 39 secs ago
Channeling some Tomalak right there.
 
BUT THAT'S WUDE
[meta-tag:💩]
 
6:51 PM
uh, fuck it
 
user142019
tagfail
 
@CatPlusPlus Is gay marriage legal in Poland?
 
it's going down then
 
@EtiennedeMartel Fuck if I know
 
@CatPlusPlus Because if so, I'm coming to marry you.
 
6:51 PM
for(long x=1L; x<=600851475143L;x++) - um... that's gonna take a while... — Mysticial 1 min ago
 
@EtiennedeMartel What? "Yes" is not trolling, it's the answer.
 
@R.MartinhoFernandes I think I'd do something more like this:
template <class T>
struct by_combining_class {
    bool operator()(T a, T b) {
        return ucd::get_combining_class(a) < ucd::getcombining_class(b);
    }
};

auto l = current.begin();
for (auto r = l; r!=current.end(); l=r++) {
    r = std::find_if(r, current.end(),
        [](codepointr x) { return ucd::get_combining_class(x) != 0)});

    std::sort(l, r, by_combining_class());
}
 
@R.MartinhoFernandes The banananananas are the trolling part.
 
user142019
> As of March 2013, eleven countries (Argentina, Belgium, Canada, Denmark, Iceland, Netherlands, Norway, Portugal, Spain, South Africa, Sweden), and several sub-national jurisdictions (parts of Brazil, Mexico, and the United States), allow same-sex couples to marry. — Sauce
 
user142019
@EtiennedeMartel appears not.
 
6:52 PM
@JerryCoffin It's buggy, btw, so replicating the exact behaviour isn't great ;)
 
@DanielFischer: meta.stackoverflow.com/questions/19756/how-do-comments-work It's noise and before anyone says that its just my opinion, every one of those that I have flagged get deleted. — 0A0D 1 min ago
 
@Zoidberg We're part of an exclusive club.
 
NOISE
LOUD NOISES
 
user142019
I don't understand why it wouldn't be allowed.
 
user142019
Prohibiting it is retarded.
 
6:53 PM
Hm. @0A0D had a better sense of humor when he was a regular here.
 
@DanielFischer: Any comment which abuses Unicode characters to get past the minimum length is, by definition, not constructive IMO*. (*Except on Meta, of course) — animuson 28 secs ago
Ahahahahaha
 
@R.MartinhoFernandes I'll leave fixing that part to you -- but (call me conceited) I think my code is at least a better starting point for understanding enough to fix things.
 
Lol
HOW DARE YOU BANANA IN THE COMMENTS
I SHALL FLAG AND SMITE THEE IN ALL MY RIGHTEOUS PURE COMMENTATOR GLORY~~~
 
@JerryCoffin :)
Thanks, anyway.
 
Error 1 error : argument of type "char *" is incompatible with parameter of type "BYTE={unsigned char} *"
bananas
 
6:56 PM
@R.MartinhoFernandes Surely (for whatever it happens to be worth).
 
std::array<std::vector<int>,2> sets = {
        {{0}},
        {{0, 0}}
    }; // error: too many initializers for 'std::array<std::vector<int>, 2ul>'
 
@DanielFischer: meta.stackoverflow.com/questions/19756/how-do-comments-work It's noise and before anyone says that its just my opinion, every one of those that I have flagged get deleted. They are also not constructive. Something like, "Yes, that was fixed in C# 3.0. What do you not understand about the API changes?", is better than "Yes <crap characters>" — 0A0D 5 mins ago
Edited
Jesus they must be one of those people defending minimum length on reports and shit
 
IOW butthurt dweller
 
Maybe "yes, yes, yes!!" is more constructive.
 
6:58 PM
@0A0D To be fair, "Yes, that was fixed in C# 3.0. What do you not understand about the API changes?" is less constructive than "Yes.🍌🍌🍌🍌🍌🍌" because the former is provocative and flame bait. — Mysticial 9 secs ago
 
user142019
@Ell lol
 
user142019
Must have hurt. Oh wait.
 

« first day (873 days earlier)      last day (4077 days later) »