« first day (374 days earlier)      last day (4575 days later) » 

8:00 PM
@codemaker I assume you mean 32 bits. And that sounds absolutely disgusting lol
 
@LewsTherin the sa_data field is probably not accessed directly. bind probably casts the struct you passed in back to it's original type. If it doesn't, it knows the address of the data it want's in sa_data and accesses it using sa_data[0] sa_data[1] etc
@LewsTherin yes yes, I meant 32 bits :) 4 bytes.
 
@codemaker Ah thank you. I think I understand somewhat than before. So to summarize whenever we cast an address, it just says this address belongs to an object of the type it is casted to, although the compiler knows better..
 
@LewsTherin When you are done, could you just take a quick look at this
class Zoo {private: Animal animal; };

Zoo::OpenZoo() {
// Make a dog
animal = dog;
}
So there is no way of doing this? I can't understand it
I want the variable animal to be available to all functions
and I want a dog attached to it
 
@LewsTherin something along those lines. By doing the cast, you are telling the compiler that a pointer points to a different data type. Same memory address, different type. The compiler will then do whatever you tell it with that memory.
@BPDeveloper yes, you can do that. Just not exactly in the way you are trying to do it there.
 
Could you help me
 
8:04 PM
@BPDeveloper then what you really want is an Animal * (or one of the standard library's pointer classes).
 
@BPDeveloper then you probably have to make it public
 
@BPDeveloper if you want other things to be able to access the animal, you need to give them a way to get to it
@BPDeveloper make it public or provide an accessor
 
just the functions inside
the class
 
@BPDeveloper they can already access the animal
 
But how do you assign dog to animal?
 
8:05 PM
@codemaker Then it should be usable, but you need a pointer for it to work I think
 
Animal * animal; ..... animal = &dog;
 
@BPDeveloper but you want to make a dog. First animal needs to be a reference or a pointer. If you aren't going to assign it when you first construct the class, then make it a pointer.
 
@codemaker Thanks, it's a whole lot clearer :)
 
But would the animal pointer point to a valid dog when the dog gets out of scope?
 
nope.
 
8:07 PM
@BPDeveloper if it is a pointer to a dog object yeah
 
@BPDeveloper you are learning :). Allocate dog with new, then delete it in the destructor. Initialize animal to 0;
 
once the dog's out of scope, that pointer effectively points to...who knows what.
 
@cHao it still points to the same location.
 
@StackedCrooked but you don't know what's there anymore, is my point.
 
yeah, just that it could be overwritten :( who knows
 
8:08 PM
@cHao probably the dog is still there. Naughty dog.
 
@StackedCrooked i don't like "maybe" or "probably". :)
 
@cHao :(
The two minute limit has passed for me. You win.
But your last move was very mean.
 
lol
l2thesaurus
brb
 
in all likelihood, in all probability, as likely as not, (very/most) likely, ten to one, the chances are, doubtless, no doubt; like enough (archaic).
 
when I use a member variable(a vector) in the capture list of a lambda inside a member function, it says that member is not a variable ... what am I doing wrong ?
 
8:12 PM
You forgot to say please.
 
please
 
Compiled with 0 errors.
See?
 
error: too polite.
 
warning: flattery is not appreciated
 
inquiry: who the hell you think you are. Meatbag.
 
8:15 PM
I usually fix compiler errors like this: g++ main.cpp 2>/dev/null || echo "Compilation successful."
Works every time.
 
@codemaker If he does that, he should prevent copying a Zoo, otherwise he will get dangling pointers and double deletes.
 
Or learn how to implement a proper copying.
 
@FredOverflow correct!
 
argh
I hate playing Terran
 
I would prefer std::shared_ptr<Animal> animal; and animal.reset(new Dog()) so I don't need a destructor.
Wait, one animal shared by different zoos, that doesn't sound right... :)
Is there such a thing as a "deep smart pointer"? :)
 
8:17 PM
@vivek post a code sample on ideone.com
 
@FredOverflow new? ಠ_ಠ
 
@DeadMG MMM! MMM!!!!
 
yeah
say that to the Banelings
 
@StackedCrooked Okay okay: animal = std::make_shared<Dog>(), happy now?
 
std::make_love.
8
 
8:19 PM
@FredOverflow yeah, that is ideal (or even a unique_ptr), but this is for his school work
 
@FredOverflow I never claimed new was wrong.
 
@CatPlusPlus std::make_love dangerous lol
 
@codemaker Why do most schools suck at teaching C++?
 
std::make<std::love> is more generic
 
@DeadMG I don't play sc2, but I used to watch replays on youtube. What race do you usually play?
 
8:19 PM
and more eew too.
 
@FredOverflow because c++ is hard. And because most schools suck.
 
Terran
 
@DeadMG lol, but you hate playing terran?
 
I'm gonna implement std::make_love
lol
 
std::syphilis can't be moved, it is always copied. Anyone know why that is?
 
8:21 PM
@FredOverflow because c++ is hard, and because it started its life as "c with classes"
and a lot of people still treat it that way
 
@StackedCrooked C++ has the protected keyword, you know?
 
@FredOverflow and you say that now!?
 
@FredOverflow I had to star that lol
 
@StackedCrooked Have you tried Penicillin?
 
lol
 
8:23 PM
No, my sister is allergic to it.
 
@StackedCrooked Did someone contract an std from someones family member?
 
Don't be so explicit man.
This is not to be discussed in public.
 
2 keywords there :) explicit and public lol
 
