« first day (1591 days earlier)      last day (3360 days later) » 

2:00 PM
how shit, GH won't allow me to create milestone titled "⊥"
 
> I couldn't find any doc
Would make awesome SO post material
 
lol
 
@BartekBanachewicz IMPOSSIBRU
 
I didn't feel like editing it
 
> /usr/lib/creduce/clang_delta --query-instances=remove-unused-function prepro.ii
Segmentation fault (core dumped)
turns out creduce isn’t buggy
 
2:02 PM
> seen 4 hours ago
Vlad's lurking
 
Of course there’s no package for debugging symbols.
 
Jan 25 '14 at 14:46, by sehe
You people have a sick preoccupation with annoying incidents and actors
@LucDanton lol
 
@AndyProwl mmm. no activity though
 
@BartekBanachewicz He's too butthurt
 
fuck you cabal
 
2:07 PM
@sehe I have to give credit when credit is upstream, haven’t I?
I really like creduce, too.
 
@Jefffrey ah
 
@sehe There's a free beer at stake
 
cabal file requires base >= 4.7, he is rejecting all 4.7.* for some reason
it even ignores the sandbox
cabal 1.22
 
@Jefffrey I specify it as >= 4.6 && < 4.8
 
tried removing and recreating sandbox
 
2:09 PM
welp, there’s a similar bug filed and closed and it looks like a right bother to manually install from trunk. fuck it!
 
base isnt a part of the sandbox
it's an internal part of the compiler IIRC
 
@BartekBanachewicz still no work
 
@AndyProwl Indeed. 'Vladspotter 2015' is still running...
 
@Jefffrey wut
try -v
 
template<typename Type>
constexpr Type constant {};
 
2:11 PM
lol in VS2013 auto x = non_movable{}; compiles if the move-constructor is deleted and public, but fails to compile if the move-constructor is deleted and private
 
Sanity check: the above is a definition.
 
> (conflict: something => base>=4.6
&& <4.8)
@BartekBanachewicz 1.22
 
isn't that "verbose"? damn
 
Oh, yeah sorry
It says he is using the sandbox
 
oh btw @Jefffrey
I wanted to ask you something (in the other room)
 
2:12 PM
colleague asking if there is a way to ignore the false branch of a ternary conditional operator
 
conditional operator*
 
right
 
Given two functions F1 and F2 that can be called with Value, I wrote a trait<Value, F1, F2> that returns which function overload resolution would call. For this I get the first argument of each function, and write my own test functions and let overload resolution do the dance. But this does not work if the original functions are e.g. sfinaed out. Is there a better way to do this? (A sketch would be enough)
 
Functions or functors? Or function types?
 
template<class Function, class Value> auto foo(Function&& f, Value&& v) { f(forward<Value>(v)); }
 
2:15 PM
he has if (condition) { do_something(); } and he wants to rewrite it as condition ? do_something() : ignore_it; "because it fits in one line"
 
a callable
@AndyProwl lol
 
You can add a fallback to the overload set and detect that. Something like template<typename... Any> fallback_type fallback(Any const&..., ...);
Won’t work (I think?) if one of the two functors is itself doing fallback via (, ...) but can’t have everything.
 
@AndyProwl condition && do_something();
 
@AndyProwl Looking for solution to totally invented problem
 
@gnzlbg Why would you ever want that?
 
2:18 PM
@Puppy I use it for automatic tuple conversions.
 
@Puppy given a list of functions F... and a value V, call the function from F... that overload resolution would call with V
 
I also used to have a smart constructor for variant but I got rid of it.
 
@FredOverflow Bad bad bad not enough "ternary" operator
 
@gnzlbg Also known as f(v)?
 
@LucDanton i want it for a better match for variant
@Puppy ?
 
2:19 PM
@Mr.kbok He seems to enjoy asking irrelevant questions, or noob questions, or both
 
@Puppy That only tells you it’s a valid call and the result type, not which was called.
 
Why not just call the overload set directly.
 
He's got at least 2-3 of those every day
 
@Puppy how do you create an overload set of functions from values?
 
Unfortunately he's sitting right next to me
 
@gnzlbg inheritance
 
The dupe is incorrect... — Borgleader 8 secs ago
 
Puppy seems to have trouble in the world of GTA V
 
s/ of GTA V//
 
