« first day (2031 days earlier)      last day (2918 days later) » 

12:03 AM
0
A: Boost.Spirit : how to parse length preceeding byte array?

seheFirst things first: grammar.hpp:75:13: error: static assertion failed: incompatible_start_rule... means (surprise) that you use an incompatible start rule. The offender is the locals<> argument that is missing on the grammar baseclass declaration. Instead of adding that implementation detai...

It seems to me that this way of using Boost Spirit isn't a very nice fit
 
user1804599
PHP traits are so nice
 
user image
9
Driverless cars are so nice
 
Will Google pay the speeding ticket?
 
@Mikhail Three guesses
 
12:21 AM
Dilbert guy doesn't like millennials: dilbert.com/strip/2016-05-06
 
And today, a petition for Sir David Attenborough to change his name to #BoatyMcBoatface. I love you, Internet. https://www.change.org/p/david-attenborough-sir-david-attenborough-should-change-his-name-to-boaty-mcboatface
 
rofl
 
user1804599
Denotational design is all the rage these days.
 
user1804599
 
12:41 AM
> VS2015 Update 2, create a simple int main(){} file as test.cpp and compile it with /MT /Zi. Run test.exe under a debugger and set a breakpoint at _vcrt_EventRegister. It'll get hit before main() a couple of calls down from __vcrt_initialize_telemetry_provider(). From there, it'll attempt to use GetProcAddress() to find and call the EventRegister() Win32 API function to register an ETW event. EventRegister() is available starting with Vista.
Afterward, __telemetry_main_invoke_trigger() and __telemetry_main_return_trigger() will attempt to log ETW events under Microsoft.CRTProvider with the
> Seriously this is some serious bullshit.
 
@sehe makes sense
 
Boatloads of it, IYAM
 
12:59 AM
mother boat ..
 
@Ramy I'm happy to inform you that Chris has proven to be in possession of a working brain, and not in dire need of bad gigs. If it saves you any time, I'll spell that out: "No chance in hell". /cc @JerryCoffin
 
 
2 hours later…
2:52 AM
 
aw :)
 
3:20 AM
@sehe wow
 
3:31 AM
I've got a problem I've bumped into more than once. How do I check if a number n = 4a + 7b where n, a, b > 0? I started with modulos, but they only work where max(ab, a, b) = n, that is, where the number is divisible by a, b, or both. It's feasible that the number may be 4 + 4 + 7 = 15 or even 4 + 7 + 7 = 18, both of which are not divisible by 7 or 4. An iterative solution of factorizing is the only one I can conceive. Any formula that might work?
 
@Aaron3468 This is a math question, youre better off asking on Math.SE
 
@Borgleader Thanks. Wasn't sure because it crops up in a lot of optimization problems for pathfinding.
 
if you replace n with a constant you get a line, so it would seem there are multiple valid answers
im no math expert though
-6
Q: Hello, everyone I am new to C++ and need help on solving the followin code.

Jorge DeSantiagoeveryone I am new to C++ and need help on finishing my code. So I pay $89.00 for internet service. I have 2 internet service providers and I take 2 trips to the internet service provider store. I pay $178.00 per month. using System; using System.Collections.Generic; using System.Linq; using Sy...

3
/cc @Mysticial
 
nice
 
"Am new to C++"
*posts C#*
wtf
anyway, bed time
 
3:42 AM
So is the OP asking to fix a program about service prices? Or is he offering to pay us that much?
 
@Borgleader It's happened more than a few times. I don't know what's with them being confused about the two languages. So different
 
 
4 hours later…
7:48 AM
morning
 
Morning.
 
8:03 AM
In mathematics, a Diophantine equation is a polynomial equation, usually in two or more unknowns, such that only the integer solutions are sought or studied (an integer solution is a solution such that all the unknowns take integer values). A linear Diophantine equation is an equation between two sums of monomials of degree zero or one. An exponential Diophantine equation is one in which exponents on terms can be unknowns. Diophantine problems have fewer equations than unknown variables and involve finding integers that work correctly for all equations. In more technical language, they define an...
 
 
1 hour later…
9:04 AM
@Borgleader I should have bet :D
 
user1804599
Hi
 
Привет!
 
Hey, what's up?
 
Ven
hi
 
Ven
9:25 AM
yesterday, by Mikhail
https://www.reddit.com/r/cpp/comments/4hoyzr/msvc_mutex_is_slower_than_you_might‌​_expect/d2thalz
 
is this believable as a theme song/menu song
for a little game im trying to make
 
What do people have against telemetry. It's so useful.
 
