« first day (2277 days earlier)      last day (2661 days later) » 
00:00 - 17:0017:00 - 00:00

5:08 PM
@wilx ergh... I#'ll watch it later... maybe
 
@thecoshman Watch it at night alone with all lights off. It is scarier that way!
 
lol
 
@wilx Rather the contrary--things like this become even scarier when examined carefully in the full light of day.
 
i have a question about linking
do static libraries sometimes have dynamic dependencies?
meaning, does it make sense that i might have to link a dynamic library to use some function coming from the static one?
 
5:49 PM
@ChemiCalChems Yes. On Windows (for one obvious example) this is almost unavoidable--much of the OS is implemented in DLLs (e.g., kernel32.dll), and pretty much everything else, at some point, ends up depending on them.
 
@JerryCoffin Hm. Interesting
i was having some obnoxious linking problems
suddenly decided oh well, why not try a rebuild
and it's all magically working again
my brain is in despair
 
@JerryCoffin Heh, true. :)
 
@ChemiCalChems No need for despair. Development tools are sufficiently large/complex that they're rarely entirely bug-free. Many of the bugs lead to "internal compiler error" messages, but a few lead to generating bad code and such. Things are definitely better than they were decades ago, but problems still arise once in a while. Such is life in software development.
 
@JerryCoffin yeah, i'm just trying to understand why the fuck it hasn't worked for 2 hours and it does now
 
nwp
6:10 PM
@wilx I watched it and took down my holiday pictures, they show some landmarks and architecture.
There is something similar going on with universities in germany which basically have to take down all servers or get sued into oblivion.
 
@nwp lol
 
nwp
What a shitty world we made for ourselves.
 
@nwp Obviously time to move extra-terrestrial. I'm going to start trade-marking configurations of stars, so even if you avoid landmarks, I'll still own you!
 
nwp
I wonder if one can abuse american case law by, for example, having google lawyers sue google for providing news headlines and then doing their best to lose, so in upcoming cases they just refer to that case.
 
@nwp An interesting angle. Non-trivial to carry out successfully. For one thing, you have to establish "standing", so it couldn't be lawyers working directly for Google; they'd have to (for example) buy at least part of some conventional news company that would be able to claim that Google was causing them damage.
 
6:28 PM
I just upvoted an answer by Vlad. Who'd have thunk
 
@sehe I've done that a few times. Though I doubt he'd admit it, he's actually improved quite a lot over time.
 
6:49 PM
Well, I hope all telescopes of Earth will be pointed at that point.
@sehe Thunk is the sound a grenade launcher does.
(I think.)
 
Ven
Hi
@thecoshman how do you uncon IV?
 
@Ven Uncon by intravenous injection. You lay down on a bed. They push a needle into your vein, and you receive UnCon through the needle. Note: human testing has not yet begun, but there are tests indicating that the UnCon blood alcohol level may well be survivable.
 
@Mysticial Seems legit to me.
 
@Borgleader Some butthurt to amuse at: meta.stackoverflow.com/a/341128/922184
 
7:40 PM
Another one:
-12
Q: When i ask something about Stack Overflow it gets deleted, when i ask for a discussion it gets deleted, there is no boundary for anything right?

DeerSpotterEverything gets deleted regardless of all the rooms you guys set up, discussion, support, helpcenter, issues. I also noticed that even if the question is similar to just one to 4 words from the question it is automatically marked a duplicate. Please put that up in your help support so users under...

 
Aww my comment telling the OP not to delete his account got deleted.
 
Hm, interesting question in this thread. If the goal for non-member begin()/end()/size() overloads is to support plain arrays then why not simply add those methods to plain C-style array objects? I agree it seems like a very unnatural thing to do. But is there anything that would prevent this from working?
 
@StackedCrooked You would have to define some sort of new kind of object or the universal calling notation.
 
Ell
I'm never sure how I feel about free functions vs member functions O_O
 
7:50 PM
Hm, in retrospect, I suppose the overloads are intended for more than just plain arrays. So adding a special case might not be the right way to go.
 