@Puppy hmm, good idea. Can i inherit from lambdas, function pointers, ... ?
I think it can work, gonna give it a try.
 
2:21 PM
Closure types yes, f-pointers no.
 
if it works for lambdas and callable classes it should be good enough.
 
@gnzlbg Match as in pattern-match/visiting?
 
@gnzlbg fps need special handling but can still work
 
@LucDanton yes, my visit function is match(F...) and it calls the best F for the current value.
 
@AndyProwl condition ? do_something() : noop();
 
2:23 PM
I had the technique demonstrated to me, I didn't work through it in detail, so excuse any horrific mistakes I've made here
 
@Puppy im going to omit function pointers first, i think i can specialize for them later and offer an operator()
 
Bonus points for implementing noop() in an "utility" library and then importing the "yourProject::utility" namespace
 
@gnzlbg Technically it doesn’t work for classes with surrogate call operators but nobody knows what those things are, much less use them.
 
@LucDanton I think it should work for anything callable
 
@Puppy surrogate call operators? I'd have to google that.
 
2:25 PM
lol
3
Q: How does one execute a no-op in C/C++?

Jubafor the following: ( a != b ) ? cout<<"not equal" : cout<<"equal"; suppose I don't care if it's equal, how can I use the above statement by substituting cout<<"equal" with a no-op.

 
@gnzlbg You can actually start with : handle_pointers_t<Base> for handle_pointers_t = Type; and later put in a check+put in a wrapper.
 
I don't know what surrogate call operators are.
 
@Puppy Nah, cause you need using Base::operator(); to bring everything into scope.
 
@Mr.kbok I could have given a trolling answer but 1) he would have taken it seriously and put it in our codebase, and 2) it would have been an incentive to asking more of such questions
 
@LucDanton yes, that should work
 
2:25 PM
@Puppy Called it!
 
@LucDanton Shouldn't it find the base call operators automatically? Don't you only need the using if the derived defines it's own overload?
 
I fucked up my design again
 
No because there will be two overload sets, one from the current Base and one from the recursive base.
 
I just inherited from all the bases simultaneously with a variadic template.
at least, that was my first instinct.
 
@AndyProwl So what did you tell him? Did it work?
 
2:27 PM
This whole thing started as an example for meta, how to use the library to write a variant class. It turns out the variant is for what i need them better than Boost.Variant -.-
 
you're probably about to tell me how that's going to go horribly wrong.
 
@Mr.kbok I told him "it's non-sense, just use an if ()"
 
"Showing 0 changed files with 0 additions and 0 deletions." gj git
 
@BartekBanachewicz Use git add --all && git status -v > /convenient/file and then view the file.
 
2:29 PM
I gave up using git diff because it so frequently failed.
 
@AndyProwl Okay, I have "solved" your colleagues problem with a template:
template<typename Action>
void one_line_if(bool condition, Action action)
{
    if (condition)
    {
        action();
    }
}

int main()
{
    one_line_if(1 < 2, [](){ std::cout << "Math still works!\n"; });
}
 
And you can’t using Bases::operator()...;, so you have to do the silly recursive rolling.
 
@Puppy this is by your very special definition of "failed", I assume? :p
 
@LucDanton Curious, the compiler won't just OR them?
 
@LucDanton crap :/
 
2:31 PM
@jalf It repeatedly produced 0 diff, even when git status said the file was different. I'm far from the only one who had that problem.
git status -v always produces a correct diff, as far as I can tell.
 
@LucDanton can't i do this->operator()(value); ?
 
@gnzlbg Use recursive bases rather than inheriting from them all simultaneously.
 
@gnzlbg You may use something like this
 
Xeo
@Puppy Did you stage the changes?
Then you need git diff --staged :P
 
wait
 
2:33 PM
@gnzlbg I’ll investigate.
 
Xeo
or just git diff HEAD for all the things
 
you're telling me that git diff doesn't diff against HEAD by default?
 
Could not find module `Control.Concurrent.STM'
It is a member of the hidden package `stm-2.4.2'.
derp
 
Xeo
@Puppy git diff diffs the unstaged stuff against head
 
@FredOverflow :P
 
Xeo
2:33 PM
git diff --staged diffs staged stuff against head
git diff head diffs both staged and unstaged changes against head
(Note: I do not condone this behaviour.)
 
