« first day (1615 days earlier)      last day (3341 days later) » 

4:00 AM
k just to underline, you’re not too far off. So far you have decltype( &Derived::Init ). I’m suggesting you tweak what’s inside the decltype, but it’s still about Derived, Init, and std::shared_ptr<Derived>.
 
Anyone from Frankfurt here? Heard your side is burning ... kinda
 
4:14 AM
What did Siri's self-programmed automated script for "Do you know ___?" output?
 
@Blob I dunno. The more I read about cholesterol levels, the less certain I am that the levels they talk about necessarily mean a whole lot at all. The science involved in quite a few of the studies seems to be pretty weak.
@Cinch Why would I care?
 
"i Know"
 
@JerryCoffin i don't care about the science at this point. i just want some damn way to destroy the damn LDLs in the blood. or maybe reduce production significantly.
 
4:16 AM
> Chess game that allows you to play in Human vs. Human mode
Weak
Why no CPU vs CPU mode
 
Someone wanted to do War.
 
Hello again, friends
 
@LightnessRacesinOrbit hi mom
6
 
He says the Sudoku automatic solver is the easiest.
I would kind of agree
 
of course it is
 
4:17 AM
sudoku solvers are fairly easy
 
The algorithms are public so the hard part is just File I/O and clean code.
 
set theory and recursion \o/
 
I was thinking of doing that and another project with SFML... Hm...
 
@Blob The point is that reducing cholesterol, in itself, may not be a very good goal.
 
@JerryCoffin =o
 
4:18 AM
two stars for fuck all
5
 
I had an idea for a game where you had to find the complement of bits in a set amount of time paired with a point system; I'd call it BitOverflow
 
a better solution would be getting the LDL receptors working
 
why bits? why not something fun like trits
 
@MichaelMitchell Oh god no.
 
balanced trits?
 
4:19 AM
I could also try implementing a scripted Lua system that me and Puppy were arguing about earlier.
 
@LightnessRacesinOrbit gg. 1 now.
 
too late, star remover
 
Okay so if a sudoku solver is from 1 to 9....
 
4:25 AM
so, I am trying to insert a value into a vector using vector::insert and reverse_iterator::base(), but it will not accept the resulting iterator from base() saying that you cannot decrement an iterator :/
This is the StackO post that showed the use of reverse_iterator::base() in this case: stackoverflow.com/questions/300662/…
I assume my problem is the fact that I am incrementing the reverse_iterator before I call base() on it?
 
i can't read words
post a code sample and i'll try things and see if it compiles
 
@MichaelMitchell works fine
 
which i/o c++ functions are best
 
@Cinch Define 'best".
 
4:30 AM
@Cinch scanf and gets
 
@Blob damn you.
Best as in safest and best designed in terms of OOP, scaleability, etc.
Ease of use, ease of interfacing and interlacing with other functionality, etc.
Flexibility, etc etc etc.
All that good stuff
I'd assume fstream.
 
@LucDanton yeah, looks like a msvc thing :/
 
hmm
why does the man page for scanf not say "Never use scanf"?
gets's manpage does
 
> StackO
that's a new one
 
@MichaelMitchell Works fine with VC++ for me.
 
4:33 AM
maybe it is my specific case is derpy
ill look into it more instead of bothering you fine people
 
@Blob Decent question
 
@Blob Because the person who wrote the man page was ignorant or stupid?
 
i now have 5 hours 30 mins before i need to "wake up" and go to school
5 hours 30 mins to find a plausible cure
i don't think i can do this
i also need 2 page worth of content to add :|
 
btw how do you guys format your member init list?
 
@Cinch ?
 
