« first day (2248 days earlier)      last day (2683 days later) » 

3:00 AM
there are two parts to the expression
the left side ((i > 0) * i) * (i < 28)
 
Xeo
btw, isn't the (i > 0) * part unnecessary? Or is that needed to trigger the infinite loop?
 
is not 0 only if i is more than 0 and less than 28
 
wait how does this work I'm so confused
 
the right side isn't 0 only if i is more than 27
 
@jaggedSpire So why did you do it this way anyways?
There has to be a better way to do this...
 
Xeo
3:01 AM
oh wait, nah, negative numbers.
 
@VermillionAzure you're welcome to try and keep the UB result the same with a saner calculation
 
@jaggedSpire UB?
 
@VermillionAzure yes
 
UB = ?
sorry forgot
 
the signed integer overflow triggers an infinite loop optimization
because signed integer overflow is undefined behavior
note how the loop is written to cover five lines, and how the kraken art has many, many more
@Xeo yep
 
3:04 AM
wait
wtf why are you doing this
what
 
Xeo
interestingly, only -O2 triggers it
 
the multiply
why
 
Xeo
-O3 and Clang's -O2 have the same output (5 lines)
plus two broken trailing lines
 
so when newbies ask "why does c++ do this I know it's ub but why" I can link to this and go "it's UB, the compiler can do anything. ANYTHING!"
it is super weird
 
But what's the purpose of this code anyways?
 
3:05 AM
I actually didn't come up with the initial case--just turned it into kraken art
 
oh
undefined behavior
Isn't it just, "let's demonstrate UB behavior?"
 
I found the initial version in the comments of a "why does ub do this?" question and wondered if I could make the output more amusing than the list of numbers it was at that time
yes
that is exactly the point
 
Xeo
@VermillionAzure As it says, "let's summon the kraken"
 
-_-
Seems weird
 
That kind of math is sometimes the only way to do if statements on platforms like a TI calculator.
 
3:08 AM
Okay. But that's a TI calculator.
 
sometimes newbies seem to have this whole thing about trying to understand and predict UB. It's a noble goal, but relying on UB is asking for trouble and they sometimes need that point driven home
 
@jaggedSpire Oh so you mean you just want to show how UB is unreliable then
 
I wonder what happened to meet...
 
"This is bad. Don't touch the stove. Your hand is burning"
 
@VermillionAzure yep!
 
3:09 AM
@jaggedSpire Now the better question is, "Is burning the hand?"
 
Agreed, I've been burned enough by undefined behaviours that I look for standard-supported ways to do things. "Oh, you like a concise way of expressing something that we didn't intend? Next update will break that and you'll be rushing to refactor code the way we intended it to look; ugly!"
 
@VermillionAzure I'm afraid I don't quite parse your meaning
 
@VermillionAzure "UB behavior" -> "undefined behavior behavior". Say what?
 
@jaggedSpire EXACTLY
runs away
 
lol
 
3:11 AM
@JerryCoffin redundant redundancy. Nothing more to say, so I will say no more. Silence.
 
redundant
> re
omg
 
I have discovered the secret of everything
 
I wonder what dundant means
 
@Nooble nooble: enlightened koala
 
3:16 AM
speaking of light
 
@Aaron3468 nothing redundant doesn't anymore, I bet
 
did you know that koalas are the only creatures known in our galaxy to be capable of faster than light travel?
precisely 1.18x the speed of light
 
oh you
 
the speed of light was measured in 1492 by measuring the time it took for a koala "Columbus" to sail the ocean in search for some Indians
koalas have been getting faster since
 
@Aaron3468 I believe it always has an affix. If you have a lot, but not too much, that's abundant. If you have too much, then it's redundant (doubly abundant).
 
3:19 AM
@JerryCoffin Huh, it was always "The Sound of Silence" (singular "Sound") as far as I can remember. It's seems more... poetic in its plural form.
 
@MarkGarcia As you can see, it's printed on the cover as plural (but without "The", for whatever that's worth).
 
@Nooble its a major waste of time :P
 
@Borgleader lol
studying plants actually seems like it might be fun
if I weren't so breathtakingly terrible at memorization
 
I think you might be onto something Jerry
 