@gnzlbg Doesn’t look like it. I was excited for a moment though.
 
@LucDanton @AndyProwl @Puppy why don't just:
http://coliru.stacked-crooked.com/a/e51c0c80841f595a
 
well, judging from what I found when Googling this problem, that is only part of the issue. I think.
 
@gnzlbg You have to go the full distance
 
@gnzlbg You didn't instantiate it, so you have no idea if it works or not.
 
Xeo
2:35 PM
@gnzlbg Try using it. The problem is not the template part, but hiding by multiple inheritance of the same function.
@gnzlbg See here
 
I've never had problems with git diff not showing all my changes. but yeah, if you've staged stuff, then git diff won't show it
 
Xeo
On that note, man that question is old.
Almost 4 years.
 
well I don't actually think that accounts for my experience because before I used git add all && git status -v > /c/dev/status.txt, then I didn't stage anything without reviewing (or at least trying to review) the diffs first.
 
I'm not sure what you mean. add all does stage everything
 
Xeo
git add is ... staging.
 
2:37 PM
one git feature I do surprisingly like is git stash.
@jalf Yes, because otherwise git status -v won't tell you anything about it except that you have unstaged changes to that file.
 
git diff shows you everything that wouldn't be committed if you just do a git commit now :p
git diff --staged shows everything that would be committed (and nothing that wouldn't)
 
Xeo
Well if you stage, and then git diff, that does have everything to do with it not showing your (unstaged) changes.
 
@LucDanton creduce where creduce is due
 
@Xeo No, I moved to staging and then git status -v because git diff on unstaged often failed.
 
lol
 
2:39 PM
@Puppy we're trying to figure out what you did in the scenario that failed, though
 
step 1 make changes, step 2 git diff, that's it.
 
@thecoshman It gets even better!
File[] files = Stream.of(paths).map(File::new).sorted(comparing(File::length).reversed()).toArray(File[]::new);
 
no staging.
 
I think the whole failure is staged
 
sorted(comparing(File::length).reversed())... I want this kind of API in C++!
 
2:40 PM
it worked most of the time but sometimes it would just fail on every file
 
@sehe the world is but a stage...
 
@FredOverflow lol
 
@AndyProwl I'll have the stake. Medium, please
 
@FredOverflow What does toArray need an argument for?
 
also viewing the diff in the terminal is a real pain in the arse compared to a text editor
 
2:41 PM
@FredOverflow I'm sure it can be done
 
@Puppy protip: git difftool
 
@LucDanton Java tax
 
@Puppy lol, your launch vehicle blew up again?
 
maybe some sort of messy shit... and TMP wankery
 
also manually git diffing every file instead of diffing all the files at the same time is less convenient
 
2:41 PM
@LucDanton I believe it was pretty much the same in .NET 1.1
 
@LucDanton Because Generics are crippled in Java. toArray would not be able to figure out on its own what kind of array to create.
 
<3 git difftool
 
@Puppy Have mercy, I’m too full to gorge on popcorn atm.
 
@jalf That might be useful if git diff reliably produced an output :P
 
@jalf but you have to set that up
 
2:41 PM
@FredOverflow I would have expected File[].class or similar, or doesn’t that make sense?
 
@thecoshman Yes. That is why I set it up
 
@sehe No Vlad no steak beer
 
@FredOverflow Reflection?
 
@LucDanton Passing class objects would be the Java 7 way of doing things. In Java 8, you pass essentially factories instead ;) That is, functions from size to array.
 
@AndyProwl Our two Vlads are all in Moscow a.t.m. I win!
 
2:43 PM
See, .collect(File[]::new) would make sense. And it’s the perfect amount of information.
 
@Puppy Reflection on what? All the generic types are erased.
 
@FredOverflow The underlying objects are still gonna be of type File, no?
 
Sure, but what if the array you started out with was actually of a supertype?
 
@jalf git should auto customise for every user
 
Or what if the array was empty?
 
2:44 PM
oh I’m blocking out the Puppy again
 
can't you reflect on the array to ask it what the underlying type was?
 
@LucDanton a list is of type 'object' at runtime, but your array needs to be of a some type
 
@LucDanton He's talking to me.
 
I told you about popcorn!
 
@sehe Well maybe but how does that make you win?
 