@FredOverflow AbstractMe contracted it from AbstractMe's AbstractSister instance.
 
@LewsTherin Pretty sure that was the point.
 
8:26 PM
Two nodes that share the same parent node shouldn't produce child nodes because it leads to undefined behavior.
 
@FredOverflow also, schools try to teach c++ to people with no programming experience with out teaching them any general programming concepts. They are bound to fail.
 
@FredOverflow he didn't "codify" explicit
oh he must have edited it
 
3 mins ago, by StackedCrooked
Don't be so explicit man.
@LewsTherin "edited it" sounds funny when you repeat it very fast.
 
@FredOverflow It makes looks like you have an epileptic seizure.
 
Anybody wanna learn Quicksort or other sorting algorithms? :)
 
8:29 PM
@FredOverflow yeah, I thought explicit looked normal last time I checked....
@FredOverflow ha ha did you actually try that?
@FredOverflow Keine, danke!
 
Is it sort of like a quicky?
 
Why are you so focused on sex-related topics today?
 
ha ha
 
I don't know. You give me something to think about.
 
8:32 PM
I just produced a test case to show a problem, only to find out that it works in my test case
meh
 
It compiled there, but gave me an error in VS2010
 
aaaargh
was so close to winning this game, but screwed it up at the last second
 
c++ is a messy language
 
@Messi How do you figure?
 
@Messi appropriate username there
 
8:36 PM
@vivek hmm, in your test case you don't need to capture grid. But maybe try capturing it using puzzle::grid. Not sure.
 
tried it alredy
I'll post a SO question
 
@vivek good luck :)
@vivek might be a VS2010 thing
 
@codemaker seems so
 
@codemaker I like Terran units and Terran abilities. What I don't like is how they fit into the game.
 
8:40 PM
lol @ MergeSort
 
specifically, Terran has the slowest-ass production you've ever seen
you have to make 1billion buildings, and they all need to be added on to
it's so slow
 
bubble sort sounds kinda like pac man
 
@DeadMG i see
 
lol
 
> thats exactly how i imagined bubble sort to sound
> i find this hard to masturbate to
lol
 
8:41 PM
and for example, against Zerg
you have to watch every micron of the map for Mutalisks, every second
also, you have to make units and workers constantly too
and then you can move on to the actual interesting strategy
the game desperately needs a repeat build button
 
so why does VS2010 not complain about the problem here and ideone does?
 
