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

5:00 AM
getting gene therapy as an assignment for a class seems kind of extreme
 
@LightnessRacesinOrbit Where's the erase?
 
@LightnessRacesinOrbit moving the ++iter to the body did not remedy my problem
 
sounds like a dumb assignment. Is this supposed to teach you something?
 
@Cinch sorry, insert. same issue.
 
Interesting class
 
5:00 AM
@LightnessRacesinOrbit Oh so the vector iterator becomes invalid once you insert.
 
@MichaelMitchell then you did it wrong
@Cinch yes
 
you don't actually do it, you just think of something, look for any scientific experiments that indicate your shit is actually plausible and crap
and you need something original -.-
 
Oh that makes a lot of sense.
 
i will find a better question cos i forgot you do insert not erase
 
5:01 AM
oh, lol, I see
 
the problem is the same but the solution subtly different
 
nvm I don't see
 
@MichaelMitchell It compiles and works on me computer
 
you could figure it out if you thought about it
@Cinch that means nothing
 
5:01 AM
@LightnessRacesinOrbit The problem is that he modified the array.
I see.
I didn't know that about iterators.
 
I need to set the iter to the reverse_iterator of the returned iterator of insert
 
ah fuck it I can't see a decent question
read this, spot the return type
and go from there
 
@LightnessRacesinOrbit I read the other reference.
 
@MichaelMitchell there you go :P be careful not to let the for prelude immediately iterate it! or you might iterate past end
 
Basically if it reallocates iterators all die.
 
5:03 AM
Guys do I need any experience in C to understand the book "understanding the linux kernel"
 
199
Q: Iterator invalidation rules