Ven
it's not opt-in. That's what I have against in.
 
^ thats a good answer
 
user1804599
Telepathy would be so much simpler.
 
user1804599
9:39 AM
Telepathetic
 
the new windows has built in telepathy dang
 
Telekinesis would be even better.
 
first a touch screen, now a non-touch screen requiring telepathy/telekinesis
 
user1804599
Those who believe in telekinesis, raise my hand!
 
beeee
 
user1804599
WTF
 
user1804599
Freedom of speech anyone
 
user1804599
RIP it
 
@Ven dank
or the exact opposite of that, I’m not sure yet
 
@Ven That's some pretty strong bullshit right here. The butthurt must be impressive.
 
Ven
9:49 AM
:)
 
Ven
hi
 
someone help me compile kerrek please
@KerrekSB I don't understand the three yesses. I have only made two points that need to be confirmed. Or is the first "yes" something of an overall "yes"? — Johannes Schaub - litb 9 mins ago
 
@JohannesSchaub-litb it doesn’t have to be three yesses, it can just be one emphatic yes
well, maybe a dismissive one but it’s hard to tell
 
user1804599
10:19 AM
@Ven I have a problem
 
Ven
?
Ruby+Rust bridge. That's pretty fucking cool.
 
user1804599
Consider the type expression (map int string). This is equivalent to ((map int) string).
 
Ven
so (-> a b c) is ((-> a b) c)?
 
user1804599
Yeah, and that's a kind error. :P
 
user1804599
And I also want the other associativity for ->.
 
user1804599
10:21 AM
So I think I'll special-case ->?
 
user1804599
Make it a special form.
 
Ven
yes.
 
user1804599
So (-> a b c) desugars to (-> a (-> b c)).
 
Ven
;)
 
you may wanna do (map $ int string)
 
user1804599
10:22 AM
And the same for kinds: (-> * * *) desugars to (-> * (-> * *)).
 
boooo special-casing
 
which is equivalent to (map (int string)) because of precedence rules
 
Ven
@JohannesSchaub-litb this is not what you think it is :)
 
user1804599
@JohannesSchaub-litb no I do Polish notation.
 
@Ven perhaps it's a type, not fun app
 
Ven
10:23 AM
@JohannesSchaub-litb it's a lisp
 
but if it is fun app, it applies what i said
(no pun)
@Ven ah i see
youre right
 
Ven
it'd apply if it were using infix notation.
lisp doesn't really have precedence issues :P.
 
the german word "lispeln" comes from lisp when people try to pronounce "parenthesis", i guess
 
user1804599
ugh ven I am so screwed
 
Ven
10:29 AM
rip
 
user1804599
I need sorts as well.
 
user1804599
In my compiler.
 
user1804599
Otherwise it can't check whether kind expressions as well-sorted.
 
user1804599
E.g. (* *) isn't. * has sort k, not k -> k.
 
user1804599
It stops there though, no more universes are needed.
 
Ven
10:30 AM
that's a nice tower of babel you have here :-).
 
user1804599
Because there is no kind polymorphism.
 
yeah, polymorphism's rude
 
user1804599
> snekc: src/SNEK/Check.hs:146:1-26: Non-exhaustive patterns in function keK
 
user1804599
The kek is great in this one.
 
user1804599
snek check kek
 
user784668
@R.MartinhoFernandes std::min?
 
C-style cast
 
user1804599
@Ven Nice. :D
 
user1804599
@bfred_it People really do that? Must be a severe case of masochism.
 
user1804599
10:38 AM
:trollfaec:
 
user1804599
([(fn [t *, u *] (fn (x (-> t bool), y u) x)) bool bool] true)
 
user1804599
this type checks \o/
 
Do web servers have to have static ip addresses?
 
user1804599
No, but it is a desirable property.
 
May i ask why?
 
user784668
10:40 AM
@Mr_Tree Non-static IP addresses should die.
 
user1804599
Because otherwise you need to constantly adapt the DNS records, and have a very short TTL, which hurts cache performance.
 
Thank you.
 
user784668
There are more IP addresses than you'd ever need, so why change them?
 
That is what i thought, i just needed some clarification
 
@Fanael There's not enough IPv4 addresses :G
 
user1804599
10:41 AM
And yeah; dynamic IPs are stupid. Use IPv6.
 
user1804599
Everybody switch to IPv6.
 
user1804599
(let (id (fn [t *] (fn (x t) x)))
  ([id int] 1))
 
user1804599
This is kind of terrible though.
 
user784668
@набиячлэвэлиь lol IPv4
 