Yo Yo
 
3:25 AM
waits for pun
@Shoe wasssup
 
@LucDanton Weird because Ele used to kind of dominate pvp tbh (mostly dagger/dagger tbh)
 
and cicada's arrived
good heavens it's a party
 
@jaggedSpire All fine. What about you? I heard you quit discord
 
@Shoe I'm doing all right
 
fun fact koalas are actually time travelers
 
3:27 AM
@jaggedSpire Sorry, but this is C++, which is a long ways from heaven.
 
@JerryCoffin :D
@Shoe I have quit discord, though. How've you been?
 
Dramaing with my GF
 
alas
 
@Shoe yo
 
jagged did quit discord but on the 11th of December she came back and uttered the words "nooble is my king"
 
3:29 AM
She did eh?
 
@jaggedSpire here
 
I assume it's nothing you'd feel comfortable discussing in such a public place, or I'd ask you if you wanted to talk about it :P
@Nooble and you know this because you are a time travelling koala do you
but have you considered that by telling me of this event you have changed it?
@Borgleader :P
 
@jaggedSpire Thank you, but thankfully it's over and we are happy at the moment. Let me enjoy this brief breath of no-drama air. :P
 
@Shoe oh, that's good :) I was about to offer you condolences re: the drama
 
:3
 
3:34 AM
@jaggedSpire actually this was all meant to happen and I actually further influenced you into doing so
 
@jaggedSpire Yes--traveling faster than light is equivalent to time travel.
 
@Nooble ah. How wise must the koalas be
 
Nooble is like a gray Yoda
 
@JerryCoffin which is weird to think about really
 
1 second per second
@jaggedSpire The wisest according to the good book.
 
3:43 AM
@Nooble which one?
 
you know
goldilocks and the three koalas
 
wtf
is that the australian special edition
 
it's actually the first edition
after the great grizzly-koala war of 1812
 
of course
 
the grizzlies captured the publishers of the book and demanded that the koalas be replaced with the inferior grizzlies
 
4:07 AM
does anyone know off the top of their head which part of the standard deals in constexpr classes?
nvm probably found it
 
@jaggedSpire [dcl.constexpr] perhaps?
 
@JerryCoffin thanks
I'll look there next--found some stuff in [class] too
in standard fashion the whole of it is spread over a few different places, seems like
 
@Borgleader are you kidding?
I've love some :P
 
@jaggedSpire absolutely not, wtv floats your goat
 
4:19 AM
@Borgleader it would behoove me to get my Christmas shopping done soon, actually
@JerryCoffin seems like [class] just contains some mentions of constexpr use, nothing really explaining it
[dcl.constexpr] seems like the motherload though
thanks
specifically, it's mostly about constexpr functions and constexpr constructors
links to [expr.const] though, which is what I'm reading now
hm
what are the destruction requirements for a constexpr union-like type
constexpr constructors only have to initialize one member of each union and union-like item in their set of members
 
4:40 AM
Whats the use case for a union?
 
thinking my way around this
you have to explicitly destruct the existing member of the union don't you
 
So I just spend the last hour getting burned by this: coliru.stacked-crooked.com/a/e0956cf43d94fe64
In both MSVC and ICC, it compiles.
 
@jaggedSpire lol you got hooked
 
And when I ran my code, it blew up.
 
@MarkGarcia yeeeeeep
you menace
 
4:42 AM
Can't you resolve the ambiguity by prefixing the class manually?
 
@Mikhail What happened was that both MSVC and ICC called the copy constructor instead of my constructor. So the reference wasn't initialized. And the code blew up when it tried to access the reference.
But when I stepped through the debugger, I was puzzled as hell because it never called the constructor in the first place.
So I was like WTF?!?!
But when I changed the reference to a pointer, it worked.
 
@Mysticial Looks like UB.
 
Perhaps one day I'll understand what the explicit keyword does :-)
@Mysticial You should try something like ReSharper, it usually will highlight junk like that
 
Member initialization has undefined order IIRC.
Not sure.
 
It's weird those two don't warn, if not error
@MarkGarcia ? it's in order of declaration in the class definition
 
4:45 AM
@MarkGarcia Member initialization order is defined.
 
oh okay
 
