« first day (1010 days earlier)      last day (3941 days later) » 

user142019
12:08 AM
> Note that, unlike in C, it's perfectly OK to return the address of a local variable; the storage associated with the variable survives after the function returns.
 
user142019
I wonder how they have implemented that.
 
@rightfold From what?
 
Oo visited 69 days in the past 2 months
 
user142019
@Mysticial golang.org/doc/effective_go.html under "Constructors and composite literals".
 
hmm...
 
user142019
12:10 AM
Maybe it allocates objects on the heap if the compiler sees you use their addresses.
 
gc
 
What do people do with Raspberry pi
maybe pointer counting is used
 
lol at the flag
 
once the address is returned, the pointer counter is incremented thus memory not destroyed
 
that's gc (or rather garbarge hoarding)
 
12:19 AM
if it can be used again, then it is not garbage
 
@Telkitty猫咪咪 missing several points
@rightfold I wager they could don something like making any returned reference implicitely (like) and output parameter. Then the caller is would automatically create the necessary anonymous variable before making the call.
 
user142019
@sehe How about go SomeFunction(&myLocal)? The go statement spawns a thread. Or someGlobal = &myLocal. Those are allowed too, and not UB.
 
This gets interesting when the process is repeated (e.g. function foo (returning a local reference) gets called by bar (which does nothing special) and by baz which returns the same reference. The caller of baz would end up creating a 'hidden' variable for foo's implicit output paramater.
 
Ell
What about recycling
 
@rightfold It also becomes slightly more interesting like that when the 'faux reference' is getting stored into an object with dynamic lifetime. In this case the variable will have to be "boxed" into a container with dynamic semantics as well. (Same thing in your threads example)
I think it could be done like this, and it would actually be not unlike simple AST transformations like those we know from (N)RVO. Quite similar indeed.
 
user142019
12:27 AM
Haha. play.golang.org/p/2746eWwpfF Look at that output.
 
user142019
Nice optimization.
 
user142019
play.golang.org/p/zAKo5Ff3Nq these seem to be both allocated on the stack.
 
@rightfold Yay for my hypothesis, then! Hidden "locals" (stack variables)
 
user142019
 
user142019
@sehe The butt.
 
12:30 AM
Ah, I was gonna say, I don't see the but
64 bit integers is not unweildy
@rightfold chat.stackoverflow.com/messages/10747976/history butttt you gottttt thatttt of course
 
user142019
Well, int is of implementation-defined size.
 
@rightfold and this implementation uses... 64bit (ORRR everything is refcounted :<)
 
@Telkitty猫咪咪 A lot of stuff, friend of mine is working on a greenhouse regulation system using one of those.
 
user142019
Or 32-bit.
 
I tried to buy one but they were always backordered
 
user142019
12:33 AM
@sehe Hmm, probably. It's 8 bytes on my machine. Can't test on Go Playground, though. play.golang.org/p/uJ4gfOMW6- :<
 
user142019
@sehe This is weird. play.golang.org/p/q6ZzLKJaN4
 
user142019
 
@rightfold How so? It needs to reserve two hidden variables (1 for foo and one for bar in the caller's stack frame)
 
user142019
@sehe Why 24 bytes?
 
user142019
Oh, there's probably something in-between.
 
12:41 AM
@rightfold d'oh
Anyways, it's starting to look more like gc to me: play.golang.org/p/fPFMc56doN
Note addresses are increasing, contrary to classic stack direction (growing downwards)
> For a discussion of legitimate reasons to hate metaprogramming, we suggest a different forum :)
 
user142019
1:00 AM
@sehe Go does have a GC but I'd be surprised if it allocated everything on the heap.
 
user142019
@sehe Go uses a segmented call stack.
 
@rightfold everything != returned local refs
@rightfold i.e. the stack is just a deque allocating from the (a) heap?
 
user142019
TIJD OM TE SLAPEN OF NIET sehe
 
user142019
@sehe Well yeah.
 
@rightfold Time to shout :/
 
user142019
1:01 AM
Otherwise you couldn't spawn a half million goroutines. :P
 
user142019
@sehe Ben jij niet moe als je op je werkt aankomt in de ochtend? :V
 
I intend to abuse faux polymorphic lambda instead of the local static_visitor in that answer of mine today. I'll go to bed after
@rightfold Soms
 
user142019
Well see you later. Later!
 
Slaapze
 
I asked this a little while ago on gamedev stackexchange , got no response , thought I might try to get one of you smart people to help me :P

http://gamedev.stackexchange.com/questions/59549/behavior-tree-implementation-details
 
1:04 AM
Give me a good reason not to bin that.
 
Hmm, do it if you want to , strange that you guys always forget people if they dont show up regularly :) I have been here on and off for a long time sehe (you helped me in the past) I am not just doing drive by questioning :P , sometimes you just need help and you turn to reliable resources
 