user1804599
@Ven do you know how Scala, Java, C#, etc do type argument inference?
 
Ven
10:43 AM
differently from one another
 
is there a way to pass std::integer_sequence to a lambda so that you have the integer pack in the lambda?
 
user1804599
:(
 
so that you don't need a function template for deduction of the pack?
 
user784668
@Zoidberg They use the ass pull algorithm.
 
user1804599
I want to make it so that if you apply a value with a type of the form forall a ..., it infers a from the arguments you pass.
 
user1804599
10:44 AM
Well I'll do that later, not now.
 
user1804599
Have to fix some other things first.
 
Ven
writef("%(* %s\n%)",  ["#dlang",  "rocks"])
Wow, D just went full Common Lisp.
 
user784668
@Ven Why?
 
Ven
that prints
* #dlang
* rocks
 
user784668
Okay, and?
 
10:47 AM
@JohannesSchaub-litb GCC has an extension: []<int... Pack>(std::integer_sequence<Pack...>)
 
Ven
i.e. it's a loop. in a formatting string. which is pretty much the insanity FORMAT in CL does
though the syntax in CL is ~{~} :)
(format "~{~(~a~^, ~)~}" '("FOO" "BAR"))
that's CL to print (lowercased) "foo, bar". etc etc etc.
 
user1804599
Ok, time to do codegen
 
user784668
@Ven "~{~(~a~^, ~)~}" is not a stream and '("FOO" "BAR") is not a string so I'm pretty sure it's not.
 
Ven
whoops, I mean (format nil ..) :)
 
user1804599
eww nil
 
10:52 AM
Good pedantry there
V important
 
Ven
oh hai katt
Cat Moss
 
@CatPlusPlus I am amazed that you come back
 
Ven
he has a pedantry detector :)
 
do you look at this profile recently?
apparently SO sucks
but he just could not quit it
 
@LucDanton nice
 
Ven
10:56 AM
only thing I see is that his SE profile links to the lounge IRC :)
 
now it has lambdas with all sort of parentheses in it
 
user784668
[]<>(){}()
 
hello all
can someone help with this please: coliru.stacked-crooked.com/a/a6d9cae0d7bba70e
why does the first invocation not produce a subtitution failure?
but instead keep the compile going?
my intend was to check that the last two arguments successfully convert to double and bool
and make_integer_sequence<int, -2>() should SFINAE, right?
i can't imagine that it simply decrements the int till -INT_MIN in its implementation. that would be goddamn stupid
there must be a bug in my code
cppreference says that "the program is illformed if N is negative"W
 
if you switch to -stdlib=libc++ then you hit a static_assert
 
11:05 AM
@JohannesSchaub-litb Ill-formed => no SFINAE.
 
> If N is negative the program is ill-formed.
from the spec
 
if the substituted expression would be illformed. that's the definition of SFINAE afaicr
 
This is cool (GitHub).
 
@JohannesSchaub-litb there is no expression, is there? spec-wise this governs the meaning of make_integer_sequence<T, N>
 
there is no conceptual difference between "if .. the program is illformed" and "if ... the construct is ill-formed"
 
11:07 AM
this is about the spec of make_integer_sequence, not the wording for SFINAE itself
 
Nice they finally added branch protection
 
make_integer_sequence<int, -1> is ill-formed
 
what is the difference if i had written "char[int(N)-2]" and the size became negative
spec wise this would govern the meaning of "char[N]"
and char[-1] is ill-formed
 
@JohannesSchaub-litb yeah that falls within SFINAE
 
then why not make_integer_sequence<int, -1>. i honestloy don't understand.
 
11:08 AM
the difference is that char[-1] is an ill-formed type, whereas a program that contains make_integer_sequence is ill-formed—it’s not the alias
 
the spec doesn't seem to say whether an instantiation of make_integer_sequence<int, -1> is ill-formed, or whether refering to make_integeger_sequence<int, -1> as a member of an overload set already is ill-formed
i would have assumed the latter to be the case
because it already forms N with a negative value
which the spec says is ill-formed
 
yeah that’s the difference between an SFINAE-friendly spec and an unfriendly one
 
and this would fall within the frame of SFINAE since it's an immediate failure
 
Ven
@Zoidberg ...must look amazing
 
user1804599
11:11 AM
(function($x) {
    return function($y) {
        return $x;
    };
})($not);
 
user1804599
Given ([(fn [t *, u *] (fn (x (-> t bool), y u) x)) bool bool] not).
 
@LucDanton IMO it smells like a defect
 
I don’t think there are that many SFINAE-friendly alias templates, come to think of it
 