@StackedCrooked Because C-style arrays are not classes?
 
@wilx Yeah. I wonder how big of an obstacle that is technically.
@caps Yeah. But, does that really matter?
 
@StackedCrooked I am pretty sure that changing the language it much harder than adding something to the library.
 
@StackedCrooked With that, and given std::vector<int> x[10];, does x->begin() give you the begin iterator of the first vector due to pointer decay?
 
Hm, I suppose so.
 
7:52 PM
@StackedCrooked ... yes
 
@R.MartinhoFernandes Heh, nice. :D
 
Not really related, just thought of it.
 
Is there some playful or witty synonym for sandbox or playground?
 
@R.MartinhoFernandes Actually it seems that this is how works today.
@wilx sandground/playbox
 
@Mysticial lolwtf indeed
 
7:56 PM
Damn, array decay is so pervasive.
 
@StackedCrooked Same as IRL!
 
Ven
@JerryCoffin you're talking about alcohol
 
> I don't think there's anything funny or cool about fascism. Who can I complain to?

President-elect Donald J. Trump
725 5th Avenue
New York, NY 10022
 
> Practice Fighting Fascism for Free.
> © 2016 Goat, Wolf, & Cabbage
 
7:58 PM
Yeah, I guess I'll have to print my own.
 
@R.MartinhoFernandes I played that game with friends a few weeks ago. It's great, but the use of "fascism" is only used as attention bait and overall the presentation has no bearing on the rules.
There's zero political statement.
 
@EtiennedeMartel It's called "theme".
 
Still a great game though.
 
@EtiennedeMartel It's called "game".
 
Maybe expecting political statements from games with a political theme is too much to ask, heh.
 
8:02 PM
It is.
It hurts replayability if that's a strong component.
No one wants to hear the same lecture over and over.
 
People complaining because I didn't specify the standard library when benchmarking my algorithm against std::sort and std::stable_sort. I did mention that they « have been compiled with MinGW g++ 6.1.0 -std=c++1z -O2 -march=native », so wtf poeple.
 
I still feel like they called their game "Secret Hitler" because they knew that edginess sells.
 
OK, it is going to be pandoc-templates-cauldron.
 
@EtiennedeMartel They really haven't sold a lot.
 
I guess they weren't edgy enough.
 
8:06 PM
The game is only available as print-and-play if you're not in the US.
Hard to fix that with edginess.
 
@Morwenn almost as if there's more than one standard library available for MinGW
 
@milleniumbug I'm not even sure. But without specifying it, it's pretty obvious that it's libstdc++.
 
ouch why the ping sound is turned on
 
@EtiennedeMartel Anyway, in Temkin's own words: "Social Deduction games are about a well-coordinated minority trying to convince a confused majority to vote against its interests. It's an inherently political genre."
 
8:16 PM
let me fix this
@Morwenn yes it is
fairly sure libc++ doesn't even work on Windows
 
@milleniumbug There are many commits in libc++ that look like they're here to support MinGW or MSVC, but I'm not sure whether any of them is actually supported.
Is this legal despite looking UB af?
 
you're asking whether you can reinterpret a standard layout struct to the type of its first member
it's definitely valid C, but not sure about C++
 
if it's UB then any program that uses accept and sockaddr_in has UB
 
@R.MartinhoFernandes Yeah, I know.
 
8:28 PM
@milleniumbug No, I'm reinterpreting two uint32_t members of a standard-layout struct as a single uint64_t.
 
That's the stickers for people who don't want "Hitler" written all over.
 
oh right, I'm blind
then yeah, it's UB
 
D:
 
from practical standpoint, you have no alignment guarantees or even that endian matches
also compiler can insert arbitrary padding between a and b
 
@milleniumbug Depending on how you do it, it can be IB. It's not guaranteed to be UB.
 
8:31 PM
@milleniumbug Could it be made non-UB with a good ol' alignas and Howard Hinnant's endian enum?
@milleniumbug I'm unsure about that one.
Because of the note on std::complex and possible implementations.
 