HUH. Why THE FUCK would you assume I might have forgotten you.
Of course not.
Does the word entitled mean anything to you? Assuming my motion to bin must be because I don't remember you is right in that alley.
 
Angry it seems :)
I assume that because I remember everyone getting all worked up about drive by questioning, people who have never been in the room dropping questions and leaving
 
@angryInsomniac Annoyed, yes.
@angryInsomniac And your question is just that: drive by linking.
Hello, by the way.
 
Hello to you too then :) It seems cat and martinho arent around today
 
1:10 AM
Not many souls aboard
 
I wonder why...
 
Well it is what it is, answer or bin I am not getting the answers that I need on SE it seems :P
 
@Jeffrey lol
 
1:22 AM
@ScottW <3 yay for eing grumy and not getting enogh sleep :)
 
I hate you for mentioning insomnia.
 
@CatPlusPlus love the additions to the profile pic cat :P
@CatPlusPlus Would it matter if I did not mention it ... you would still be up all night :P
@ScottW Try sleeping on the carpet with just a pillow under your head
 
But hey, Whose Line is back.
 
@CatPlusPlus yeah ! Wanted to watch that, have no TV sadly !
 
1:37 AM
0
A: Writing huge txt files without overloading RAM

JimMaybe flush output periodically?

dat answer
 
damnit I am getting shitloads of undefined references
 
@Borgleader Any sane implementation should be flushing periodically anyway.
Unless the user overrides it or something.
Although on Windows, funny shit will happen since the OS will try to cache to sector table. That can overrun your ram, but only if the file is on the order of terabytes.
 
I always cringe when I see answers that are like: "Maybe this?"
If you're not sure make it a comment.
 
@BartekB @kbok lol who needs polymorhic lambdas? I just used one defined on-the-spot: stackoverflow.com/questions/17768152/…
for(auto& p : names)
  boost::apply_visitor(make_visitor(
      [](Teacher const& v) { cout << v.salary << "\n"; },
      [](Student const& v) {}),
  p.second);
The trick: create overload sets using inheritance: ideone.com/fSobD8 (no boost tricks)
Winnie, that you yooh?
 
0
Q: Why does vector::pop_back invalidate the iterator (end() - 1)?

MehrdadWhat's the reason behind the fact that the end() - 1 iterator is invalidated after pop_back is called on a vector? To clarify, I'm referring to this situation: std::vector<int> v; v.push_back(1); v.push_back(2); std::vector<int>::iterator i1 = v.begin(), i2 = v.end() - 1; v.pop_back(); // i1...

 
1:51 AM
Is my answer not correct?
I got +1/-1
 
Lol
If it's specified this way, that's what we should write
 
@Borgleader Needs more facts other than "It's obvious why" especially when the question asks "Why?"
 
Why is: the element is no longer part of the vector
end() does not point to anything
its only there as a sentry
its like "hey stop here", not "hey heres an element"
 
STOP, you have violated the range
At least your rep is divisible by 5 again ^^
 
@LightnessRacesinOrbit might know more about this.
 
2:04 AM
bored and answered
I know the standard (C++) requires it, that's obviously why I posted the question. I was asking for the reason behind it. — Mehrdad 38 secs ago
 
yeah i saw
 
Going to VTC.
 
VTCed as well. He may as well ask the standard's group.
I also don't see the point of the whole question.
I mean to me the logic is pretty simple, you removed an element from the container, any references to it should no longer be valid.
@Rapptz: I don't get it. Isn't everything implementation dependent? How does this affect the "ease of implementation"? — Mehrdad 57 secs ago
 
FWIW I see his point against my closing.
 
If that were the case the standard would be useless
I doubt this will get 3 move close votes
 
2:18 AM
Doesn't matter :P
I provided my reason
Meh, look. Now I'm being blamed for that.
 
Youtube comments :\
 