It wouldn't matter in this case anyway.
 
I've taken advantage of that a bit more than I should, really
 
Then it's not UB. :)
 
god help the poor non-language lawyer who has to pick up some of my code
 
4:46 AM
or even the CPU that runs it
 
I'm not much of one, but I've done some funky stuff sometimes
@Mikhail lol, yeah
 
Hmm... Deleting the copy-constructor doesn't remove it from the overload set: coliru.stacked-crooked.com/a/dcd48a004178200e
 
soon! soon, I'll be able to fix it
@Mysticial yep! Fun times.
making it private doesn't either, does it.
IIRC that just makes the resolved overload compile error due to insufficient access
...try defining the move constructor?
 
Initially I thought it was a compiler bug. Because the call to the constructor was right there. And it was never being called.
So I tried with ICC, same thing.
So I was like WTF?
 
Well, why don't you make them members instead?:)
 
4:51 AM
hm, weird
it implicitly deletes the copy ctor if you define the move ctor, doesn't remove it. I remembered differently
 
@MarkGarcia I could. Right now the code is in the middle of a major refactor. And this multiple inheritance thing is just a tool to get connect the old and the new code.
I haven't decided whether or not to actually keep the multi-inheritance yet.
 
and you can't just make B inherit from A, I assume? The semantics here are more many:one than the one:one that would result.
:\
 
@jaggedSpire There's several templated intermediate classes sitting between Child and ParentA.
The whole design is very sketchy to begin with. Hence the refactor.
 
dog on a bicycle
that's scary
you could use a tag, if you hate using the pointer
 
I changed the constructor to take a pointer.
 
4:57 AM
OH
I read several hundred intermediate classes
not several templated classes
dunno why
 
In reality, the actual structure is a diamond inheritance. I just didn't want to go that last step do virtual inheritance.
 
nods
 
Especially if I'm probably gonna refactor it out later on.
I'm also less sure of the exact memory layout of diamond inheritance and which side has the pointer to the parent.
 
yeah, de-deviling the diamond isn't really a high priority if you're going to axe the devil soon
fair 'nuff
 
If I were to strictly follow the "is-a" rule for designing class inheritance, then the structure is a diamond inheritance. That's how it ended up like this in the first place. So I'm not completely sold on getting rid of it yet. I'll decide later after I refactor the surrounding code.
 
5:04 AM
nods
 
@CheukKinSing oh, sure. there are still traces of that in that ele is being played at the highest level of play. to cut a story short the HoT changes (namely the elite specs and amulet changes) have relegated them to the support role, and the buffs are meant to diversify the builds (e.g. scepter burst)
 
5:23 AM
Is it legal to do operator[][](int,int)
 
no define a proxy object for the second part, or use an array of arrays or vector of vectors
and then you can use the vector/array/other container as the "proxy" object
 
@Mysticial I don't bump into diamond inheritance too often. Is there a way to include composition ('contains-a')?. I find that helps when I refactor code.
But ultimately if it's working you can leave it be for now
 
you know the best profession for a pedophile? impersonating santa ...
little kids will line up to sit on your lap
 
lovely
 
5:42 AM
@Aaron3468 The answer is yes, but I would need a proxy object that holds two references - one for ParentA and one for ParentB.
 
isn't that a fairly common pattern in game programming?
no that's something similar but not the same disregard me
 
@Mysticial deleting something never removes it from the overload set
except for copy/move purposes, amusingly enough, although that’s not quite what was happening in your code
 
@LucDanton And, in fact, removing it from the overload set would often be counterproductive.
 
fun with preventing compilation of specific invalid constructs that would have otherwise unexpected behavior from a templated function, is really the only situation I can think of though
it's an important one to be sure
 
If deleting it removed it from the overload set, that could let that same operation happen with some other function. The point of deleting it is to prevent that from happening, so we want it in the overload set, and we want it to be the best match if somebody tries to do that operation (then, because it's deleted, that operation can't succeed).
 
5:55 AM
@JerryCoffin with all due respect I’m not sure that sort of explanation is helpful to someone trying to get a handle on what's happening :)
 
my compiler is complaining about "no know conversion from 'foo*&' to 'foo&'"
 
