« first day (1039 days earlier)      last day (3904 days later) » 

9:00 AM
what?
 
@Xeo might do, when I have some working code as proof-of-concept
 
@TonyTheLion just do what everyone else does (, , , , )
 
Xeo
@TonyTheLion Might want to ping @DeadMG for that
 
DeadMG is SleepMG
 
Xeo
Now he'll know when he wakes up vOv
 
9:02 AM
I've used std::bitset before and I thought it was pretty decent.
operator[] is handy I guess
But I've never gone and said to myself, "Wow, I really want some iterators for this"
So might be just me
 
@TonyTheLion Here's an excerpt from the dragon book that I noted a few weeks back, it might help you: "A rule such as "stmt --> if ( expr ) stmt else stmt" is called a production. In a production, lexical elements such as the keyword if and the parentheses are called terminals. Variables like expr and stmt represent sequences of terminals and are called non-terminals."
 
@Rapptz in many board games (chess, checkers, Go) you want to represent collections as pieces as std::bitset, and then you wan to loop over them to print the board, or generate moves. That is currently not possible (at least not efficiently), unless you test each bit individually
 
@Borgleader that only gives an example and no explanation
 
@TemplateRex I made a board game before with std::bitset.
Let me see how I print it
 
@Rapptz printing is easy with to_string(), but to print a board in formatted style (i.e. to get the actual square numbers where the pieces are) is another matter
 
9:06 AM
@Borgleader A car such as a Ferrari is called a race car. In a Ferrari parts such as entry holes are called doors. Non-entry parts are called non-doors.
Equally useful IMO.
 
@TemplateRex lol my code is a bit weird
In fact I don't even use a bitset for the graphical representation, I use a 2 dimensional char array.
 
chess programmers (who are notorious C++ haters btw) "iterate" over raw 64-bit integers using bit-twiddling tricks for precisely that reason: std::bitset doesn't allow them to do. I'd like std::bitset to abstract that bit-twiddling away inside iterators
 
@nightcracker I disagree but it's 5AM I can't sleep and I won't argue over it.
 
Well, I'm not really afraid of bit-twiddling tricks since it's apparent by my choice of a bitboard.
 
Ell
Hi guys
 
9:09 AM
why do chess programmers use a bitset to represent anything?
 
bitboard
 
Ell
save space? idk
 
bitboards are nice
 
nice for what?
 
board games
 
9:09 AM
@TemplateRex That's ridiculously lazy. The bad kind of lazy, not the good one.
 
@Rapptz my point is that bitboard are nice for their efficiency, but very bad for their lack of abstraction
@R.MartinhoFernandes what's lazy?
 
What you described that they do.
 
Ell
I need some music now
some mix cds :3
 
@Rapptz let me rephrase it: what problem does a bitboard solve for chess programming?
 
You can't iterate over a bitset though?
 
9:11 AM
@R.MartinhoFernandes well, yes, but what are they supposed to do? if only std::bitset would provide the std::set abstraction with iterators and all, then it woudl be much much easier
 
for(unsigned i = 0; i < bitset.size(); ++i) { bitset[i] stuff }
is this like insufficient for iteration?
 
@TemplateRex there's no point in abstracting such an exotic data structure because no generalization is useful
 
@Rapptz it is sufficient, but terribly inefficient for sparsely populated boards
 
how would iterators be any better?
 
they wouldn't
 
9:13 AM
they would
 
@Rapptz They would solve his problem!
 
@Rappts inside the operator++ you could to the bit-twiddling, e.g.mask &= mask - 1; clears the first 1-bit
 
you can check entire words for 0 at once
 
No, see, I have to consider my 10000000x10000000 game boards.
 
and it efficiently jumps over all 1-bits
 
9:13 AM
@CatPlusPlus ah, playing Chess++ I see?
 
@TemplateRex Well, now I'm just confused.
 
@TemplateRex what exactly is the problem you're facing right now?
 
@TemplateRex Wut.
You want ++ on an iterator to do what?
To modify the bitset?
 
