« first day (761 days earlier)      last day (4170 days later) » 

12:00 AM
Bask in the glory of someone who wrote some C++ tutorials who actually knew what the fuck he was talking about.
 
Does anyone know what they're talking about?
 
Oh hey DeadMG wrote this
I'll trust that then
 
sarcasm ?
 
No
I definitely think you know what you're talking about, and these tutorials are good
Thanks
 
Ell
12:07 AM
Dafuq. Time definately speeds up when you're tired
 
user1357851
I haaaaate over serious people
 
user1357851
but being not serious enough I am probably not going to succeed
 
Someday I will be serious...
Companies don't like my morbid absurdist sense of humor.
How do I get lucky?
I wanna be a raptor. Can I be a raptor?
 
Guys, quick question. If the "Iterator Invalidation Rules" (23.2.5/8) from the C++0x draft say that for all of unordered_[multi][set|map] all iterators are invalidated when rehashing occurs, but references remain unaffected, am I safe to deduce that the same would then also apply to pointers to said keys/values? (interested in pointers to the hash's/set's keys in particular) (I'm no C++ native, so please excuse my ignorance ;) )
 
8
Q: Can we raise the reputation required to chat, maybe on a per-room basis?

DeadMGAnother day in chat, another day of low rep people endlessly asking questions there, dumping their code, and generally behaving as if we're stackoverflow.com instead of chat.stackoverflow.com. Can we raise the barrier here a bit? It might stem the tides. Edit: Per-room rep control would be fine-...

 
12:16 AM
@Regexident if references are valid, then pointers to values are valid. always. and vice-versa.
 
@MooingDuck: That's what I thought. Thanks.
 
You guys think I'm weird?
 
I haven't observed any weird tendencies out of you yet.
and secondly, I think that being normal is for idiotic fuckfaces.
 
Someday I'll be an idiotic fuckface...
 
that I highly doubt
 
user1357851
12:19 AM
low rep != low tech skills
 
@Crowz many of us are
 
Yeah my rep is 60 and I have zero skills
 
@Telkitty And more importantly, the converse is also true, such as regexident
 
 
Ell
@deadmg why is being normal for idiot fuckfaces?
 
12:23 AM
because every system in our civilization is based on diversity.
 
Like Islam.
 
being "normal" is nothing more than "I care far too much what other people think of me, and I'm going to allow that to blind me to the benefits of not being absolutely identical to other people's perceptions of what I should be like."
 
1
A: Make Vim handle medium-sized text files on windows?

seheMost likely it's the syntax plugin that makes vim halt. I never have any issues with files of Mbs-Gbs. Unless I accidentally open them with some - not-so-well-behaved - filetypes. Press ^C while loading/hanging (interrupting plugins) :syntax off Does the trick. There are other options with sy...

^ large files in Vim. I always yell at Notepad++ and competition when they get slow, but apparently, with the right plugins, Vim can be made slow :)
 
The arbitrary sleep plugin?
 
wait
did somebody mention SLEEP?
 
12:27 AM
As in sleep(n).
 
my incredibly overpowered brain requires rest
 
Don't fall asleep now
that would be a waste of time
@DeadMG Your brain got overpowered by someone? Suprised
 
TIL malloc (and free) are implemented with system calls named mmap and mprotect on Linux.
Experimentation with ptrace can be fun.
 
user1357851
Oh well
 
@StackedCrooked Well, they aren't really. mmap and friends serve to 'get' a block of actual system memory. Then, libc (or your heap implementation) plays some nice linked lists and algorithms on top of those
 
user1357851
12:33 AM
maps on window's phone sux
 
@sehe Ah, I see.
 
user1357851
Pointed to the address and I was late for my important meeting
 
So, mmap and friends are being used by malloc to fulfil requests for more system /pages/. But, you could go for ages without requiring that
 
 
@sehe That explains why my program with 1000 mallocs only did 3 mmap calls..
Mystery solved :D
 