they do that
stop trying to give it references to pointers when it's expecting a reference
 
@JonahSloan You probably need to take an address where you're currently trying to pass the object itself (or vice versa).
 
^ probably the vice versa
 
@jaggedSpire Hmm...yeah.
 
5:58 AM
@LucDanton Yeah. It's more like "illegal" than "deleted".
 
@LucDanton Perhaps not.
 
just for fun & confusion cc @Mysticial @jaggedSpire
 
oh boy!
 
@LucDanton oh geez
 
because explicitly deleting the copy ctor implicitly deletes the move ctor unless you say otherwise, yes?
 
6:01 AM
@jaggedSpire Pretty much, yeah.
 
@MarkGarcia the most succinct way of putting I know of is to point out that = delete is the definition, leaving the function as still declared. (leaving copy/move members aside for a minute.)
 
If the definition of a class X does not explicitly declare a move constructor, a non-explicit one will be implicitly declared as defaulted if and only if
(9.1) — X does not have a user-declared copy constructor,
 
nods
 
@jaggedSpire the move constructor is not even declared (which is a big deal for overload resolution)
it's impossible to get rid of the copy constructor declaration
even more succinct: 'deleted' is not the opposite of 'declared'
 
@LucDanton it's just deleted if you delete the move ctor, right?
 
6:03 AM
@jaggedSpire Deleting the copy ctor is also declaring it. Declaring a copy ctor removes the default move stuff. But I think that's not the point of the example.
@LucDanton Ah yes. That's perfect.
 
@jaggedSpire to keep it short, it’s rule of 5 or rule of 0 meaning that the destructor as well as the special members of the bases & members matter as well
 
@MarkGarcia I know, I'm talking about the situation where you're explicitly doing things to the move ctor, but letting the rules work behind the scenes for the copy ctor.
yep
it's implicitly deleted since the move ctor is explicitly declared
on the topic of general deleted functions, one example I've seen is where you have a templated function operating on integer types
if supplying a floating-point number would result in unexpected behavior for the client, you can declare deleted functions with float and double specific signatures, so overload resolution will catch them instead
the client will have to explicitly cast to an integer type to use the function, increasing the clarity of what the code will do at the call site
 
so funny, in order to intimidate others, wildlife/birds puff up their fur/feathers in order to look bigger
 
@jaggedSpire Yes. It's a good tool to use if you don't want to try to remember subtleties and want a guard against misuse.
 
6:21 AM
A friend of mine spent almost two years designing a board game, and then he went and submitted it to a German publisher under the name "Return to System 88". Let's just say he didn't get positive responses.
 
I'm writing code to manage a list<pair<int, list<pair<int, int> > > >. If it was up to me, I would have chosen a map<pair<int,int>,int> instead.
 
but why a list
 
because "the alternative to an actual large array is a list of lists"
 
@R.MartinhoFernandes Forgive me if I'm out of the loop, but what's system 88?
 
"88" is neo-nazi code for "Heil Hitler"
 
6:28 AM
like 88mph?
 
Oh wow! I can understand now... That's reasonable
 
@JonahSloan the alternative to an array is a vector
 
@JonahSloan encoding: a=1, b=2, c=3
 
looking through the bookmarked conversations for this room is fun
 
6:30 AM
@JonahSloan H being the eighth letter of the alphabet.
 
Yes, I was going to say that looks like a job for vector. Lists are quite different in C++ than the lists in python
 
Is anyone here familiar with terminology used to talk about your OS drawing images on your screen?

I want to do a small project where I animate a silly PNG image across my screen on keypress, above all windows, but am having a hard time finding libraries because I lack vocabulary of this domain.
 
ey, it's Lala!
 
@AndrewAllbright Composition. Or at least, for Windows.
 
@Mark
(sorry, new to chat)
 
6:32 AM
yay I got the ghost ping!
 
@R.MartinhoFernandes As an additional bonus, S is the eighth letter if you start from the end, so, "SS".
 
@Aaron3468 he only learned about this 88 thing after submitting it. Now he emailed them trying to convince them it was an accident.
 
Heil H8ler
 
@MarkGarcia First, was I able to communicate my project to you successfully? It seems like it.