What the fuck? I'm confused.
 
if you have a sparse bitset you can jump over entire words of 0's
 
9:14 AM
Ah, the elusive mutating iterator in its native habitat.
 
instead of checking bit by bit
 
@R.MartinhoFernandes operator++ clears the first 1-bit, the iterators would be input iterators, so you can't look at the same bit again
 
No, see, checking bit by bit is how I achieve this magnificent efficiency.
 
@TemplateRex Stop it.
 
wait
that idea is stupid
 
9:15 AM
@TonyTheLion You're confused - I've only just got up and my head is now full of jumbled bits.
 
@TemplateRex That makes no sense on std::bitset.
 
@MartinJames hahaha
 
3 mins ago, by R. Martinho Fernandes
@Rapptz They would solve his problem!
Still it.
 
Yea but is that a good solution?
 
@TemplateRex you can skip sequences of zeroes without using a mutating iterator
 
9:16 AM
@R.MartinhoFernandes the iterator would be "fat pointer", holding a pointer to the first word, and a mask of the current word. Operator ++ would clear the first 1-bit of the mask
 
> fat pointers
lol
 
TERMINOLOGY
 
Fat far pointers!
 
oh no wait
 
inb4 segmented memory
 
9:17 AM
@R.MartinhoFernandes @DeadMG @Xeo hum hum
 
you'd have to notate fat pointers as FATPTR
 
@TemplateRex Still makes no sense for std::bitset.
 
Why should operator++ clear anything at all?
 
(emphasis required)
 
@LightnessRacesinOrbit not of the underlying container, only of its own internal mask
 
9:17 AM
Anyway, I think std::bitset is cool. operator[] already abstracts certain concepts away. It also has pop count, setting, clearing bits, etc. I think it's okay for what it does.
 
@LightnessRacesinOrbit Because it would solve his problem!
 
We should all go back to JAVA
 
Never in the history of computer data has so little been managed by so much for so few.
 
@nightcracker _F_A_T_PTR
 
mov rax, MYFATPTR
 
9:19 AM
just look at how find_next is implemented in gcc st::bitset, that's what an iterator operator++ should do
 
You know what else sucks for doing whatever he needs? std::exception_ptr. It's amazing how much C++ sucks.
 
@CatPlusPlus FATPTR_T, just to mess with POSIX
 
ITT C++ Sucks
I'm going back to C
Fuck C++
I want my FATPTR's
 
mov tumblr, MYFATPTR
 
9:20 AM
@TemplateRex There's a find_next?
 
Ell
Damn. Breed's mouldy :(
 
MYFATPONY_T
 
Ell
I am not good at keeping food
 
JBL
@TonyTheLion Shit I read that MYFAPPTR.
 
ahahaha
 
You're a crappy breeder if your specimen get mouldy.
 
Hmm.. my RAM is getting full. I have only 13104 gigabits free.
 
@TemplateRex you want to overengineer your bitset?
@TemplateRex no need to - it's already been done: keithschwarz.com/interesting/code/?dir=van-emde-boas-tree
 
it's called Find_next_ (capitalized) old SGI extension that didn't make it itno the Standard
 
hahah
 
9:22 AM
You should be complaining about find_next being missing, not about some quirky iterators being missing.
 
Ell
I wonder how cucumber fajitas are
 
@Ell NSFW?
 
@R.MartinhoFernandes find_next_ would be nice enough, agreed. But with iterators copying bitsets to other containers would be even better.
 
@Ell Ah! A sensible post, at last.
 
9:23 AM
@Rapptz what is a proxy reference?
 
@Ell that sounds like really kinky porn
 
@TemplateRex You want to copy bit indices.
 
@TonyTheLion You can't reference a bit.
 
so we went from bitsets to porn...
 
You need to return a value that pretends to be a reference to a bit.
 
9:24 AM
@R.MartinhoFernandes exactly
 
@TonyTheLion average day on the job
 