but now, i'm not a library guy, so i may oversee something
 
@JohannesSchaub-litb it’s hard to tell, many features are submitted SFINAE-unfriendly and later amended
 
11:12 AM
like, what it means if the spec says "if so and so then this is ill-formed" at that particular place". perhaps it means that behavior is undefined
 
Ven
@Zoidberg that's missing a use, tho.
 
without insight into the process I can’t tell whether it’s by mistake (i.e. not paying attention to SFINAE to begin with) or deliberate (i.e. playing conservatively, relaxing only when it feels useful/necessary)
 
user1804599
@Ven nooooooooooo ;_;
 
user1804599
Thanks.
 
Ven
np :)
 
11:13 AM
the static_assert indicates that libc++ makes it a hard error intentionally
 
no I mean the spec
 
and it's howard, so i would assume the spec renders it illformed intentionally
 
NoDataSheetException
 
11:15 AM
> with all due respect, looking at solutions and questions is how i learn [...] i'm not trying to cheat or anything, i'd just like to see a mock answer which i can understand
again, lol
 
gcc's behavior is interesting
first it behaves as though it's an SFINAE failure
but when it wants to give the diagnostic, it seemingly ends up stuck in infinite loops
 
my suspicion is that the SC lacks a coherent approach to SFINAE, save for overload resolution. I.e. the 'shall not participate in overload resolution unless…' wording shows a deliberate coordination effort. But there is no such effort elsewhere (I think?).
 
@LucDanton i worked it around now by saying sizeof(char[int(N)-1])-1.
however, gcc and clang don't seem to like it. i suspect they treat char[0] as not violating sfinae
 
mmh I might have needed that trick before, handy to remember
@JohannesSchaub-litb we actually ran into that this week or the one before
@JohannesSchaub-litb ah no, it was in fact a case where a 0-sized array was being SFINAE'd when I didn’t want to
@JohannesSchaub-litb there is no loop that I can tell
 
user1804599
@Ven
 
user1804599
11:20 AM
((function($f) {
    return function($x) use($f) {
        return ($f)($x);
    };
})($not))($true);
 
user1804599
:)
 
Ven
nice :D
 
The empty 'note: template argument deduction/substitution failed:' backtrace is a very longstanding bug. Save for that, every thing looks like it should.
 
user1804599
Very easy:
 
user1804599
b' <- local (Set.insert p) $ ve2PHPS (\e -> "return " ++ e ++ ";\n") b
 
Ven
11:21 AM
@Zoidberg but the outer function could literally just be return $f;
 
@LucDanton notice that it says "substution failed because of:" and then nothing. if you wait long enough, it will print "execution terminated", with coliru killing it
 
user1804599
yeah lol
 
user1804599
it's an IIFE
 
user1804599
when I add let I'll make an letification optimization, turning IIFEs into lets
 
11:22 AM
@JohannesSchaub-litb oh, I don’t have an actual GCC at hand right now I have to rely entirely on the online compiler
 
Ven
@Zoidberg nice
 
i will try on my box
 
letification
Such a funny word
 
Ven
@Zoidberg I'm just saying that these 5 lines are a twisted way of writing ($not)($true) :P
 
user1804599
Also, PHP being PHP, use() is a syntax error -_-
 
user1804599
11:23 AM
So I need this:
 
@R.MartinhoFernandes so what was it then
 
user1804599
mkUse vs | Set.null vs = ""
         | otherwise   = " use(" ++ (Set.toList vs >>= ("$" ++)) ++ ")"
 
Ven
lol.
 
@LucDanton ideone'S error message is more helpful because of its shallow instantiation limit: ideone.com/56n77y
so during its diagnostic printing, it tries to instantiate std::_Build_index_tuple<4294966399u> . looks like during SFINAE, it treats char[0] as a failure. but during the diagnostic, it does not :p
 
Given i have vector<list<int>> results and I need to pass it to function by reference, is it a proper way?
in function declaration: (vector<list<int>>& results)
when I invoke, i pass just foo(results)
 
11:28 AM
@LucDanton It should be max(minimum, value);
 
@JohannesSchaub-litb just for the sake of the anecdote, the instantiation limit is not hit on Coliru not because it’s any higher, but likely because the more recent GCC likely means a different, more efficient make_integer_sequence implementation
 
@LucDanton Yeah, I remember a message in the mailing list about a more efficient implementation.
 
i'm going to complain with a bugreport about this divergence during diagnosis
 
@R.MartinhoFernandes I’ve considered before if min/max should have e.g. at_most/at_least aliases to avoid those bugs, but I’ve never done it because in those situations clamped was a viable alternative
 