Lightness Races in OrbitWhat are the iterator invalidation rules for C++ containers? Preferably in a summary list format. (Note: This is meant to be an entry to Stack Overflow's C++ FAQ. If you want to critique the idea of providing an FAQ in this form, then the posting on meta that started all this would be the plac...

 
@khajvah Um yes?
 
@khajvah linux kernel is written in C, so presumably yea
 
It's like saying you can understand OpenGL without understanding C or C++.
You can until you hit C or C++.
 
@khajvah The summary doesn't make it clear. I typically assume yes, but that's not guaranteed.
 
5:04 AM
Says the guy that has never done real OpenGL before, oh joy
 
c++ might get you by
just write really shit code
it's perfect C
 
I mean i know c++. I hope with google i will be able to read C
 
I love how my iterator invalidation Q&A has fucking downvotes. people are little shits.
 
I dont need to write any C
 
@LightnessRacesinOrbit how many?
 
@Blob 9 on the question, 2 on each answer
I would enjoy disembowelling each downvoter
 
lol wtf
2 answers on your own question
 
ppl r jealous
 
OP
 
5:06 AM
@Cinch This is not from reallocation causing iterator invalidation. If it was, it would be trivial to solve by simply calling reserve with the correct size before doing any inserts. As you can see here, that doesn't fix your problem though.
 
one for c++03 one for c++11
standard (literally)
there's a question with like 10 answers by the same guy. nothing wrong with it
 
@JerryCoffin So is it just because the vector was modified?
 
@Cinch I just linked you to an explanation of when and why
Why the fuck did I just get kicked? I did nothing at all.
/cc @R.MartinhoFernandes @Xeo
 
kicked from where?
 
I smell the distasteful stench of power abuse
 
So it states that if you erase it moves everything
 
6 mins ago, by Lightness Races in Orbit
199
Q: Iterator invalidation rules

Lightness Races in OrbitWhat are the iterator invalidation rules for C++ containers? Preferably in a summary list format. (Note: This is meant to be an entry to Stack Overflow's C++ FAQ. If you want to critique the idea of providing an FAQ in this form, then the posting on meta that started all this would be the plac...

plz2read
 
I did.
 
@LightnessRacesinOrbit You consider: "I would enjoy disembowelling each downvoter" to be "nothing at all"? What in the world is wrong with you?
 
5:11 AM
So why would a reverse be affected by an insert
 
ok read again then ;p
@Cinch the reverse has nothing to do with it, I told you that already
@Cinch the loop is powered by an iterator and that iterator (reverse or otherwise, it being reverse is irrelevant) is potentially invalidated by the insert
 
ARGHHHHHHHHHHHHHHHHHHHHHHHHH
 
as says the link I've given you twice
 
i found a relevant SO post
199
Q: Iterator invalidation rules

Lightness Races in OrbitWhat are the iterator invalidation rules for C++ containers? Preferably in a summary list format. (Note: This is meant to be an entry to Stack Overflow's C++ FAQ. If you want to critique the idea of providing an FAQ in this form, then the posting on meta that started all this would be the plac...

 
5:13 AM
@Blob No, you didn't. As I've already pointed out (and demonstrated) iterator invalidation is not the problem here. LRiO is just plain wrong on this one.
 
Ugh.
 
@JerryCoffin i'm not following the discussion. LRiO's wrong?
well damn
 
I am certainly not
 
Wait a minute.
 
here's the new relevant SO post
369
A: Fastest way in C to determine if an integer is between two integers (inclusive) with known sets of values

Jerry CoffinThere's an old trick to do this with only one comparison/branch. Whether it'll really improve speed may be open to question, and even if it does, it's probably too little to notice or care about, but when you're only starting with two comparisons, the chances of a huge improvement are pretty remo...

 
5:14 AM
But if you wish to believe some old man rather than references to the standard, go right ahead
I'll go to bed now since I'm inevitably about to be kicked again
Good luck folks
 
The reverse holds the iterator to the one at the end-ish. But if you use the base iterator to modify the existing one, the reverse itself it invalidated by the operation.
 
7 mins ago, by Jerry Coffin
@Cinch This is not from reallocation causing iterator invalidation. If it was, it would be trivial to solve by simply calling reserve with the correct size before doing any inserts. As you can see here, that doesn't fix your problem though.
 
@JerryCoffin Then what's that caused by?
 
this seems to work
i didn't read the rest of the code, though
 
@Cinch I haven't figured that out yet--but it's most assuredly not from the insert invalidating iterators, as LRiO has been claiming. If you really want a reference to the standard saying that the reserve I inserted will prevent reallocation from happening until the size exceeds the reserved size, I can provide that (but rest assured, I know the standard at least as well as LRiO does, and more importantly I know what parts to look at when).
 
5:16 AM
no one gonna say goodnight? :(
 
@LightnessRacesinOrbit cya
 
@LightnessRacesinOrbit nite
 
@JerryCoffin well it appears it's due to the reserve.
 
http://coliru.stacked-crooked.com/a/cfee65f59dba14c1
http://coliru.stacked-crooked.com/a/1fbe013958d4d37f
 
i don't know what this implies. please fight to sort this out.
wow @Cinch plis no code steel
 
@Blob Oh I know.
@Blob Well it's yours.
there credit.
 
i ctrl-f'd reserve, added +100.
 
But @JerryCoffin I think it is related to reserve. All Blob did was reserve enough space to insert the other array into the current one and the array is not changed while the iterator changes and adds to it.
Therefore it is a reserve & allocation and iterator devalidation issue
@Blob +5 man.
 
5:20 AM
urgh
why do i feel so shit
oh wait, i know
this fucking assignment
how can i do this assignment
why is no one here an expert on hypercholesterolemia
 
@Blob What's the problem?
 
just do the gene therapy
 
@MichaelMitchell that only works for things like English
you don't just say "gene therapy" and end the paper ;_;
 
you do the retro virus in the needle
and then you stick it in the person
and ???
then profit
 
5:22 AM
all over the body in every cell?
sure
 
if (istream >> character)
Does this have any meaning?
 
i really just wanna shove some shit up their blood to destroy the ldl.
cyanide appears to be my only option at this point
 
actually, what if you just kill the patient
then they don't have to worry about it
 
26 secs ago, by Blob
cyanide appears to be my only option at this point
 
you can survive cyanide poisoning
 
5:24 AM
ok ima do ridiculous gene therapy crap
 
@Cinch Let me rephrase--the reserve I wrote should have been sufficient to prevent any reallocation from happening (according to the standard). Going to explore some more, but offhand it looks a lot to me like we may have found a bug in the standard library. That's a serious accusation, so let me quote the standard:
Remarks: Reallocation invalidates all the references, pointers, and iterators referring to the elements in
the sequence. No reallocation shall take place during insertions that happen after a call to reserve()
until the time when an insertion would make the size of the vector greater than the value of capacity().
 
can i be famous please
i did the ctrl-f "reserve" and +100
thanks
 
@JerryCoffin Sigh...
I just want to do HW and not fix the SL
 
@Cinch Yes--it attempts to read something, then checks whether that attempt at reading was successful.
 
@JerryCoffin But doesn't it just return the value of the ifstream&?
 
5:27 AM
i have a stupid idea: use gene therapy to mess up some genes in some area of the liver so to reduce cholesterol production
so it doesn't have to be perfect
just needs to not mess up other genes
and hopefully not become cancerous because you fucked up something major
 
@Cinch yes, it checks the stream state
 
@Blob Wtf is this HW assignment, creating Alien?
 
@Cinch no, curing hypercholesterolemia
this damn disease
I WOULD HAVE HAD A DAMN CURE
IF FGTS DIDNT STEAL MY IDEA YEARS AGO
fuck pharmaceutical companies
 
Why not just use a chemical to react with cholesterol? Or something.
 
which one?
pcsk9? already taken
 
5:29 AM
cyanide \o/
 
IDK I'm not a chem major, I'm a Comp E major
 
@Blob Your prof is either dumb or you've misunderstood the requirements
 
@Pris i'm not. she's not.
this shit is legit.
 
You said it yourself you don't even have to really do anything
 
Either you find a natural way where you control how much chl. you destroy by the input or you create a system to do such a thing.
 
5:30 AM
yes. a "plausible" cure given current understanding of crap.
 
Its absurd to come up with some magical innovative solution to a disease
 
The plausible cure would be to find a chemical to react with the chl. and nothing else that is vital to the body (which may or may not be hell).
 
@Cinch Yes, but can be converted to something that evaluates to true if the stream state is still good, and false if the stream is in a failed state.
 
Another way is to use nano-robotic tech to do it.
 
i doubt she expects it to work
she probs just wants us to think properly
 
5:31 AM
@JerryCoffin I thought the flag is set, and the ifstream remains in a valid state?
Therefore wouldn't I check the flag?
 
she's been teaching this course for at least 10 years
 
@Cinch It's still valid (i.e., you can query its state and such) but after a conversion has failed, it'll still convert to false in a Boolean context.
 
@JerryCoffin it will? point me to the ref?
 
daaaammnit
reducing cholesterol production by attacking the pathway that makes it?
fucking statins already do it
i'm just going through wikipedia paragraph by paragraph trying to think of ways to fuck it up
 
@Blob Oh god that's a bad idea.
Why would you attack a system that's perfectly fine?
The problem is the oversaturation of stuff not the system that creates it.
 
5:37 AM
because its end result means person dies early?
 
@Blob Just neutralize what's there.
If they're producing too much then cure that.
 
@Cinch that's what "attacking the pathway" does
prevent too much LDL production
 
@Blob what class is this?
I only have AP chem exp.
 
@Cinch "Human Genetics"
not a chem class
 
Okay you're doing genetics, you win.
Wait, what's the prior chem exp needed?
 
5:39 AM
none at all.
it's a bio course.
 
Then how the hell do you solve a chemical problem related to biology?
 
§27.5.5.4:
explicit operator bool() const;
Returns: !fail().
 
Solving chelestrol is a bio + biochem problem.
@JerryCoffin Oh, thank you.
 
you learn the biochem necessary
you just pretend all the chem part is really simple
 
what level of class is it?
 
5:41 AM
dunno how to qualify "level"
 
@Cinch FWIW, in older versions of C++ (pre-C++11) that was implemented as a conversion to void * instead.
 
what are the prereqs for the class?
 
the prerequisites are very light but the teacher is known for her ridiculous workload, so most people don't take it
she's a great teacher, though
let me check the prereqs
 
Interesting.
But she's asking you a professional-level problem by asking you to solve LDL over-saturation.
 
yes.
 
5:42 AM
How can she expect a good answer from students who don't even know how to do biochemistry?
 
she encourages people to drop, too.
 
is it not possible to filter the blood externally?
 
@Blob She sounds like the sort of teacher who builds Stanford people.
 
@MichaelMitchell it is. i need an "original" solution, though
 
though ldl is relatively small to other things in blood
 
5:43 AM
@Blob Define "original"
 
that type of thing is already being done (LDL apheresis)
 
oh wow
 
@Cinch not currently being used
 
Why do something "original" if something else is proven to be better and works?
 
I am smart, time to switch majors
 
5:43 AM
@MichaelMitchell lol
 
I guess bio 101 is all you really need
 
@Cinch because it's a course to teach us crap, not to cure diseases
 
@Blob Idk, nano-bots.
 
i haven't done anything productive in the past 2 hours. i only have a limited number of hours before i needa go to school D:
 
Use nanobots that can recognize the chemical composition of chelestrorol and navigate the bloodstream (preferably programmed in C++)
 
5:45 AM
@Cinch I've reread the code, and realized what the problem is. It's not with the standard library after all. If we look at the result with the larger resize: "10, 3, 2, 3, 2, 1," with some care, we see what I missed the first time: the 2 is being inserted into the target vector twice, so the result isn't just the sum of the two sizes, but the sum of the two plus 1. That's why adding 100 (or even 1) to the reserve call prevented the problem. My apologies for missing this.
 
@JerryCoffin you're welcome
 
@JerryCoffin Whatever that wasn't my problem lol I'm doing sudoku solver.
@MichaelMitchell But you should tell this guy
 
so @MichaelMitchell, can you think of anything else?
you got this
note that most cholesterol production and LDL absorption by cells occurs in the liver
plis think of something
 
lol
so how does ldl diffuse throught the cell membrane
does it need to be actively transported in there
 
@Blob Thank you. And although he's left for now, my apologies to LRiO as well: he was entirely correct.
 
5:47 AM
@JerryCoffin Isn't it she?
 
lol
 
@MichaelMitchell yes. LDL receptors transport them
the most common cause of FH is defective LDLRs
caused by mutations in the LDLR genes..
 
@Cinch No--despite the avatars, LRiO is really a he.
 
perhaps you can figure a way to make something bind the ldl such that it can be filtered through the kidneys and urinated out?
 
@JerryCoffin I could've sworn that hish talked like a she.
 
5:48 AM
or is the molecule to large to be filtered in the kidneys?
 
uh
no idea
 
@MichaelMitchell It gets stuck in the blood passageways.
 
i think it's small
oh yeah that too
 
It sticks to the walls and clogs and boom.
 
back to wikipedia
 
5:49 AM
lol
im still thinking
of a really dumb solution
 
@Cinch Well, I haven't actually met in person to confirm, but there have been pictures posted that were supposedly really of the person in question showing a beard.
 
what does the body use ldl for?
cell construction?
 
@MichaelMitchell who fucking knows. probably something stupid like some form of communication. probably activates/deactivates genes or some crap
lemme wikipedia it
one sec
 
@MichaelMitchell I believe it's for transporting fat to cells to let the fat be burned.
 
@Blob I think it uses it to transfer fats.
It's in the first paragraph of LDL
 
5:51 AM
lol k
i don't read the first few paragraphs
meh, if they can't take in the ldl anyways, no point
so right now attacking the liver seems promising
do people need livers to survive?
 
@Blob Yes--very much so.
 
pussies
 
so, the ldl that sticks to the arteries, does that ldl have fat attached to it for transfer?
 
@MichaelMitchell it's a lipoprotein, so it's partially made of fat.
lipo part being the fat
 
so ldl does not attach to a fat, it is the result of another molecule attaching to a fat
lol
 
5:54 AM
So in other words, LDL is bad because it can clog the interface between cells and the bloodstream.
Oxidized LDL is bad.
 
what if we can attack the molecule that binds to the fat to form ldl
 
@Cinch it can clog the blood. blood no flow good. sections of body no get blood. they die.
specially bad if heart's blocked off
coronary arteries no get blood
heart die
u die
 
this kills the person
F
 
Apparently LDL can also be good though because it reacts with free radicals.
 
unimportant currently
 
5:56 AM
@Cinch people with FH have bigger concerns
 
FH?
 
familial hypercholesterolemia
 
Hm.
 
ima go with attacking the liver. cya in a bit.
 
Well if you're in a genetics class, there's something wrong with the system and not their diet.
 
5:57 AM
gotta do productive stuff
basically wasted 2 hours
 
Wait.
 
@Cinch diet plays a huge role.
 
First you pinpoint whether it's the person or the diet.
 
it's both.
 
Very-low-density lipoprotein (VLDL) is a type of lipoprotein made by the liver. VLDL is one of the five major groups of lipoproteins (chylomicrons, VLDL, low-density lipoprotein, intermediate-density lipoprotein, high-density lipoprotein) that enable fats and cholesterol to move within the water-based solution of the bloodstream. VLDL is assembled in the liver from triglycerides, cholesterol, and apolipoproteins. VLDL is converted in the bloodstream to low-density lipoprotein (LDL). VLDL particles have a diameter of 30-80 nm. VLDL transports endogenous products, whereas chylomicrons transpo...
 
5:57 AM
@Blob Why not write something about the fact that cholesterol is a precursor to vitamin D. Sunlight (among other things) helps that conversion, so simply getting outdoors during the day and exposing oneself to sunlight helps lower cholesterol and increase vitamin D (both generally believed to be good things). Only problem is, this isn't exactly original. Maybe something about an artificial replacement for sunlight?
 
Then test whether it's one or the other.
 
@JerryCoffin does LDL really work like that? :|
 
You can test this by changing diet.
 
@Cinch ?
it's both
chinese heterozygotes for FH who eat chinese stuff aren't really affected much
 
It IS both but the percentage of cause is often not equal.
 
5:58 AM
what if we slow VLDL production in the liver
 
chinese heterozygotes who live in western countries and eat western food are very affected
 
then there is not enough material for more LDL to form
 
@MichaelMitchell potentially dangerous.
 
we can't just make all the heterozygotes move to china and adapt to their lifestyle
 
5:59 AM
You could cause other problems.
 
@MichaelMitchell that's what i'd like to do c:
 
so what
it solves this one
 
@Cinch screw them.
and anyways
cya
 

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