non-normative, the reinterpretation guarantee for std::complex in the draft doesn't mention this
it only mentions the two first paragraphs
 
@Mysticial it’s super UB
 
@milleniumbug Yeah, I always wondered about the accuracy of the third one.
 
@LucDanton Not if you go through a union. Or is that just C99 text that hasn't been ported to C++?
 
@Morwenn I think no, it's rather "no, you can't reinterpret unless X, Y or Z". And neither of these conditions happen
strict aliasing is a bitch
 
8:37 PM
@Mysticial that’s something else, also typically super UB in both C and C++
 
Actually, union not needed. You can get the same effect with memcpy().
That's valid in C++ as well.
 
That's the valid approach.
 
we go through this every 3 months or so
 
@LucDanton which is why I remember this so well :D
I normally don't dig through standard
 
@Mysticial you’d want a member array of two objects rather than two separate members though
 
8:40 PM
@Morwenn You can make it legal with this. (And without runtime overhead compared to the original code. (at least on gcc/clang))
 
I’ll not mention the grey area re: magic around trivial init anymore since it’s being patched
 
also static_assert(sizeof(foo) == sizeof(std::uint32_t)*2);
 
@StackedCrooked Is that the famous memcpy_cast? :p
 
I suppose.
It does require pod-ness though.
Actually, is_trivially_copyable is sufficient.
But that one requires a modern compiler.
 
@Morwenn If you care about performance, you're better off turning off strict-aliasing. The 2 x int32 -> int64 is "too common". For that matter my entire Pi program relies heavily on this which locks it into little-endian architecture.
 
8:43 PM
Doesn't strict-aliasing improve performance?
Because less checks for overlapping data?
 
@Mysticial I thought keeping strict aliasing but punning through unions was the first resort
 
On x64, the program mostly deals with arrays of 64-bit integers. But there are numerous places where I lack 64-bit implementations so I substitute it with calls to 32-bit versions by casting the pointers and doubling all the lengths and offsets.
So I have a large integer represented as an array of a billion 64-bit integers.
 
@Mysticial It was more of a QoI than anything else, I was wondering to which kind of types branchless comparisons could be extended :)
 
But my large multiplication routine only takes a pointer to a 32-bit integer array.
So I cast and call it a day.
:35013727 I'm down-casting here so it's fine. Internally, the program supports big numbers as arrays of either 32-bit or 64-bit integers. But the large multiply routines are word-agnostic and interpret the data as bit-streams. So I implement a 32-bit word API for them which I use for both int32 and int64 input arrays.
 
@Morwenn Yeah. The nice thing is that the compiler is allowed compile this down to a reinterpret_cast if it knows the target architecture allows it.
 
8:48 PM
so now that we’ve covered aliasing/trivial copy, what’s next in our regular programming? moves and forwarding?
 
@StackedCrooked Now that sounds a bit sexy.
 
@StackedCrooked Yes it does. But negligibly in my code at least. Right now, my code still works correctly in GCC with strict-aliasing because GCC doesn't do aliasing analysis across function boundaries. And the only time I type-pun without a union is on function parameters. So as long as those functions don't get inlined, it's all good.
But it's still flaky in that the next version of GCC can break things at any time.
Even if it gets inlined it's usually still okay. The only time GCC chokes is when you reinterpret without a union within the same scope. And that's incredibly rare since the "producer" and "consumer" of the data (with different datatype interpretations) are usually far apart in the code.
 
I think strict-aliasing will only cause problems if you are mixing reads and writes. Like writing to uint32_t* and then reading from an overlapping uint64_t*. In such a situation I wouldn't take the risk. But if I'm only reading then I don't see how strict-aliasing can mess it up. (I'd prefer to stay outside of UB-land though.)
 
Looks like the memcpy is indeed elided, yielding a branchless comparison for the struct.
 
Yay :)
 