11:31 AM
vector<list<int>> results;
results.reserve(n); //n>10
results[2].push_back(2);
why is it wrong?
 
because size() is 0, duh
 
feeding vampire
 
Ven
kek
 
@Kropekk this is like "boss, i will reserve our meeting for between 5 and 9 pm. please tell me your desired time". "oh boss, why won't you meet me at 6pm. haven't i told you so?"
 
Well, i need to use as little memory as i can. So should i first do reserve (with upper bound of lists), and then before entering anything to the list, should I do resize? (i don't want to use resize everytime because of reallacation time cost)
 
11:35 AM
@Kropekk first do reserve then resize. it won't reallocate if the size is smaller than the reserve
 
but if I use resize, does it count as memory that i use?
 
they said concepts would improve compiler diagnostics
 
@JohannesSchaub-litb Why not directly resize?
 
If you just have to minimise memory use, don't use list, and don't nest vectors.
 
i don't see any other way to do what i want... i don't how many lists i will need and i don't know how many elements the list will contain
 
user1804599
look at those beautiful colors sketchtoy.com/66987386
 
Slime molds have memory.
This is awesome.
And in not-so-awesome news mathematics is terrorism bbc.com/news/world-us-canada-36240523
 
soon: s-f flavour of the year’s subject becomes nanobiotechnology
 
@R.MartinhoFernandes Can you imagine if in the later flight there were actual terrorists on board?
Talk about irony
 
he was just about to figure out polynomial prime factorization
 
12:00 PM
My net contribution to nonius is -350 lines.
 
what does "gute tat" translate to in english?
 
'well done'?
 
i mean like samaritan action
like if you helped the poor. what is the action called?
 
'good deed' is the actual literal translation :Þ
 
in germany we say "gute tat". not sure what it means in english
 
12:03 PM
Good deed.
 
@JohannesSchaub-litb do 'in der Tat' next!
 
lol
i've done my debt for today with creating the GCC PR :p
My good deed for today: another GCC PR. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71007
 
I don't understand bugzilla
 
Ven
PR?
 
12:08 PM
If it's a PR how do I see the patch
 
public relations?
 
@набиячлэвэлиь right next to the commits
 
Where are the commits? Can I get a red circle
 
@набиячлэвэлиь I’m too tired to carry on the joek
 
I'm cereal for the first time in my life :F
 
12:14 PM
cereal? i only know surreal
 
PR means 'Problem Report' (probably) and there are no pull requests or commits because this isn’t Github
 
ffs nomenclature strikes again
@LucDanton P might be Patch as well :G
 
or is cereal some kind of floating point type with a "ce" characteristic
 
@JohannesSchaub-litb cereal <= serial <= serious
 
and this is a series
@набиячлэвэлиь i was in the impression that it means "problem report"
 
12:17 PM
@набиячлэвэлиь No. You file bugs in bugzilla. It’s true there is sometimes a patch or two in there, but it’s not the main motivation.
 
i say you file problems
 
well it’s not called problemzilla
@набиячлэвэлиь I’m starting to worry, if this lasts longer than 15min go see a face doctor
 
from the perspective of the gcc authors it's "bug-or-no-bug-zilla". but from the perspective of the reporters, it's "don't-know-whether-bug-zilla"
from the perspective of the reporter, there's just his problem
it may even be a feature request to solve a problem of the reporter
@LucDanton i think i could simply have written auto ignore_n(std::integer_sequence<T, I0, I1, I...>) and get a pack I that is two elements less
including a SFINAE error if the argument is less than 2 elements large. without the ugly sizeof trick :p
perhaps having template<typename T, T ...Ie, T ...Id> auto ignore_n(std::integer_sequence<T, Ie..., Id...>) would be most useful, because you can tell it how many elements to subtract. what do you think?
 
well it works here cos you don’t care for the actual values of the pack, but in general you’d have to adjust e.g. to (I-2) at the expansion site, so it’s a cruddy workaround really
do what you gotta do but it’s not going to look nice
sadly GCC is (ime) not very good at handling constraints and alias templates so you can’t just easily make an SFINAE-friendly alias to std::make_integer_sequence; the long way around instead
 
@LucDanton ah it failed because sizeof...(Things) - 2 would wrap around
nice. is this c++14 behavior or c++17?
@LucDanton in my other testcase, it wrapped around, but this time it won't. that's weird
@LucDanton ah OK; it's because of -Werror
 
yeah the integer stuff is like another layer of headache on top of the usual SFINAE one
 

« first day (2031 days earlier)      last day (2918 days later) »