12:34 AM
@StackedCrooked And you may find other strategies with e.g. libtcmalloc or other competing implementations
 
@StackedCrooked You didn't know that mallocs are pooled?
 
I don't know much about low-level details.
 
user1357851
@Crowz this reminds me of gaga's phone call music video
 
@Mysticial That's not really a fair term here. The heap is pooled. Malloc doesn't reserve a full page (4k) for each 16-byte allocation done
 
Bubble Sort to rule them all!
 
12:35 AM
Loves me that O(N^2) run time
 
@sehe Or whatever the correct term is.
 
user1357851
true
 
:-)
 
I like quick sort... don't most API implementations use merge sort?
 
Is bubble sort parallelizable?
 
user1357851
12:36 AM
you can write you own
 
user1357851
everything uses recursion so sux if your pc has little memory
 
@StackedCrooked I don't think so. Merge sort would be, at least partially.
 
Fork Sort is fun also.
 
Insertion Sort is cool, I like insertion sort.
 
Each element would start bubbling on it's own in the list. A thread for each element :D
 
12:37 AM
@Chimera Fork sort is new to me.
 
www.gametrailers.com/side-mission/39008/heres-how-some-lucky-xbox-live-users-got-a-free-xbox-360
Damnit... I started Xbox Live a year after it launched...
 
How do you convert an image to a 2 dimensional array?
 
user1357851
what's fork sort
 
in C++, is there a concept of essentially an RGB 2 dimensional array?
 
12:38 AM
@Crowz It's a 1D array.
 
sure int[][]
 
Ell
It's just a 2d array of pixels
 
typdef std::vector<std::tuple<char, char, char, char>> Image;
 
@CaptainGiraffe It may not be called "Fork Sort". But the idea is you use threads so that each element needing sorted returns based on it's value. So then when all the threads are joined you take the output ( in order ) and you've accomplished a sort.
Something like that.
 
Ell
Boost::multi_array
 
12:40 AM
@Chimera >A threaded merge or a quick?
 
@StackedCrooked Oh cmon, at least make a struct out of it...
 
@Borgleader I will allow you to clean up after me.
 
@StackedCrooked Lazy.... also did you accidentally a word?
 
@Crowz intro sort and modified quick sort, mostly
 
12:41 AM
An array like so:
[(3,38,200), (5,20,18)
(200, 33, 245) (255, 255, 255)]
 
@sehe As we have discovered, intro is very good.
Measurements rule.
 
@CaptainGiraffe Nope... even simpler than that. The sorting is done because each elements thread returns in the sorted order ( based on the value of that element ). For example, sorting 2, 5 1 -> start threads ( 2 returns in 2ms, 5 returns in 5ms etc ). Join the threads, take the output in order... voila! Sorted.
 
Where (R, G, B);
 
@Crowz Pixels with 24-bit alignment?
 
But I think the concept is more of cool, but not practical approach.
 
12:42 AM
@StackedCrooked Not sure. Let's assume so to get the concept
 
@Chimera a.k.a. Sleep sort, then. There's also BogoSort which just does random permutations of the input sequence, until they 'happen to' satisfy the ordering predicate by sheer chance
 
Sounds like a merge to me.
 
user1357851
seriously though
 
@sehe Someone must have been bored
 
@sehe Ah that's the name I was looking for.
 
user1357851
12:43 AM
who uses sort a lot at work?
 
@Crowz Or smart
@Telkitty cough. Who doesn't.
 
Or both.
 
user1357851
@sehe Do you?
 
@Chimera sleep sort?
 
user1357851
I don't
 
12:44 AM
If you use a map, dictionary or whatever, even a directory listing, you'll be using sort.
 
@Telkitty That would be std::sort
 
I keep my files sorted.
Often I use ls -alt to see which files have been recently changed.
 