@CatPlusPlus You can with a fat pointer.. (why did I say that?).
 
@TemplateRex That should not be what the iterators from bitset give you (if it had any).
 
9:25 AM
Lounge<Fat<Ptr>> make it happen guys
 
Ell
Haha safe for work. I was trying to make cucumber sandwiches but my bread is bad. I have some good fajitas thiugh
 
no, but dereferencing such iterators should give proxy rerefence that are convertible to indices
 
(And my original point isn't fucking obvious yet?)
 
@Rapptz ah I see it now
 
@TemplateRex then use std::vector<bool> and be happy that the shitty idea already exists and is implemented in the standard
 
9:26 AM
@nightcracker No find_next either.
 
@nightcracker plus dynamic allocation
 
@TonyTheLion Hope that answer helps :L
 
@TemplateRex write a stack allocator
 
@nightcracker Which one is it? std::vector<bool> or that code?
 
9:27 AM
Oh no dynamic allocation OH NO
NOOOOOOOOOOOOOOOOOOO
 
@R.MartinhoFernandes what do you mean with it?
 
1 min ago, by nightcracker
@TemplateRex then use std::vector<bool> and be happy that the shitty idea already exists and is implemented in the standard
 
@R.MartinhoFernandes what about the original point? what should be obvious?
 
@R.MartinhoFernandes the code I linked is the data structure TemplateRex actually wants
@R.MartinhoFernandes std::vector<bool> is the shitty idea
 
9:28 AM
@nightcracker Then why did you suggest std::vector<bool>?
 
@R.MartinhoFernandes because TemplateRex suggested using some weird bit reference proxy bullshit
 
Enough fat pointers, I need coffee.
 
Ell
reference proxy is necessary
if you don't do that you may as well do vector<char> or unspecialised vector<bool>
 
> The universe implodes. No matter.
3
 
Ell
(I don't know what I'm talking about probably)
 
9:30 AM
but then how can there be lightness?
 
@MartinJames What?
 
Time for the real questions.
Why is std::bitset<N>::size not constexpr?
 
ahaha
> I was adopted at birth and have never met my mum. That makes it very difficult to enjoy any lapdance.
 
@Rapptz Because fuck you, that's why.
 
@Rapptz so people write boilerplate templates to extract N :D
 
9:31 AM
@TemplateRex It's obvious that this annoys the hell out of me.
 
@R.MartinhoFernandes LOL, ok I'll stop
 
You cannot complain that X doesn't abstract away Y and that as a consequence of that you have to use Y.
I don't like those programmers. I don't want them anywhere near my code, and I don't want to be anywhere near theirs.
 
@LightnessRacesinOrbit I was actually adopted, and after that joke, I now feel a bit 'off' about some of the clubs I've been in :(
 
I can complain about anything!
 
You don't use Y. You abstract it and shut the hell up.
 
9:33 AM
@CatPlusPlus lol
@R.MartinhoFernandes There's plenty of those around.
 
@TemplateRex for the last time, if you really want nice algorithm for a dense set of integers, look at keithschwarz.com/interesting/code/?dir=van-emde-boas-tree
 
user1804599
@Rapptz C++
 
@R.MartinhoFernandes Oh I abstracted it in my code, but that doesn't mean I can' t complain about having to do that work myself
 
@TemplateRex then hire programmers to do it for you
 
@nightcracker I have seen that and it doesn't apply to this problem
 
9:35 AM
@TemplateRex huh? I thought you wanted a dense set of integers
 
user1804599
@R.MartinhoFernandes haha
 
huh 4 years after the fact?
 
Makes no sense.
 
Ell
g
oops
 
9:37 AM
@R.MartinhoFernandes more surprised it gave you 70 upvotes
 
it's a google bait question, i,m surprised he didnt get more
 
@nightcracker Well, it's been over four years.
 
btw how does manual bounty awarding work?
 
@CatPlusPlus You click on a little box next to the answer and it is given away.
 
What did I do wrong here (more specific than: "get too complicated", "use C++"): coliru.stacked-crooked.com/…. If I pass a character string as a file name, I get a seg fault (which disappears if I eliminate the delete).
 
user1804599
9:39 AM
Hmm.
 
It took a while for my mind to correctly process: "Jerry Coffin: What did I do wrong here (...)"
7
@JerryCoffin Where do you pass such file name?
 
@R.MartinhoFernandes maybe someone was really happy with your answer
 
I'm gonna give you a bounty for your lowest scoring answer.
2
 
@R.MartinhoFernandes At the end, where it's currently passing std::cout and std::cerr, it'll also accept something like /log/whatever.txt or (on Windows) `c:\\path\\log.txt"
 
I'm still surprised that gcc doesn't optimize this: coliru.stacked-crooked.com/…
 
9:42 AM
When compiled with VC++, passing a string works fine, but when compiled with g++, I get a seg fault (on either Windows or Linux).
 
user1804599
Django y u no multi-column primary keys.
 
@JerryCoffin Can you pass a pointer to an uninitialised buffer on the ostream ctor?
(meaning logstream(pack&...p) : std::ostream(&log), log(&outputs))
 
@CatPlusPlus An act of generosity? Are you ill? :P
 
Though I guess that would not be an issue only with the strings.
@Borgleader It's not generosity, it's pissing me off.
 
@R.MartinhoFernandes I think so -- it's a valid streambuf, even though it won't write to anything until some other stream bufs are added to its output.
 
9:47 AM
@R.MartinhoFernandes Getting rep pisses you off? Dafuq
 
@StackedCrooked is there a time limit on snippet execution on coliru?
 
@Borgleader I would say more the fact that really its unwarranted.
 
Even then, I mean... minor annoyance ok maybe but being pissed off? nuhuh
 
@JerryCoffin It's not valid because it only gets initialised after the ostream ctor runs (but as I hinted, I don't know if that ctor can work with that or not).
 
@R.MartinhoFernandes You've been so mad lately.
 
9:50 AM
apparently the lounge soothes him down - he probably becomes a hedgehog in the absence of us ...
 
Ell
Wtf.
I just got logged out for some reasson
Coliru needs a new logo
 
@R.MartinhoFernandes Hmm...I may have to give that a little more thought. You're right that it's not initialized at that point, but all I'd expect the iostream ctor to do is take the pointer you pass and save it for later use. I might have to trace through its ctor code to see if it's doing more though.
 
user1804599
 
user1804599
Fuck websites that change language.
 
user1804599
And fuck the idiots who create them.
 
9:55 AM
@R.MartinhoFernandes I should probably add: as long as the delete is commented out, it all works fine. It's only when the ofstream object gets deleted that things go wrong. Maybe I should just write better code using a unique_ptr (or whatever) instead of putzing around with new and delete.
 
Ell
@not-rightfold I can't play the video without a mouse :(
 
Reordering that initialisation does indeed remove the segfault coliru.stacked-crooked.com/…, but with UB lurking who knows :S
 
@nightcracker 20 seconds
 
dammit I can't get gdb to compile using mingw
I am so screwed , I will never get anything to work...
 
@StackedCrooked and we got threads?
 
9:57 AM
Why do I never find questions like robots 'ShowDialog' thing? I can't find anything to answer today.
 
@Borgleader Nah, it's the drawing attention to the boring answers.
 
@StackedCrooked lol I should make a stress test :P
 
@MartinJames Remember that that one was four years ago.
 
@R.MartinhoFernandes That actually makes sense
 
@ScottW I need to see the answer first.
 
9:59 AM
@ScottW I answered his question, are you proud? ;)
 
@Oleksiy GCC 4.8.1 is more helpful: error: conditional expression between distinct pointer types ‘Rect*’ and ‘Elipse*’ lacks a cast i.e. you have to explicitly cast to get both operands to be of the same type. BTW it's spelt "ellipse".
 
@ScottW I'm so proud baby. :)
 

« first day (1039 days earlier)      last day (3904 days later) »