Second, what would you search in google if you wanted to find a library to be able to add this image above all application windows? "C++ Composition" probably won't get me what I'm after :)
 
And the "return to system" bit makes it even worse (and funnier)
 
6:34 AM
@AndrewAllbright You want Qt
 
boy oh boy
also:

IO in C++ is terrible, but we can make it great again

Aug 2 at 10:46, 2 hours 14 minutes total – 271 messages, 14 users, 0 stars

Bookmarked Aug 2 at 14:00 by Griwes

 
^^; I can imagine. Hopefully he's suggested a better alternative, because I can't imagine they'd be pleased if he only apologizes. @R.MartinhoFernandes
 
@Mikhail As long as the I add image can fly freely above all other application windows without being constrained to an application window of it's own then that library should do it.

I'm going to look at Qt docs now
 
@AndrewAllbright You could start with Windows Composition API. I do not know if it covers cases where you draw out of window layers though. You might have to look deeper.
 
@MarkGarcia I'll look into that too. There might be vocab words in there to mine.
 
6:39 AM
@AndrewAllbright I'm sure there are. Just don't expect all of it to mean the same outside the Microsoft universe. :)
 
In Unicode-related news: the Rat für Rechtschreibung has declared uppercase Eszett to be allowed in official state documents.
 
@R.MartinhoFernandes One down, one hundred eighty seven thousand to go.
 
@AndrewAllbright You mean a "splash screen"?. Qt Should be able to make one (QFrame?). But you can also write a small wrapper for linux/windows APIs.
 
6:57 AM
I'm contemplating porting Clippy to Qt, will I get sued?
3
 
@Mikhail Yes, not by Microsoft, but the rest of the world.
 
crimes against humanity
So, somebody said that my software wasn't user friendly
So, is there a substantial overhead difference between a std::mutex and an std::recursive_mutex?
 
@Mikhail you monster
 
I thought he was cute
 
maybe if you gagged him
"Looks like you're writing a letter" indeed
 
7:04 AM
 
shut up and let me write my fucking letter
no clippy, that is grammatically correct, you're just an idiot
that's it I'm switching to the dog clippy
see what you've made me do
I did like the way he turned into a mobile in the GetArtsy animation
 
I'm sorry I'm reading this really interesting story
 
but as far as young me was concerned that was pretty much his only redeeming feature
@Mikhail how's the plot :P
 
7:18 AM
its cuming along
 
heh
 
@Mikhail This is when clippy suggests something
 
looks like you're trying to write a letter
 
there is the internet, the dark net, the grey ... and the f%^#$ing disgusting gore %$^#$%^# ... I had this impulse to share the horror, but then thought better not
 
marked as off topic
 
7:45 AM
Postal 2 (stylized as POSTAL2) is a black comedy first-person shooter video game by Running With Scissors, and it is the sequel to the 1997 game Postal. Both are intentionally highly controversial due to high levels of violence and stereotyping. Unlike its predecessor, Postal 2 is played completely in first-person based on the Unreal Engine 2. Scenes of the game can be seen in the music video of The Black Eyed Peas single "Where Is the Love?" In 2004, New Zealand banned Postal 2 due to "gross, abhorrent content" and Australia banned the game a year later due to "excessive abhorrent content". On...
 
 
2 hours later…
9:58 AM
we need a bot to periodically spam this chat with interesting stuff :p
 
@Ell I'd not believe all of them, but I wouldn't be surprised either if that kind of thing actually happened.
 
10:49 AM
@Telkitty You're proposing your self? :p
 
Ven
hi
 
hello
 
user6438653
11:20 AM
Is anyone here?
 
11:31 AM
Wow, James McNellis is an amazing speaker!
 
@MarkGarcia team work? :')
 
Ell
@R.MartinhoFernandes poor chap
 
user1804599
go (VerifyAuthorizedForFile (FileID fileID) next) =
    Reader.ask >>= case _ of
        Nothing -> Plus.empty
        Just (UserID userID) ->
            liftAff (query conn """
                SELECT
                FROM files
                WHERE id = $1 AND author_id = $2
            """ (fileID /\ userID /\ unit))
            >>= case _ of
                [(_ :: Unit)] -> pure next
                _ -> Plus.empty
 