@Telkitty Regularly. But implicitely, there is little else that software does to 'organize' data for retrieval
 
user1357851
@sehe Have you considered hash?
 
user1357851
does wonders
 
12:45 AM
@Telkitty I love Corned Beef Hash
 
@Telkitty Dude..
 
user1357851
@StackedCrooked ?
 
user1357851
@Chimera Hash brown
 
@Telkitty Oh yeah! Yummy!
Hash Pipe!
 
@Telkitty Of course. I consider it related enough. To be fair, many of the things I list would be hashes by default in C#, which is my day job. That's fairly annoying as hashes need a little bit more facilitating for UDTs
 
12:46 AM
Ah the Labrador from Michigan is back.
 
user1357851
Hash brown function $$
 
@ScottW ohai
 
When you use a matrix operation on a picture, do you do it to each pixel with two for loops or what?
 
Anyways, 62k rep pile (fr), good time to get some sleep sorted!
 
user1357851
@sehe UDT may refer to: Underwater Demolition Team
 
12:47 AM
@Crowz Who is you and what is the context? On an icon: YES. On a larger image: parallelization?
 
user1357851
according to the internet
 
@Telkitty User Defined Type
 
user1357851
Oo I was thinking UTP
 
    ie,
    for(int i=0; i<img.getHeight(); i++) {
       for(int j=0; j<img.getWidth(); j++) {
           ...
       }
    }
 
12:48 AM
@sehe Let me ruin that for you ;)
 
user1357851
thought you were doing some TCP/IP related stuff
 
@Borgleader I notussed. Picked a lame answer as well :)
 
@sehe ADT is the common name for this atrocity
 
@sehe I actually didn't yet....
Wish we could see who upvoted/downvoted
 
@sehe I mean like, let's say I... wanted to make an itunes style gallery. I want to skew every image a certain amount except for the one in the center (selected).
 
12:50 AM
@CaptainGiraffe Disagree. ADT would be for Abstract. You know, when you have ZipCode and Surname types, just to distinguish from other strings. I consider that largely Javaesque so I don't usually call the term (unless I actually use an ADT for a purpose like that)
 
actually downvotes might be problematic...so just upvotes
 
@Crowz Awesome coding skills! ;)
 
@Borgleader Ok, good. So you don't have to anymore :)
 
Yep saves me the trouble
 
user1357851
upvote downvote should be transparent
 
12:52 AM
@sehe No an ADT is a Queue or a Stack or linked list or a heap. Do not try to downplay this
 
user1357851
so we can get people banned for wrongly downvoting ;)
 
@CaptainGiraffe Or else? The whip?
@Telkitty cough
 
The problem is people would start sending each other hate message and downvote people who downvoted them and so on.
 
@sehe Yes the whip-
 
Sexy.
 
user1357851
12:53 AM
@sehe transparency is a good thing ;)
 
You mean like transparent blouses?
 
user1357851
36dd bra inside, sure
 
I have boobs.
 
user1357851
moobs*
 
Nope ;)
 
12:56 AM
@Crowz What the fucking fuck is this...
 
It's something strange.
 
Romney-San
 
user1357851
I think if I post another obese woman here I would get banned
 
user1357851
especially with transparent blouse
 
Xeo
@Crowz Moefication, works on everything from tanks to presedential canditdates.
 
12:58 AM
@Telkitty not always, we have witness protection for a reason
 
user1357851
should I try
 
@Telkitty NSFW pictures should not be posted.
 
Too bad I don't have my folder of funny pictures
 
@Telkitty Probably (and to be clear: in cases like that, Spandex is no better).
 
@StackedCrooked chrome tries to download it, got a link to the page?
 
It's a Startcraft II trailer.
Especially the Zerg look better than ever.
Protoss seems the least different.
 
@StackedCrooked that's.... not the right page. You mean to link this one? eu.battle.net/sc2/en/game/heart-of-the-swarm-preview/media
ah, actually, now that I know its the SC2 trailer, I can just use youtube or something
or google
 