I don't want to practice up to 500 APM before I can use Tanks to kill Banelings
wtf am I going to do in the meantime?
@TonyTheLion As an extension, VS can bind mutable lvalue references to rvalues.
 
@DeadMG oh, but if I do that and then change the bool inside the struct block the result is that the bool isn't changed when the function leaves right?
 
well, you're mutating an rvalue
 
8:43 PM
awesome!
 
fundamentally, unless block has reference semantics, then doing so is meaningless
you';re doing a write to memory you can never read
 
pretty much...the block you get back from get_block is a copy of the original, so yeah. you'd have to return a reference
 
@cHao right I see
 
rvalue can only be bound to const-reference in C++03.
 
@StackedCrooked what? no
 
8:47 PM
yes, absolutely
 
Am I wrong?
 
no, you're totally right
rvalues are forbidden from binding to mutable lvalue references
that's still true in C++11
 
Standard C++ has always allowed const std::string& r = std::string("hello");
That is an rvalue bound to a const-reference.
 
yes... that disputes what any of us just said how?
 
Indeed.
 
8:48 PM
he said "Rvalue can only be bound to const reference."
 
He makes it sound like it wasn't possible to bind an rvalue to a const-reference prior to C++03.
 
no
unless you misread it, then I don't see how you could possibly read it any other way than the correct way.
 
Oh wait, now I get it :) He meant "only to const-reference (but not to non-const reference)". I thought he meant "only ... in C++03 (but not in C++98)".
 
The hazards of natural language processing.
 
8:50 PM
So yeah, C++03 only allows binding rvalues to references-to-const :)
 
does applying operator++ to a iterator returned from std::find invalidate it?
I wouldn't have thought so, but just checking
 
What kind of iterator?
 
vector<T>::iterator
 
Then no.
 
cause I'm applying std::find to a vector
 
8:51 PM
Inserting or removing elements invalidates vector iterators.
 
And why do you apply operator++ to the result? Show us actual code.
 
right
hmmm
so when the hit_bottom bool is true, in my block struct, then I want the current_rect to be the next item in the vector, so I find the current one, and move one down.
block& tetris_canvas::current_rect()
{
	if (current_r.hit_bottom)
	{
		std::vector<block>::iterator found = std::find(rects.begin(), rects.end(), current_r);

		if (found != rects.end())
			current_r = *++found;

		return current_r;
	}
	else
	{
		return current_r;
	}
}
but my block that hits the bottom dissappears after this code in the if statement executes
so I think either this is wrong, or somewhere I've gone wrong
 
Why do you return the same thing in the true and false part? Can't you just move the return part out of the if?
 
I think you shouldn't store "hit bottom" as a variable. Prefer stateless approaches. (Implement a function that returns true if the current block is at the bottom.)
 
current_r is a block and rects is a std::vector<block>
@FredOverflow oh lol, my sillyness, didn't think when I wrote I guess
@StackedCrooked oh
 
8:55 PM
if (found != rects.end()) current_r = *++found; invokes undefined behavior if you find the last real element in the vector, because then you dereference the end iterator.
 
@FredOverflow valid point
@StackedCrooked I guess then I'd need a class that represents a block and knows about the canvas boundaries, or would you put that function in the canvas class?
 
How about bool tetris_canvas::colides_with(tetris_block) or something?
Anybody know this game? :)
 
@TonyTheLion No. Generally objects should not have knowledge of their surrounding class. So Block should not have a pointer or reference its surrounding grid or canvas.
In my code I have a move method that moves the block inside the canvas. Then it checks if the new position is valid. If no, then it restores the previous position.
 
So how do I get around in everyday life if you don't know my surroundings? Just kidding, good advice ;)
 
@StackedCrooked right, so I guess the obvious one is then to have it in the canvas class. Since I obviously need canvas data to check if the block went outside it's boundaries
 
9:03 PM
Yes.
 
hint: its boundaries, not it's boundaries ;)
OMG that Sumotori video always cracks me up :)
 
right. interesting, learning here :)
 