4:36 AM
i currently put the colon on its own line
Grid::Grid(std::string path)
:
corrupt(false)
{
good? bad?
 
if it's long, one shit per line. if short, all in one line. colon on same line as first thing i initialize
comma goes in place of colon in subsequent lines
 
@Cinch Well, your choices are pretty much C-style FILE * based I/O, or iostreams. Between those two, iostreams are safer and more extensible, but much harder to understand, widely misunderstood, mostly very badly documented, and if you care about precise formatting, frequently so verbose it makes you want to shoot yourself rather that mess with that BS.
 
@JerryCoffin I do like the clean standard interface and its nice abstraction in comparison to fscanf or something
I need to do formatted streams so yeah.
 
Grid::Grid(const std::string& path)
   : corrupt(false)
{
   // ....
}
 
@LightnessRacesinOrbit you use a tab?
 
4:40 AM
@Cinch of COURSE!
why would you not
one tab = one level of indentation
undeniably semantic
 
btw what are major difference between const string& and const string
and string
 
and you can render it however you like
 
const is constant but i know
 
@Cinch r u srs
 
No I know
pass by copy, reference...
 
4:40 AM
read a book plz
then wot
 
I'm in class and he gives slides.
 
he gives olives with the gin
from the looks of it
 
For example, when would I not be able to provide a constant?
 
when you want to change it?
 
i.e. Grid("sudoku.txt");
There's a case where the compiler rejects that or something
 
4:42 AM
if you accept by value then what you pass and what you accept are two quite different things
 
It came up in my iterator class and my operator overloads yesterday
 
yeah
Grid::Grid(char* str) {};
you shouldn't be chucking a string literal at that
 
what's the danger?
 
if you were taught that at school then that's brilliant cos most schools get it wrong
the danger is that your program won't compile
 
Huh?
 
4:42 AM
because it's wrong
string literals are const and you can't just magically remove constness
you can initialise a non-const char array from a string literal but that's another thing that we won't bother with here now
for more information see every question on SO ever
 
@LightnessRacesinOrbit It only gives a warning.
 
in old compilers maybe
 
g++ 4.9.1
 
in C++03 mode?
 
most likely
 
4:44 AM
old.
 
g++ 4.9.2
sorry
but it still compiles under c++11
 
I'd suspect you'd have to do -Wall
 
oh fuck you GCC it does
4
well it shouldn't
 
@LightnessRacesinOrbit Hm.
It doesn't compile on Coliru but I think that's because it gives a warning.
regardless it's bad style but eh.
But where DO string literals reside in memory at runtime?
and are literals of
const type& or const type
?
 
4:47 AM
It was deprecated
I could have sworn the conversion was properly removed in C++11
but I can't get that proven in Coliru's GCC in either C++11 or C++14 mode
 
@LightnessRacesinOrbit I can on my Linux GCC C++11.
 
@Cinch you need to go look up implementation details. there are millions of SO questions about this, bud
@Cinch string literals have type const char[N]. Again, look up a damn question
 
So what's the difference between const type& and const type? Only passing value vs reference?
 
@Cinch you have literally just said it still compiles. now you say it doesn't. what.
@Cinch yes
 
Ah I see.
But what about returning?
 
4:49 AM
what about it?
 
So if I return a reference to a stack variable, it's bad because the stack variable disappears once it goes out of scope, like any other pointer-stack variable.
 
But if I return a copy, that's fine.
 
whatever "pointer-stack" means
 
pointer pointing to stack variable.
 
4:50 AM
right
well pointers are not references
but otherwise yes
 
References are often implemented as pointers though, I guess? They have the same function-ish, just slightly different meanings and semantics.
 
yes, yes and yes
 
Righty-o.
 
So if I am doing a copy constructor, it should return a reference I suppose?
 
4:51 AM
constructors don't return anything
 
Sorry, copy assignment
 
you will fail to compile if you try
yes
 
And what about a regular assignment?
 
conventionally, you return *this
from any assignment
you don't have to, per the language, but you should, per humanity
 
Hm.
 
Foo& operator=(const Foo& other); is good?
 
Interesting I had major problems with my code last time for an iterator class.
My prof is basically making us do STL from scratch.
 
teacher*
standard library*
otherwise yes
 
ok, I was able to recreate my problem: coliru.stacked-crooked.com/a/1fbe013958d4d37f
 
4:53 AM
No, STL containers
 
damnit
running out of time
 
@MichaelMitchell you can't mutate something you're iterating over, dude
@Cinch No, standard library containers
 
how the fuck does one come up with a plausible cure to some random disease overnight?
 
@Cinch Read : LRiO profile
 
4:53 AM
eggs have cholesterol
 
@Cinch STL is out of date by 20 years
 
@LightnessRacesinOrbit Oh okay.
Old online tutorials I guess.
 
don't worry though it's a common misconception. most teachers still call it "the STL". they're wrong. but fuck it.
@Cinch yes
@bluefog yes
@MichaelMitchell yes
 
wtf is the iterator.base() func?
 
4:55 AM
hmm, so what is a way to fix this? I am thinking of making a list of places to insert (calculate the offsets of course) and then do another loop to do the actual insertion?
gets the fwd iter from a rev iter
I think
 
@Cinch what is it with you and not reading the documentation -.-
 
@LightnessRacesinOrbit I just read it.
 
@Cinch take a reverse iterator and apply .base, you get the equivalent normal/forward iterator
he's providing a hint for insert
@MichaelMitchell see the link I just showed you
 
Yeah what's the problem with that?
 
4:57 AM
it's not a brilliant Q&A but
 
Shouldn't that point to the same thing?
 
@Cinch what's what problem with what?
 
@Blob how about exercise
thats a good cure
for fatness
 
@Cinch yes. that's why he's doing it.
the hint has to be a normal/forward, not reverse, iterator though
 
@LightnessRacesinOrbit Then what's the problem with the seg fault?
 
4:57 AM
@Pris i don't care about fatness. the thing's about familial hypercholesterolemia.
 
"you can't mutate something you're iterating over, dude" my stupid prof tried to do it once. I was facepalming. Ended up changing the university.
 
@Cinch entirely unrelated to .base
 
@Blob from what I remember reading about cholesterol, it is like 90% genetic, so perhaps you could suggest a sort of gene therapy?
 
and teacher specifically said it has to interfere and actually cure it
 
4:58 AM
@LightnessRacesinOrbit If the iterator points to the desired place, how does it seg fault if it's inside the vector?
 
@Cinch it doesn't
@Cinch .base has nothing to do with it
 
@MichaelMitchell gene therapy is haaard. something on the protein-level would be preferable. the idea i had is apparently already in use. i'm gonna resort to gene therapy soon if i can't find shit, though
 
Then what's the problem?
 
@Cinch the problem is that he is eraseing inside a loop over the same container. the it gets invalid as soon as the erase has occurred.
again with the read the fucking docs
3
 
@Blob what happened to you?
 
4:59 AM
@khajvah nothing. it's an assignment for a class.
 

« first day (1615 days earlier)      last day (3341 days later) »