It's the right page I think. There's a Play Trailer button there.
Maybe it's localized.
 
@StackedCrooked whoops, there it is
 
1:20 AM
 
@Xeo I think I'm facing something that might interest you: given a type T and candidate types U..., can you find the index of type C that would be preferred by overload resolution (of the kind foo(std::declval<T>()) with foo taking C), or report that overload resolution failed (e.g. with -1 instead of a valid index).
 
Xeo
@LucDanton I'm facing a similar problem trying to implement one_of<Bools...> without recursion :/
(e.g. with the overload resolution trick I used for any_of)
 
can anyone point me to a multiplicative partition generator of any sort
i can't find one online anywhere
 
@Xeo How serendipitous!
 
Xeo
Though I think yours is achievable, in some way.
 
1:27 AM
@StackedCrooked I want the CE so bad :(
 
Xeo
And if I can solve that, I can just use the same idea for my one_of
Ooooh, I have an idea.
If only LWS was up ~_~
 
Did one of us break it again?
 
Xeo
Nah, it was completely gone for a few days
now it says "error"
@LucDanton: I'll finish watching this video and play around with my idea then.
 
@Xeo No rush.
 
I can't find HotS:CE any canadian e-tailers selling HotS:CE
 
1:43 AM
static_assert( decltype(computation::test(0, 0, 0, 0))::value == computation::value, "Ohnoez!" );
Not a good start, computation::value is supposed to be decltype(test(std::declval<T>()...))::value.
Ya okay I stored an int into a bool.
 
Xeo
Woot, works.
 
Don't tell me, I'm almost done :p
Not sure where to put the (...) fallback.
> internal compiler error: tree check: expected baselink, have error_mark in tsubst_baselink, at cp/pt.c:11712
 
Xeo
lol
 
I'll submit a report right after that, seems like it's straightforward to replicate.
 
Xeo
Hint: Using (...) as the fallback might not be the best idea.
Thinking of standard promotions.
And greedy templates also don't really work.. meh.
 
1:51 AM
@Xeo Ya, it will only picked up if no candidate is available. If two candidates are ambiguous, there's a failure instead of reporting -1.
> error: incomplete type 'best_match< ... >' used in nested name specifier
I'm inside the braces, but in a member type definition.
 
Xeo
Nvm, (...) works fine.
I thought since ... does standard promotion (say char -> int), it would be preferred over a long parameter, but that's not the case.
 
Class A{ A a;B b= new B(a); }class B { A a; B(A a){this.a =a;}}
Is this above example denote aggregation concept?
 
@Xeo Right -- ... will accept any type, but any other match will always be considered better.
 
@user1334247 drop the new
 
@user1334247 Not very well anyway. class A { A a; is infinitely recursive.
 
1:58 AM
@Xeo I used bases, so I get ambiguous members now. I need to bring all the members into the scope of the derived class, how annoying.
 
Class A{ A a;
B b= new B(a);
}
class B {
A a;
B(A a)
{this.a =a;}
}
 
user1357851
I really hate sites where everyone uses their own pictures for their own avatar
 
@Telkitty Duly noted.
 
Xeo
@LucDanton Heh, same idea. stackoverflow.com/a/9024520/500104
 
My beautiful variadics need to be corrupted to unnecessary recursion :(
 
2:00 AM
@Telkitty Self expression and free speech are drastically overrated.
 
@JerryCoffin lol
1 hour ago, by sehe
Anyways, 62k rep pile (fr), good time to get some sleep sorted!
 
Xeo
Okay, my code's fully functional now.
 
^ I got sidetracked again. Good night all
 
Xeo
night
 
user1357851
99
 
2:01 AM
@sehe G'night.
 
Xeo
@LucDanton Aye, it's annoying.
I have no idea, however, how to "fix" that.
I just can't see a way to make it work like my any_of metafunction with just two overloads.
 
user1357851
feeling unsafe posting on anything public
 
@user1334247 Aggregation would be something like: class A { int x; A(int x) : x(x) {} }; class B { A a; B(int x) : A(x) {} }; In English: an A contains an int. A b contains an A.
 
Okay, I get something working. As planned, there are some ambiguous cases being reported. Unfortunately I don't know if all of them are legitimate lol.
 
You seem to be more accustomed to something like Java. In C++, this is a pointer, so you almost never use this.anything. You also don't need to use new to allocate objects unless they actually require dynamic allocation.
 
Xeo
2:05 AM
@LucDanton Mind handing me your tests?
 
@Xeo I randomly tested with int, <short, long>. I don't know what the result is supposed to be though!
 
Xeo
@LucDanton long?
 
@LucDanton That does make testing a bit difficult...
 
Also I sprinkled with some SFINAE so now I can report two kinds of failures: lack of appropriate overload, and ambiguous overloads. Isn't that nice?
 
Xeo
Gah, I also get a -1 for <short, long>. :|
Whyyy
Hm. Nvm, they're actually ambiguous, although I thought promotion was strictly non-narrowing (because, y'know, it's called promotion)
 
2:09 AM
Well, because calling foo(0) is ambiguous for foo overloaded on short and long. I.e. it is reporting the right failure.
Okay, time to share attempts I think?
 
Xeo
Note that mine doesn't distinguish between "ambiguous" and "no perfect match"
 
Ya, which is what I originally specified.
 
Xeo
ideone.com/AnrXF9 - 35 lines (excluding the obvious int_ implementation)
I think It would work if I just added a int_<-2> test(...) to best_match_.
 
ideone.com/ZLvhr5 - also 35 lines, with includes to my stuff and completely unnecessary use of indices (leftover from a first attempt).
Did you originally plan to introduce a separate best_match_ type?
I originally planned to only ever use a best_match without best_match_impl, but I hit 'type is incomplete' errors.
 
Xeo
It's kinda my style of doing things like that. metafunction_name_ in a detail namespace, and using metafunction = ...; in enclosing one.
 
2:16 AM
Although it did came in handy when I added some more SFINAE.
@Xeo I don't mean the names, I mean the number of types that are defined. But that would only have made sense for a variadic solution though!
 
Xeo
Meh.
Yeah, I could remove the match_bases type, I guess.
 
Wanna try? I get errors with my GCC.
(For my code I mean, not yours.)
Is there such a thing as a perfect match over a best match?
 
Xeo
identity conversion vs anything else?
 
Man, I suck so much at overload resolution. I can't find a sensible example.
Anything that is numeric seems to be ambiguous!
 
Xeo
Heh.
Derived -> Derived vs Derived -> Base vs Derived -> ...
 
2:22 AM
Fine, I'll use derived-to-base.
 
wtf... updating my video drivers crashed both machines that I was logged into.
 
Xeo
Perfect, best, none.
 
but it didn't crash the machine that I was updating
 
Xeo
lol
 
I was remote desktop'ed into two other machines.
 
2:23 AM
That doesn't make sense.
 
Then I updated the video drivers.
And both machines that I was logged into went black.
 
Xeo
Hm. What exactly does your best_match report except "ambiguous"? "no match" or "no perfect match"?
 
even when I killed the remote connection, the two machines stayed black
 
@Xeo No match.
 
Xeo
I see.
 
2:24 AM
I.e. (...) -> -1 translation.
Let's assume struct elder {}; struct parent: elder {}; struct child: parent {};
 
security issue?
 
child&, <elder&, parent&> is 1 and a best match right?
 
Xeo
Think so.
Even without references.
 
If we were to define a 'perfect'-match, what would it involve?
what about child& and child const&?
 
Xeo
@LucDanton for child& argument, child& parameter would be a perfect match while child const& requires cv-qualification change
 
2:26 AM
We're not too far away from all the overload/conversion rules tbh.
 
Xeo
(I personally define "perfect match" as "only involves identity conversion")
@LucDanton ? In what sense?
 
Lol, I don't understand this conversation.
I should probably sleep soon.
 
Xeo
static_assert(best_match<int, float, long, int, int>::value == -1, "Ambiguous");
static_assert(best_match<int, X, int*, decltype(nullptr)>::value == -2, "No match");
Alright, all working.
 
@Xeo We could define a what_kind_of_conversion_is_this_according_to_the_standard<From, To> trait, and then a best_match<T, <Candidates...>> that reports <Index, kind_of_conversion>.
Also, my Internet is being sucky.
Ah, table 12 in 13.3.3.1.2 User-defined conversion sequences [over.ics.user] is of interest I think.
 
Xeo
I was going by overload resolution rules all the time, btw.
 
2:31 AM
Identity > Lvalue transformation > Qualification adjustment > Promotion > Conversion.
 
Xeo
For the implicit conversion sequences.
@LucDanton lvalue transform is lvalue-to-rvalue conversion, right?
 
Note how Identity conversions, Lvalue transformations and qualification adjuments are all ranked as exact matches!
 
Xeo
Yeah, but Identity is still a better exact match than the others.
 
@Xeo Also array-to-pointer, function-to-pointer. Really all kinds of lvalue to rvalues conversions.
 
Xeo
Ah, right.
Anyways, I'll head to sleep. G'night.
 
2:34 AM
Oh well. Bye!
 
user1357851
well
 
user1357851
<-20 rep
 
user1357851
I think the 20 rep is here to stay
 
T to T const& appears to be special cased to be ranked as an exact match. How fun.
Of course, this introduce further special-casing to properly deal with e.g. T& and T const& overloads.
 
Xeo
A bunch of is_sames and is_base_of etc, right?
I mean, if you have static list<int_<I>, T> test(T);, you could then first get the appropriate list and through our above best_match code and work from there.
(Sleep-typing.)
 
2:57 AM
@Xeo No, I mean in the language. I'm not interested in an implementation just yet -- I need to further my understanding before.
Also go to bed.
 
Sleep-MATLABing
 
@CatPlusPlus Most people spell that as "nightmare".
 
ewww matlab
 
My laptop just went 'pft' and won't start anymore.
Oh well, will investigate later.
I welcome any advice as to a replacement I suppose.
 
3:17 AM
hey guys just a little question about lgpl licence
is it free to use in my commercial project?
(without modifying)
 
If you provide sources for LGPLed code and allow replacing it (which boils down to dynamic linking)
Also: ask a lawyer
 
Hm...
Should probably check my mails now.
@CatPlusPlus That's kind of easy to say. If you are in a situation where you're uncertain if you are allowed to incorporate an open source library into your code, are you actually going to get a lawyer?
 
What's the alternative? Copyright infringement? How professional of a commercial project.
 
If it's for my work then I'd just tell my boss that I'm uncertain about it and leave the decision up to him.
 
That's kind of easy to say as well lol. I don't have a problem with that, but you appear to do.
 
3:34 AM
There's been a few situations where I was uncertain, but it never resulted in lawyers looking at it. Usually a coworker read the license and gave second opinion.
 
What do you have against the advice 'ask a lawyer' that you don't have against 'ask a coworker/tell your boss'?
 
If you want reliable legal advice, ask a lawyer. It's that simple
It's also not very expensive
Certainly less than a lawsuit
 
BestMatch<T, U, V, W> is kinda non-specific about which parameters plays what role, no? I think I like BestMatch<T, meta::list<U, V, W>> better.
 
3:53 AM
BEST_MATCH(T, (U)(V)(W))
Macro love!
 

« first day (761 days earlier)      last day (4170 days later) »