I think the English rules about "it's" and "its" are cruelly inconsistent with the general rules.
 
Just like C++!
 
Instead of "object.name();" the syntax should be "get object's name."
 
9:07 PM
Where do you get those crazy thoughts?
C++ does not stand for "Cobol++"!
 
@FredOverflow Recent exposure to AppleScript.
This is for example how you can implement an event handler in Applescript:
on adding folder items to thisFolder after receiving theseItems
     -- commands to apply to the folder or items
end adding folder items to
^ Sample from Wikipedia
Incredibly intuitive, isn't it?
 
That's certainly not the most concise syntax I've ever seen...
 
wow, what a pile of wtfery
 
Trying to make formal syntax close to English and "natural" usually results in a weird abomination.
Think SQL.
@FredOverflow Looks Toribash-y, only more hilarious.
 
9:35 PM
Hey, can anyone help me with a homework program really quick?
 
@OghmaOsiris go ahead, may be someone will
 
who is JOHN?
 
Well, here's the question I asked which has most of my code. I'm about to edit it to add all my code really quick.
0
Q: Why am I getting a EXC BAD ACCESS error when I try to impliment this dynamic array?

OghmaOsirisPlease let me know if I need to provide more/different parts of my program so far if what I've provided isn't enough. I'm still working on my program with the Airline class. The Airline class contains a vairable to an array of dynamic Flight objects. In the Airlines class I have (which can't be...

 
are we running out of Heros?
 
So I went to the dentist for the first time in 6 years. He had a lot of work scraping the "stone" of my teeth (I don't know how you call it in English, it's called "tandsteen" in Dutch). But apart from that I had no problems. No holes or anything. What a relief!
 
9:45 PM
Ok, I edited my question, if anyone can help :)
 
you know, I have an interesting idea
successful shows have theme tunes that don't suck balls
like Futurama and the early Torchwood
 
They've modified Futurama theme since season 6, though. The pre-films one was better.
 
Um, this might sound incredibly foolish, but what exact is a kernel?
@DeadMG Ugh Torchwood, too much sex in it, gay sex
 
what, gay sex is worse than regular sex?
 
@DeadMG I wouldn't know. All I know is it is immoral
 
9:58 PM
ohhh sex
lulz
 
@TonyTheLion ha ha
 
@LewsTherin Then you are not fit to be amongst civilized people.
 