2:45 PM
@Puppy You can ask arrays, but Stream.of(array) turns it into a stream which has no such type information at runtime.
 
@LucDanton it needs to type of the array type, and ideally you give it a properly sized array
 
@AndyProwl I give you the heads of two Vlads from Moscow. Gee. Tough crowd
 
usually like toArray(new Thing[thingList.size()])
 
4 mins ago, by FredOverflow
@LucDanton Passing class objects would be the Java 7 way of doing things. In Java 8, you pass essentially factories instead ;) That is, functions from size to array.
 
2:47 PM
^ How not to address your request to the author of Tarsnap
 
@FredOverflow oh, well, I'm stuck in 7 land :(
want lambdas so bad... but fear I'm getting used to crapping interfaces for shit.
 
@sehe The prize is for posting a link to his first question since he was last banned
 
@thecoshman You working in a Java shop?
 
@AndyProwl Huh. Did he even ask a question before
 
Xeo
@AndyProwl Post in general
 
2:48 PM
@sehe Sure
 
@thecoshman Personally I would not want to shit with any other kind of interface.
 
But well yeah
Post
 
@FredOverflow shops have nice things :\
@Puppy ICrap
 
You working on a Java slave ship? ;)
 
@sehe A Vlad answer will get you the beer. If it's a really bad answer, I may even stretch to two.
 
2:49 PM
@MartinJames Do comments count?
 
@sehe Kinda hard to tell why from the (lack of) context. If I were to guess, I’d say OP has already subtly been told to piss of.
 
@AndyProwl No - question or answer.
 
> Too Young to Wed - the phenomenon of child marriage. imgur.com/a/A5KNl
srsly some people are crazy
it contains some rather nasty pics (nothing sexual)
 
@FredOverflow more apt than you know :'(
 
http://coliru.stacked-crooked.com/a/821c359c48efafc8 wtf
Iso says that these are ambiguous even if the worst conversion for the first is better than for the second ?!
 
2:52 PM
@AlexM. That is pretty crazy.
 
@gnzlbg GCC be dissing the standard.
 
@thecoshman Don't worry, I'm sure you'll be allowed to use Java 8 when Java 10 comes out.
 
@Puppy awesome :)
 
@FredOverflow :'( I doubt it
I also hope I don't find out
 
2:54 PM
@Puppy @Xeo @LucDanton thanks!
 
3
Q: Java certification - Should I upgrade?

java_mouseI have Java 1.2 certification which I completed in 2002. Now I have 10 years of Java experience and I tried to catch up with all Java 5/6 new features but at times I am lost in some of the new things especially on multithreading and generics which were revamped in the later releases? Should I re...

What are these kinds of certificates good for, anyway?
 
@FredOverflow pleasing bad managers
 
@FredOverflow Kindling.
 
@FredOverflow CVs for silly employers
 
Ironically, Java certificates are one of the few things in Java that are surprisingly concise. "You passed"
 
2:56 PM
@gnzlbg np. Fun fact: I rolled my own variant to do apply(f, v, w...) which calls f with whatever is the active member of v, w....
 
hur dur you don't have a certificate I don't believe that you can code
 
@thecoshman You passed by value!
 
but really haha who wants a Java job anyway
 
@LucDanton that is a cool feature
 
user1804599
> I am lost in some of the new things
 
user1804599
2:56 PM
lol how can you be lost in the features of Java?
 
@FredOverflow I love talking to java developers about references to objects, they just do not get it.
 
user1804599
Java has like, only three features.
 
It also handles non-variant arguments, e.g. apply(f, v, 0, w...). It’s also very convenient for killing compilation times!
 
@райтфолд IDrink, IDrank, IDrunk
 
@райтфолд Well, you can't explain Wildcards with Dogs and Animals ;) Or at least not as easily.
 
2:58 PM
i'll finish a match member function for multiple unary functions first, then i'll accept that challenge :)
 
@райтфолд Java has inheritance and generics. What's the third feature?
 
@FredOverflow on a more serious note, in some cases they can give you an edge
say, you're a random freelancer
there are some websites that place your bids on top of others' if you have specific certifications, but normally you have to have really specific certifications
 
if (rand() <= RAND_MAX/2) free(lance);   // random freelancer
 
that the site in question lets you take for $$$
 

« first day (1591 days earlier)      last day (3360 days later) »