He just read it wrong.
@Mehrdad Because all the other iterators are still valid they are still in the [begin, end[ range. Except for end - 1. Have you ever tried dereferencing end? Bad things happen. Wouldn't you expect end - 1 which is now the "new end" to act them same? I would. — Borgleader 46 secs ago
Does this make sense to anyone but me?
 
If you would take all Youtube comments ever written and push them into a zstream, you're going to get magnificent compression. They're often copy-paste and cliche :/
 
The amount of stupidity will cause the computer to commit digital suicide.
 
I wish we had a corresponding "Too narrow" to "Too broad"
 
2:26 AM
Too barrow
 
I'm going to stop arguing with him.
 
@Magtheridon96 For me, it is more of... mindless name calling, and... well, either a great level of ignorance, or malice.
 
@Rapptz You pissed him off lol
@Rapptz: I can't wait for you to go close this and this question too. — Mehrdad 37 secs ago
 
Well, I replied.
 
@Magtheridon96 what was your block lighting thing for, you said?
 
2:37 AM
@Pawnguy7 Hmm?
 
AAAGH
I passed out for like 8 hours @___@
 
@Magtheridon96 Your tile thing. I am making a screensaver. What are you making?
 
A sidescroller
 
Platformer?
 
Pretty much
Depends on what my level designer is going to end up doing, I'm only making the whole backend of it
 
2:40 AM
@Borgleader Isn't it @Jerry's birthday today?
 
Oh shit!
 
It will be in 1h20 min for me
 
It is Jerry's birthday
 
That's what he said last time about that July 22 thingy.
 
I knew I was forgetting something
 
2:40 AM
And Jerry is on the west coast I think
so ... 4 hours to go
 
I just noticed his age bumped up to 49.
 
They grow up so fast ;_;
 
It's a celebration, bitches.
We should get some bitches to show Jerry their titties.
 
Surely someone here would like to volunteer.
 
2:47 AM
I don't think my chest counts.
 
@Magtheridon96 a team project?
 
@Pawnguy7 Yeah, I'm the only coder though
 
"Meet the new inbox". Google, can you just leave stuff like it was? Just for once?
@Magtheridon96 I am going to guess there is also a musician involved?
 
@Pawnguy7 A musician is the only element we're missing ^^
We have a candidate though
 
Just don't look at me haha.
@Magtheridon96 Is the level designer... that by itself?
 
2:59 AM
@ThePhD I suggest the puppy, he should have ample man boobs
 
@Pawnguy7 He's also the writer
That's currently his task. He's assuring a consistent spec and working out all the details
 
@Telkitty猫咪咪 Nah, I don't think that counts.
 
@MarkGarcia omg omg omg ... just noticed that you are a stalker :p ... omg omg omg
 
@Telkitty猫咪咪 Somehow. At least it started when he mentioned today is his birthday. :)
 
3:15 AM
Not to imply that he's not being honest, but, well, an increment in the age of his Stack Overflow profile would "verify" it.
 
I burnt out hard, what should I do?
 
Cry in a corner.
2
 
I'm assuming by "deleted" you really mean destroyed (i.e. its destructor is called), because delete isn't getting called here. But that's quite inconsistent with pointers: if I have unsigned char buf[sizeof(string)]; string *p = new (buf) string(); and then say p->~string(); then p is still perfectly valid (even though its target is destroyed), and I can even say p != NULL expecting false. Right? — Mehrdad 1 min ago
What the flipping fuck
Wheres the cat when you need him :P
 
3:40 AM
If anyone is paying attention, there is something funny going on LOL
 
@Borgleader The memory is still there (it was allocated on the stack and it's still in scope). However, I don't think he can expect it to be zeroed.
 
0
Q: Math.ceil(Math.random() * 10000000000000) Solution probability

user2605376I need help on this function: Math.ceil(Math.random() * 100); How to guess the next number that's coming by knowing the one that you got? (it can be any programming language please!!!!)

 
0
Q: CImage to CArchive

SeerC++, Visual Studio 2010, MFC. How to save a lot of CImages to a disk and later load it? I'd like to use CArchive, but << and >> operators can't be used with a CImage.

 
^^ oh nice...
 
@StackedCrooked Yeah that's kind of my point. Since when is the definition of a valid pointer "i can use == on it"
 
3:45 AM
Somebody is selling the City of Detriot on eBay LOL!!!!!!!
 
Anyway I deleted my answer.
 
@Mysticial I think it's possible to predict the output after some hundreds of calls, right?
 
My age on StackOverflow, membership age, and visitied stats exists entirely of 0, 3 and 4s.
 
@Mysticial Speaking of numbers, did you see that video @Xeo posted on prime numbers and Mill's constant?
 
Oh, there's a 1.
Dammit.
 
3:47 AM
@Borgleader linky?
 
Wanna see mine?
0, 1, 2, 3
 
Hm..
You win. For now.
 
Tomorrow, there will be only 1s, 2s and 3s :D
 
@Borgleader I'll put that on my list of video to use when I'm debugging code at work.
 
@AshKetchum loool
 
@Magtheridon96 but you could be seen, say, 45 mins ago
 
I know, its so funny LOL.
 
should I enter a bid? ... very tempted to buy Detroid on ebay
 
@MarkGarcia Good question.
 
3:55 AM
@Rapptz And it's from a real problem of mine. :)
 
Do you pronounce wifi as wai-fai or wee-fee?
 
@MarkGarcia I'll answer in a bit.
 
Anyway, I know the answer, though I'm still hesitant on answering it.
:p
 
@StackedCrooked wide fat
 
wifi rhyrmes with why-why
 
3:56 AM
Yeah it deletes it using reference counting.
lol what a undetailed answer.
 
@Telkitty猫咪咪 do eet, do you want Detroit or not? ;_;
 
@Telkitty猫咪咪 It'd be pretty funny lol
 
I think they should add a factory function for making the facet
 
"This listing was ended by the seller because there was an error in the listing." I'm sure there was.
 
boost::posix_time::make_time_facet
 
4:02 AM
@Rapptz Thanks! Is it from the C++11 standard?
 
Yes
 
lol @ my typo.
 
Damn, I said I wouldn't touch the locale part of the standard anymore but I did so anyway :(
 
Oh youtube comments:
> UltimateBan 1 day ago
> this guy reads phonebooks and cums
 
4:11 AM
@Rapptz You're a dirty person.
 
I want moderator attention somehow
 
^ Exhibit A: symptoms of extreme boredom.
 
@Rapptz lol why?
 
Reasons!
 
Very "naughty" reasons ;)
 
4:15 AM
LOL
I can't belive my grand mothers making me take Out the garbage I'm rich fuck this I'm going home I don't need this shit
 
@StackedCrooked Why aren't the answerers explaining their code?
 
I don't know.
 
Alright, closing.
er, putting on hold.
 
bam!
 
It's clear what he is asking.
 
4:38 AM
26 mins ago, by Rapptz
I want moderator attention somehow
 
He wants to print something but nothing appears on the screen.
 
@StackedCrooked Apparently not.
 
@Telkitty猫咪咪 lol
 
@Telkitty猫咪咪 lolll
 
Yeah it's pretty clear what he's asking.
 
4:39 AM
Then why problem is being it prints anything [sic]?
 
That was a comment.
 
if you really want moderator attention you should have trolled on the main meta chat
 
I have no idea how to interpret that comment though.
 
Where is the main meta chat?
 
The Tavern?
 
4:40 AM
@Rapptz OK, better?
 
@RobertHarvey Could you clear the comments here? They're inflammatory and detract from the question's purpose.
I don't know if I was supposed to flag the question.
 
screencapping before... 3, 2, 1...
jk
 
Too late.
 
"Show 31 more comments" lol
 
@Rapptz Yeah, the flag was OK. A mod just hadn't gotten to it yet.
 
4:43 AM
@StackedCrooked By the way, I can replicate this
@RobertHarvey Ah I didn't flag it because I didn't know I was supposed to.
Thanks by the way!
 
@StackedCrooked That doesnt work on windows i think
 
Could be.
 
@EtiennedeMartel @Borgleader How far is it from where you are to Toronto?
 
@ThePhD Roughly 5 hour drive.
 
4:50 AM
Ouch. x_X
 
Hey, Canada is a big place.
 
Well, if I were to ever visit Canada,
I have like, 4 beer-loving pub goers in Toronto I know pretty well. Then there's like 2 people that would come with me.
 
 
Then there's you and Borgloeader,.
So that makes for...
.... a party of 8. @EtiennedeMartel @Borgleader
We could have a real party with that. All of them play League & Dota and various other games.
Lol, edit city.
 
@Feeds that's awful
 
4:55 AM
It's pretty amazing (and terrifying) that the mosquito has killed more humans than any other organism.
 
I'm trying to fix HgScc src myself.
 
@Mysticial including viruses?
 
@Feeds noob
 
They call a car's trunk a boot or something
 
5:09 AM
I'll fondle your gollywock -- I just realized the dirty side of this :D
 
5:21 AM
Okay.
So I've recompiled HgScc.
I need to now make it a VSIX project.
 
@Mysticial I've been watching quite a few of these Numberphile videos on youtube. They're quite interesting. I wish my math teachers had been like that...
 
@Borgleader Link me that list? It actually happens to be relevant to what I'm working on right now.
 
Since I need to test a new feature on playing chains of videos. (can't disclose what it is though)
@Borgleader thx!
 
The first one is about youtube, should be relevant to you since you work at google :)
The famous 301 views
 
5:36 AM
Ohai
 
Hai <3
 
So @thephd, you in London?
 
@TonyTheLion Nah, not now. That'll happen... uh. Wednesday/Thursday, ish.
 
Oh I see
 
But youre in England right?
 
5:40 AM
^ this
 
Suddenly, I miss too localized. stackoverflow.com/questions/17780373/…
 
Yes.
 
I am in England.
I got my first GBP. <3
 
Niiiice
Welcome <3
Thunderstorm here
 
5:41 AM
I haven't looked outside my window to know what the weather might be.
Oh, it looks like it rained.
 
@ThePhD Where in England?
 
@jozefg Around.
 
Are you attending some conference?
 
Nah.
 
Also, meant to ask you when's your return flight?
 
5:45 AM
I'm here on business, meeting people.
 
I may be able to take you to Heathrow, depending on time, etc
I'll email you later
 
@ScottW Post photos while we're fucking? :p
 

« first day (1010 days earlier)      last day (3941 days later) »