@DeadMG Ha ha yeah of course. Because being gay is civilized, I wonder what your great grandparents will think of it.. anyways each to their own
What is a kernel? :(
 
why would I give a flying fuck what my great grandparents would think?
 
9:59 PM
@LewsTherin That's how you tell the difference between an UK show and an US one.
 
the overwhelming probability is that they were vastly less educated than me
and had much less opportunity to think for themselves
 
@CatPlusPlus the UK one is the one with Barrowman?
 
Also, nothing wrong with it. Though they did overdid the whole "we're an adult show" thing in season 1.
 
plus, they're dead
 
A bit.
 
10:00 PM
homosexuality is just as civilized as heterosexuality
 
@DeadMG Eh, no..
 
absolutely it is
 
How so? How the hell is that civilized, moral? It is unthinkable.
 
Also, Barrowman's character is from 51st century and is actually omnisexual.
 
@LewsTherin The fact that you can't think of it has absolutely no bearing on how civilized or moral it is.
 
10:02 PM
@CatPlusPlus Is the US one better? I watched the UK one but I just couldn't continue with it.
 
there's nothing immoral about homosexuality- it occurs in nature in animals just as much as in people
and principally
a pair of adults having homosexual sex has absolutely no impact on anyone else
 
Starz Torchwood is season 4. And it's a bit rubbish. Also, it has gay sex, too, so you won't like it.
 
so I struggle to see how it could possibly be immoral
 
4 or 5, I lost count.
 
also, Torchwood S4 has a shitty title theme
 
10:03 PM
@DeadMG No point arguing with you.
 
Children of Earth was better.
 
@LewsTherin That's because you hold an utterly irrational position
 
@CatPlusPlus the US always wreck good tv though don't they...
 
@LewsTherin A central piece of an operating system.
@LewsTherin It's the same guy behind it, so I don't really find that a good excuse.
 
@DeadMG Irrational? There is to rationalize that homosexuality is wrong, as is bestiality or incestuous relationships
 
10:05 PM
there's a big difference
 
Er, no.
We find bestiality wrong, because animals can't consent.
 
animals aren't really capable of understanding the ups or downs of having sex with humans
 
@CatPlusPlus right...
 
just like paedophilia is wrong because children aren't really capable of consent
 
And Incest?
 
10:06 PM
and incestuous relationships are wrong because any offspring have fundamentally flawed genetics and will likely have innumerable health problems
 
As for incest, it depends on community, really. It's mostly about probability of defective genes being passed on.
 
And homsexuality?
 
the European royal families are suffering from it even now, because they only inbred with each other for hundreds of years
homosexuality nothing
that's the thing
homosexuality is between two people who are perfectly capable of consenting, and it doesn't hurt anyone else
 
@DeadMG Really? Because it is bloody natural for a man and man to have sex. Jesus, that sounds weird
 
10:07 PM
@LewsTherin Absolutely it is. You can see it in animals at about the same rate as in humans.
 
What's "natural"?
 
sexual deviancy is a necessary and important function of evolution
else, how would new sexual traits be selected for if they're never expressed?
 
@DeadMG They are different, ugh. Yet you argue that animals can't give their consent
@DeadMG Your laptop you are using just magically appeared? Evolution? :O
 
uh
a bonobo having sex with another bonobo is totally different to a bonobo having sex with a human
of course laptops are a product of evolution
humans evolved to have large, competent brains and general-purpose hands with which to construct tools, because using tools was an evolutionary success
 
@DeadMG Did the first laptop evolve or was it created?
 
10:09 PM
a laptop is the same expression of that as throwing rocks
it's just more extreme
 
sbi
@LewsTherin You sound weird.
 
@sbi Because I am :)
 
sbi
In one of the two zoos in Berlin, a pair of two penguin males built a nest about 2(?) years ago. The caretakers slipped them an egg, and, IIRC, they successfully raised a chick.
 
beings (us) using their traits granted by evolution (hands, brains, social adaptations) to create tools (laptops)
the fact that the tool in question is a laptop rather than throwing a rock or a primitive spear is irrelevant
it's fundamentally a product of our natural circumstances
 
@DeadMG are you talking about Darwinian evolution?
 
sbi
10:12 PM
@LewsTherin If anything, homosexuality is natural. It occurs in all sexual species, it's frowned upon only by some individuals of one species.
 
Because until there is proof, there is no such thing
 
uh, you mean like, the massive fossil record?
 
I think that ends this discussion.
 
@sbi No man, it isn't. As someone said humans are just naturally sick and disgusting.
 
sbi
@LewsTherin Plonk.
 
10:12 PM
and the examples of evolution that occur all the time even on our short timescale, like in bacterial?
 
@sbi How so?
 
He means he added you to the ignore list.
 
I was seriously considering that too
 
Oh.. lol
Fair enough, whatever.
 
you have absolutely no rational objective arguments whatsoever and you won't even engage in a rational discussion about subjective feelings
 
10:14 PM
I don't ignore people, because then some discussion threads look weird.
With people replying to thin air.
I'm just too curious.
 
sbi
@CatPlusPlus Yeah, I know better things to waste my time with than someone who argues that homosexuality is not natural and evolution needs any more proof than what the natural history museums are packed with up to their roofs.
2
 
@DeadMG Why should it be rational? What's rational about same sex having relationships? :S
 
I explained that thoroughly
 
What's not rational about it?
 
it's rational because sexual deviancy is an evolutionary advantage
 
10:15 PM
Relationship is not natural, it's a society construct.
 
therefore, it's perfectly rational that varying members of a species have varying sexual habits
 