user1804599
<3_<3
 
Ell
I saw Baby Metal last night
They were so cute :3
 
11:52 AM
Are they still singing about deep topics like chocolate?
 
user1804599
12:15 PM
Ugh
 
user1804599
HTTP 401 Unauthorized isn't about authorization but authentication.
 
user1804599
English is very hard.
 
Natural language is very inconsistent. And necessarily so, for the most part
 
nwp
if you are not authenticated you are an anonymous user, and anonymous users are not authorized to perform that action
you are assuming the intended action was to authenticate yourself to perform the action while they assume you meant to perform the action anonymously
 
user1804599
You can be authenticated but not authorized.
 
12:23 PM
You lost me at auth.
 
user1804599
Being authenticated means they know who you are, being authorized means you're allowed to do something.
 
nwp
you can also be authorized and not authenticated
 
nwp
the error message is not necessarily wrong
 
user1804599
@nwp Yes.
 
12:25 PM
@Telkitty Who knows what will come next... Maybe soon criminals will be able to bend time with 4D printers?
 
@sehe buffalo?
 
@rightfold Uh, where did you see this?
> The 401 (Unauthorized) status code indicates that the request has not
been applied because it lacks valid authentication credentials for
the target resource. The server generating a 401 response MUST send
a WWW-Authenticate header field (Section 4.1) containing at least one
challenge applicable to the target resource.

If the request included authentication credentials, then the 401
response indicates that authorization has been refused for those
credentials.
From RFC7235 (HTTP/1.1)
@nwp If you see above, not in an HTTP context. Lack of authentication implies lack of authorization.
 
nwp
12:43 PM
@R.MartinhoFernandes I don't think so. Question banned users lack authorization to ask a question, however, unauthenticating themselves authorizes them to ask questions. In this case lack of authentication gives you authorization, so your implication does not always hold.
 
> in HTTP context
 
@nwp What milleniumbug said. Moreover, what you said is not true on SO. "Ask Question" when logged out brings you to the login page.
Yes, it is possible to implement other auth schemes on top of HTTP, but that doesn't change HTTP.
 
Ven
flags as C++ content :P
 
1:40 PM
@fredoverflow oh god...
 
int a = 0;
    a:
if (a < 42)
{
    ++a;
 goto a;
}
printf("%d\n", a);
Interesting, labels and variables can have the same name...
 
1:58 PM
@fredoverflow indeed, since you can't use variables with goto, and you can't use labels in expressions, this is all unambiguous
16
A: understanding C namespaces

schotC has four different name spaces for identifiers: Label names (the goto type). Tags (names of structures, unions and enumerations). Members of structures and unions (these have a separate namespace per structure/union). All other identifiers (function names, object names, type(def) names, enume...

 
@Ven ohai
 
user1804599
2:17 PM
@fredoverflow I implemented upcasting with covariance in two lines of code!
 
user1804599
upcastF :: forall f a b. (Functor f, Subtype a b) => f a -> f b
upcastF = unsafeCoerce
 
user1804599
Now you can safely upcast List Apple to List Fruit. :D
 
Ell
"Safely"
"unsafeCoerce" :P
 
user1804599
Functor and Subtype laws.
 
user1804599
Functors must preserve structure, therefore unsafeCoerce is equivalent to map unsafeCoerce, except faster.
 
user1804599
2:29 PM
And Subtype requires that unsafeCoerce is safe, i.e. pure and total.
 
Ell
Are subtype laws LSP?
 
user1804599
Pretty much.
 
@rightfold And I just implemented a statement that is widely considered harmful ;)
click history for details
 
velociraptors are en route
 
user1804599
@fredoverflow Comefrom isn't considered harmful. Implement it instead!
 
Ell
2:41 PM
@rightfold doesn't the compiler optimise?
 
user1804599
psc optimizer is very limited.
 
user1804599
It inlines a few known functions, optimizes Eff bind, optimizes mutable variables, and it performs TCO in recursive functions.
 
@fredoverflow that's old hat. Using that 3.5 years ago
@VermillionAzure buffalo
 
user1804599
3:08 PM
Cool, webgraphviz.com uses Emscripten.
 

« first day (2248 days earlier)      last day (2683 days later) »