9:03 PM
@StackedCrooked The case that I usually get bitten is where I have a stack array of 64-bit integers serving as a local buffer. I write to it with 64-bit integers. Then I call an bignum add function. The problem is that the bignum add function needs to do carry-propagation, so I cast down to 32-bit integer and use 64-bit integers for carry propagation. And since the function is small, it gets inlined.
 
Is this type of type punning / casting still necessary? IIRC memcpy() is optimized well these days so copying from some piece of memory to intermediate int32_t or similar is a single mov instruction.
 
My original solution was to force-no-inline for the bignum add function. The new solution is to properly implement the bignum add with 64-bit add-with-carry intrinsics which not only eliminates the type-punning, but is also faster.
 
@wilx Dunno, but I agree that there should be legal alternatives that don't require sacrificing performance. If no legal alternative can be found I would consider posting it on the GCC mailing list and ask for suggestions. Perhaps they know clean way of solving the problem.
@Mysticial Interesting.
 
@wilx For me yes. Because copying 8 GB of data into a temporary buffer is not always feasible.
 
@Mysticial No. What I mean is that you copy just the 4 or 8 bytes at a time instead of the type punning.
 
9:12 PM
@wilx That works if you can break it up like that. In my case, I have a function that produces a very large array of 64-bit integers. And I need to input it into a function that takes a very large array of 32-bit integers. It would be a huge (programming) burden to make one side support both word-sizes. So the easy solution is to simply cast the pointers and multiply the lengths and offsets by 2.
 
9:46 PM
@Borgleader
-15
Q: I WANT TO MAKE AN PICTURE UPLOADING APP IN HTML. OR JAVASCRIPT WHERE PARTICIPANTS CAN SHARE PICTURES THEY TOOK AFTER AN EVENT

omarWHO CAN HELP ME IN CREATING THE CODE TO HAVE AN PICTURE UPLOADING APP IN HTML OR JAVA SCRIPT. I AM STILL TRYING TO FIGURE OUT WHATS THE BEST WAY TO DO IT. I WANNA HAVE LIKE UPLOADING IMAGE BUTTON AND A SUBMIT ONE. SO EVERYONE CAN BE ABLE TO UPLOAD PICTURES AND SHARE IT WITH THE REST.IT DOESNTHAVE...

 
@Mysticial +100
 
10:06 PM
it "does"?
But I'm happy you do. Think.
 
:)
 
@Ven one does not simply do uncon, they endure it
 
10:45 PM
Or don't go.
 
@thecoshman In Soviet Russia, uncon endures you
 
Is it just me, or does this seem like an user-info grab?
20
Q: Introducing the Silver "Census" Badge!

Tim Posttl;dr: In anticipation of our annual Developer Survey being ready to release any day this week, we're happy to announce a new badge: "Census". This is a silver badge that can be earned multiple times - once for each year you complete our annual developer survey, starting in 2017. The last few s...

 
> Our Developer Survey results have become a de facto source of information for many companies
 
The only way to get the badge is to basically associate your survey with your profile. And if you fill it out with shit, they'll come after you.
@Morwenn lol
 
Do we get swag?
 
10:50 PM
@sehe Makes?
 
Ven
11:03 PM
@thecoshman you don't want to tell me? :P
 
@wilx Probably :)
 
11:31 PM
@Mysticial Could have been a lot shorter: I want to make an imgur clone.
 
POKEMON EMERALD ANY% on games done quick!
glitchless, 3 hours!
 
alias templates seemingly don’t maintain the illusion when it comes to deduction
 
11:47 PM
Can somebody give me some intuition about OpenGL? I want to update a vertex buffer object with about 10k points each draw call. How do-able is that?
 
10k vertices, for each draw call? O.o
 
I guess this means no
:D
 
Well, it'll work, but if there are many drawcalls I would assume it to be slow af
but i could be wrong, i havent actually tried and cba to (havent done any opengl recently)
@jaggedSpire sup
 
00:00 - 17:0017:00 - 00:00

« first day (2277 days earlier)      last day (2661 days later) »