Yeah humans have the capacity to act out intense acts of violent, or to rape a beautiful woman. Sure, I'm just gonna do it because it is natural
Is that rational enough for you?
 
sbi
@CatPlusPlus Actually, that's not the whole truth. Animals have relationships, too. But then they also live in societies, so...
 
It's more natural than what you're arguing for, which I presume are monogamous male-female relationships.
 
@CatPlusPlus That's not true. Those evolved.
because proportionally, human children take up a very large proportion of our lifespan to raise successfully
or some such pressure, I can't quite remember
anyway, we know they evolved
 
10:18 PM
Well, I'm certainly not an expert.
 
it's in the testicle size
promiscuous species, the males have large testicles, due to sperm competition
 
Funny how topics evolve here.
 
lol
 
sbi
@DeadMG There have been non-monogamous societies who successfully raised their children.
 
monogamous species, they have small testicles, because there's no competition
humans, proportionally, have testicles that are currently shrinking
 
10:19 PM
Except it's not really in our insticts to be monogamous.
 
suggesting that we used to be promiscuous and are now trending to monogamous
 
Maybe it's ongoing change.
 
sbi
@DeadMG Yeah, indeed. IIRC, we have the largest testicles (relatively to size) among the great apes. And chimps are very promiscuitive.
 
I need more tea.
 
@sbi True. But we only really have records of that post-civilization, which I think removes that pressure anyway.
@sbi Really? The documentary I watched said that human testicles were very much in the middle.
 
sbi
10:20 PM
@DeadMG I can't parse that.
 
I'm more of an expert on TV shows.
 
You can't know if fossils raised their children successfully.
The only way to know that there are non-monogamous societies that successfully raised their children is for there to be civilized societies.
 
sbi
@DeadMG I might be wrong there. It might be that chimps have bigger ones than we do. It's years ago that i read this. Looks at his bookshelf If I only knew where.
 
But those don't exactly have the regular evolutionary pressures.
for example, human evolution, I would guess, must be increasing at an insane rate
because there's, relatively, no pressure to kill off what would previously be "unfit" individuals
 
@CatPlusPlus As am I, in a way.. Do you watch Fringe?
 
10:25 PM
No, though that's on my TODO list.
I don't really have time lately.
 
sbi
@DeadMG That's wrong. There have been, in historical times, people who lived non-monogamously. Scientists have been among them, and described those societies. For example, ISTR a society on a Pacific island where always all sisters of one family would marry all brothers of another family. Obviously, they successfully raised their kids, and I'd be surprised if those kids didn't have a heck of a better childhood than those being raised in a monogamous Western 3-person family.
 
@CatPlusPlus WHAT? GET OUT! lol. Oh you have to move it up the list dude!
 
historical times is still not our evolutionary path, relatively speaking it's only been a few thousand years
and the simple fact is that our ability to adapt our environment trumped most evolutionary pressures about 20,000 years ago, or somewhat previously
mostly being when we spread around the world to all kinds of climates, and places, that would normally be inaccessible to an ape like us
 
sbi
@DeadMG Yeah, but societies living in different ways than what we are raised in shows that monogamous families is not the necessarily one and only way for us to live.
(Not that I'd want anything else, mind you, but I don't think my ideas are better than other people's. They are just mine.)
 
of course it's not The One and Only Way™
but of course, evolutionary pressures are more generic
but also, those evolutionary pressures became kinda invalid ever since we became societies
 
sbi
10:30 PM
@DeadMG No, they didn't, although their role has somewhat diminished.
 
well, I think that individual societies living with other social orders is not indicative of the general trend
 
sbi
@DeadMG No, it's not. It only shows that humans are flexible enough to live in other forms of societies than the ones we live in.
 
true
if there's one thing that humans have demonstrated, it's a vast flexibility
no other species exists in the same environment range as us
even before we invented technology more advanced than "wear the skin of another animal"
 
11:32 PM
lol
 
lol
ten! nine and so on! three! two! one!
 

« first day (374 days earlier)      last day (4575 days later) »