« first day (310 days earlier)      last day (4640 days later) » 

12:03 PM
well, it got pretty quiet here
lemme report from libya. colonel Ghadaffi has reportedly gone underground. literally. which leads to a pretty interesting end-match, if it is true. pretty stupid move.
 
Is he trying to escape ?
 
no, literally underground.
 
Or he's hiding in a bunker, hitler-style ?
 
but other report has him fleeing south
hitler
except no dog and no mistress (she fled to Sweden)
 
He must be bored.
 
12:07 PM
yeah :-)
 
There is a justice finally !
 
sbi
12:35 PM
@kbok It seems you have found it by now, but for the future: If you are looking for a message by a specific user, use the search facility at that user's chat profile as a starting point.
@AlfPSteinbach Yes, in a comment to this answer.
@kbok It does have an effect for me.
 
@sbi I see. It becomes un-clickable once you view the other cover.
@sbi Oh, thanks. This is indeed more handy :)
 
12:56 PM
@sbi Huh. Well he/she did start out with a male-sounding mail address. On the other hand, he/she has posted numerous photos (on SO and e.g. in OpenCV group in Facebook) of him/herself working in a lab, looking female. Except for that, my theory was for a long time that Tina was a very young person, male or female, pretending to be his/her older sister. Then, an intellectually challenged student. But deserving of help, I think (different when a person is too lazy to walk, and when no legs).
 
sbi
@AlfPSteinbach Well, I wouldn't know of Tina's sex, and I wasn't interested. Inf act, I wasn't interested in Tina at all, after I had seen a few of her questions here. But her not asking good questions doesn't mean one could publish private details about someone.
 
Right. Happily, even Jeff doesn't know that I'm a dog. Internet... :-)
2
 
I would be pissed if Jeff told everyone that I'm not actually a ghost.
Not related (Again!) : I just learned today that Japanese people use self-centered world maps too.
This is awkward.
 
Is it?
 
1:21 PM
is wxWidgets considered a good C++ GUI library?
 
I'm always told that it's outdated, but I never tried it.
 
well, having just installed it, and trying to build it, the most recent VC solution to build it is VC6.0
that's outdated
 
Also, it's ugly.
 
but what's a better one then?
 
Have you tried Qt ?
 
1:24 PM
I was using sfml, though that doesn't allow you to create buttons etc
 
Qt seems to be one of the popular choices.
 
Be a man, use ncurses.
:P
 
It's a little bit heavy, but it's very nice to use.
And the documentation is one of the best I ever seen.
 
C++ programmers are used to "heavy".
 
hmmm yea Qt looks like an interesting choice
boost is "heavy" in places
 
1:26 PM
"Heavy" as in "20 megs of DLL if you use several components"
 
@FredOverflow I'm not used to running a tool on my source before I can compile it. Plus the license scheme used to scare me (but as I understand it it's sane nowadays.)
 
@TonyTheTiger You can draw and handle them yourself.
 
@TonyTheTiger: If you use Qt Quick, tell me what you think about it. I was thinking about giving it a try.
@LucDanton Yep, it's fully LGPL now.
 
Though it depends on what you're trying to do. More 'native' UI might be better for desktop app, custom-drawn is better for e.g. games.
 
@CatPlusPlus using Win32?
I don't want to use Win32...
 
1:32 PM
You said you're using SFML.
 
yes I am
 
sbi
@TonyTheTiger Certainly not by me.
 
so I just use a sprite to draw an image of a button and then make it clickable? that what you mean?
 
sbi
@kbok What continent do you think is in the center of maps you find in the U.S.?
 
@CatPlusPlus I think he's asking on how to write a more native UI.
 
1:33 PM
I'm trying to create a tetris app, so I just want to be able to create the UI for the game
nothing more
 
@TonyTheTiger That's how it works.
 
@sbi I know, but I was already aware of that. Also, that's not just awkward, that's just plain stupid. Russia and China are cut in half.
 
If you don't need windowing, then it's just hit-test against button box (with a hover state tracked across mouse movement).
 
Als
Wadda..
 
Or find a library that has SFML backend.
 
1:36 PM
Aha! That's where I come in.
 
You're a library with an SFML backend?
 
I've been meaning to give Gwen a go. Apparently it does support SFML nowadays.
 
Yeah, I've been looking into that, too.
 
As I understand it it's more of a GUI toolkit where the backends are GUIs proper.
 
I think it's the only open-source GUI lib I've seen so far, that doesn't use OpenGL immediate mode.
 
1:38 PM
@LucDanton Nice
 
What's the fucking obsession with immediate mode?
That thing is of no value beyond the first OpenGL example.
 
Outdated teaching materials, probably.
 
And even then, it's of little value.
 
I would have liked to have an OpenGL class.
 
What does class mean?
(I always get confused with that and course and probably other stuff.)
 
1:39 PM
In that context, a course session.
 
class OpenGL {}; there you go.
 
@LucDanton Ah, ok, that's what I meant then. Basically, a lesson.
 
@CatPlusPlus Why thank you. Notice the use of past tense though: you're too late :(
 
0
Q: Cause of Error

bbwWhat is the cause of errors: Unhandled exception at 0x75aad36f in projectName.exe: Microsoft C++ exception: cv::Exception at memory location 0x0018f970.. It caused my program to terminate early and so cant run the rest of the code. Please help. Tq

 
sbi
@kbok I dunno. I mean, isn't it understandable and human that one would have oneself centered in a map, so that one could see the world spread out into all directions - as it is in reality, when you look around? Also, not centering the map on your own POV would make it impossible to navigate Antarctica.
 
1:49 PM
@sbi Sure it is. But in the case of the United States, it involved changing an already existing map AND cutting Asia in half in the process. This is not the case for the other maps (Where we cut oceans).
But that's not actually such an issue to me, and I understand perfectly why they had to do that at the time (A world centered on UK must have been out of question.) I just find it very impractical.
 
@kbok You're discriminating against the oceans. You're just continentalist scum.
 
sbi
@kbok I think this only seems impractical from a European-centered POV. :)
 
SFML uses deprecated GL stuff, too. :/
 
@sbi That may be true :) And people traveling to Asia should buy a detailed map anyway.
 
Well, given that a big portion of OpenGL <2.0 is deprecated it's natural that you'll find many libraries that already used those features before they were deprecated.
 
1:59 PM
Yeah, immediate mode.
 
That's not the only thing that was deprecated.
-1
Q: Can someone please fix this PHP code?

ByronI'm not experienced with PHP and I'm having a lot of trouble getting this to work the way I want. I would like to upload an image and keep the size so I won't lose image quality. When the image gets cropped, I would like it to make the cropped image black and white but I can't get the grayscale...

 
It's impossible to fix PHP code, because it'd still be in PHP.
4
 
sbi
@kbok With Asia at the center, probably. :)
@CatPlusPlus I'm tempted to add this as a comment to the question. :)
 
What's std::kill_dependency for? (Please don't tell me it's to prevent the argument from carrying a dependency to the return value.)
 
Go ahead.
 
sbi
2:07 PM
@CatPlusPlus No, I won't. As I wrote earlier, I ought to be old enough to have learned when making a splash is worth doing and when it is not.
 
Where's the water?
 
In the ocean.
 
sbi
@RMartinhoFernandes Most of it is at APM 08279+5255.
 
2:08 PM
And in the skyyyyyyyyy.
 
has anyone see the film "Source Code" and was it any good?
 
Well, there's water much close. In me.
@TonyTheTiger I saw a few trailers and a few reviews and I hope I won't see the movie.
 
@RMartinhoFernandes Doesn't ring a bell. Is this about 'safely-derived' pointers, or the abstract machine?
 
@TonyTheTiger From what I understood, it has actually nothing to do with source code at all.
 
@LucDanton It's about the threading model.
 
@kbok hmmm perhaps not worth watching then
 
@RMartinhoFernandes I've never noticed that function before.
 
Has anyone seen a movie about programming anyway ?
 
I think that would suck balls if it was really about programming.
But hey, I like movies about people. Or explosions.
 
2:10 PM
Office Space had programming. With floats.
 
it'd be cheesy if there was one, cause they'd probably write code at a fast pace that would instantly work, which is totally unreal
 
Just like most science you see done in movies.
 
sbi
@kbok A programmer played a main role in one of the Jurassic Park movies.
 
@TonyTheTiger Because throwing explosives at helicopters with a bow is so real.
 
Except instead of "code" they use "formulas".
 
2:11 PM
@kbok didn't say that, did I
 
Programming: The Movie, 4 hours of a bearded man sitting in front of two monitors, drinking coffee, eating pizza and cursing from time to time.
5
 
just like hackers in hollywood movies, get into systems in five mins tops
lulz
@CatPlusPlus sounds about right :)
 
And then they can make a sequel, The Bug Strikes Back.
 
heheh, The Heisenbug Strikes Back would be even better, take longer to find the bug :P
 
The bug is inside the program.
 
sbi
2:14 PM
Here's another piece of moved pictures where programmers were featured: youtube.com/watch?v=hkDD03yeLnU
(Yes, she actually says: "I’ll create a GUI interface using Visual BASIC, see if I can track an IP address.")
 
I think we could make a Hollywood version of what programming is for the sake of a movie. Think about what they made to forensics, gunfight, and statistics.
 
@sbi No, it's just the director trolling geeks.
 
@CatPlusPlus Are you sure the script was not written like Star Trek? "And then the jargon of the jargon goes jargon and a jargon causes an explosion."
Then some dudes come in and replace "jargon" for words.
 
@sbi There was this series when they follow a hacker in World Of Warcraft for hours to get his IP address.
 
@RMartinhoFernandes Well, could be either.
 
2:16 PM
@RMartinhoFernandes Visual Basic exploding sounds realistic enough.
 
@RMartinhoFernandes "Like putting too much air in a balloon." "Like a balloon, and... something bad happens!"
 
Anyway, there's no programmer in Source Code. "Source Code" is the (stupid) name of a machine that lets your mind experience past events.
 
the facebook movie had some basic programmer & hacker stuff thrown in
 
So, like, the brain.
 
@LucDanton That's my favourite episode of Futurama.
 
sbi
2:18 PM
@kbok I'm living without a TV for >20 years now, and I have no idea (and no urge to know) what CSI is.
 
@TonyTheTiger The facebook movie has PHP in it. Who wants to see that ?
 
@kbok I saw it, and the movie itself is not that bad
despite the PHP
 
It's not that bad because it's not a movie about programming.
 
@sbi It's a very popular show about forensics. It's absolutely not realistic (as you have seen). You really don't miss anything.
 
waoh, QT installation takes forever :(
 
2:20 PM
I just tell myself I don't know anything about computers when I hear anyone mention that in series/films.
 
download is SLOW
 
Stargate had JavaScript code on computers made by aliens.
So... yeah.
 
sbi
@kbok I know I don't. (And I'm not talking about CSI here, but of TV.)
 
@CatPlusPlus In Independance Day, some guy hacks into the Aliens' Homeship.
 
2:21 PM
@CatPlusPlus Of course they just grabbed some random snippet somewhere and pasted it there.
 
@kbok This film is so bad it's not even funny any more.
 
sbi
@TonyTheTiger If upload is faster than download, your DSL line was put in the wrong way.
 
@CatPlusPlus They're making a remake!
(That came out weird.)
 
@CatPlusPlus if it were C++ that would have been a more real scenario, cause C++ sometimes feels like it was written by aliens :P
 
And I meant a sequel.
 
2:21 PM
@sbi hahaha
 
Roland Emmerich wants to make Independence Day 2.
 
Sequel, eh. So, the aliens come back aaaaand USA blows them up again.
I guess we don't have to watch it now.
Because all plot devices between start and end are bound to be terrible.
 
@CatPlusPlus I don't remember much, I was too young back then. Just the scene where the skull heads shows up and laughs on the alien's CRT screens.
 
Like 'my city is blowing up, so I know, I'll just hide in a tunnel behind a standard door'.
 
Well, it has something positive: it's not The Core.
 
2:30 PM
Hey, The Core had nukes and lava in it.
 
Execs considered adding a windscreen to the machine.
 
user image
4
where's the days of those things
 
@LucDanton What?
What's a windscreen? Do you mean windshield?
Oh, it's the same.
Google wasn't helping because someone trademarked WindScreen.
 
From Wiktionary: (UK, Australian, New Zealand)
 
@CatPlusPlus Yeah, it also had a plot based on ideas that could have come out of a book by Verne, except it was conceived in this century.
 
2:37 PM
Hey, Verne is awesome.
 
I love Verne.
I can enjoy his crazy ideas because I know they're from the 19th century. But if Hollywood comes up with a movie in the 21st century with ridiculous ideas like Verne, they'll have to compensate for that somewhere else. But there's nothing else on The Core.
 
I always loved the mysterious island. But what really surprised me was that Jules-man wrote a book where the story took place in Norway. And it was not a science-fiction book. I can't remember it now. Except that I think it had the usual engravings as illustrations.
 
@AlfPSteinbach I don't think I know that one (not that I'm a Verne connoisseur).
 
@CatPlusPlus wtf?
 
2:44 PM
Well, he wrote a boatload of stuff.
 
@TonyTheTiger "This tv show must be good."
 
He did indeed. I read some of his, then later when going over a biography I realized the enormous amount of his books that I did not read.
 
And yes, Amazon sells these.
 
@LucDanton I only read his "classics". It's rather hard to find the rest of his stuff nowadays.
 
@RMartinhoFernandes Is it? I think on this part I have the luck to find myself in France.
 
2:47 PM
Yeah, that probably helps.
Hmm, he died in 1905, so it's highly likely his stuff is on the public domain already. Maybe I can find them on Project Gutenberg.
 
@CatPlusPlus the funny thing is what's portrayed in the "Custumers Who Bought this Item also Bought", a noose, a footstool and a fan??? Huh? Does this series make you suicidal?
 
Took you a while, huh? ;)
 
Is that the "Norway book" you mentioned?
 
2:57 PM
i think that's the wholly norwegian one.
yes
i think so
it's long ago
 
Hmm, so, it seems std::kill_dependency serves to: 1) inadvertedly introduce threading bugs and 2) allow the compiler to do some weird optimizations.
 
This one is great for people who love Jules Verne. It's almost the same style.
Anti-Ice is a science fiction novel by Stephen Baxter. Published in 1993, it can be classified as an alternate history for its portrayal of 19th century Europe and the changes resulting, particularly in Britain, from an explosive scientific discovery made in the 1850s. Plot The novel begins with the text of a letter dated July, 1855 from the Crimean War front of Sevastopol. The writer, Hedley Vicars, tells from his perspective as a soldier in the 90 Light Infantry about the visit to his commanders of one Josiah Traveller, an inventor and millionaire industrialist whose discovery in th...
 
I heard good things of Baxter, but I have yet to sample some of his writing.
 
woah, how big is Qt really? It's been downloading the Qt Desktop component MINGW for like half hour now
meh
 
@TonyTheTiger meybe it's slow?
 
3:04 PM
@AlfPSteinbach well I'm guessing, but it's annoying, cause you can't see download progress
 
Als
hmm
 
What are you downloading, exactly?
 
@CatPlusPlus I downloaded the online Qt installer for Windows, and now it seems to be downloading all it's components
as part of the installer
 
Als
Okay folks, so i added this:
0
Q: Why should one replace default new and delete operators?

AlsWhy should one replace the default operator new and delete with a custom new and delete operators? This is in continuation of Overloading new and delete in the immensely illuminating C++ FAQ: Operator overloading. Note: The answer is based on learning's from Scott Meyer's More Effective C++...

 
0
Q: Why should one replace default new and delete operators?

AlsWhy should one replace the default operator new and delete with a custom new and delete operators? This is in continuation of Overloading new and delete in the immensely illuminating C++ FAQ: Operator overloading. Note: The answer is based on learning's from Scott Meyer's More Effective C++...

 
3:07 PM
upboats
 
Als
aha the feed guy
 
Hmm, I don't think I ever saw this kind of question before.
 
Als
a lil late ain't he :P
 
would be better with a foods guy suggesting foods
 
> The operator new that ship with some compilers don't guarantee eight-byte alignment for dynamic allocations of doubles.
 
Als
3:08 PM
@RMartinhoFernandes: It is an continuation of the operator overloading new and delete.
 
That wouldn't be a conforming compiler though (or is it too late to comment on the answer?)
if the machine needs the alignment.
 
Als
@LucDanton: feel free to add comments or even improve it
 
> In such cases, replacing the default operator new with one that guarantees eight-byte alignment could yield big increases in program performance & can be a good reason to replace new and delete operators.
Nah it's a good answer.
 
@RMartinhoFernandes I bought his "time ships" book (continuation of "the time machine") twice
 
There's only so many information to put and I feel like adding the pedantic kind of details detract from the point.
 
3:10 PM
@Als It's very disturbing, I don't know which one to click.
 
@LucDanton That's what weasel words are for ;)
That, and politics.
 
Well, I think that "For example, an architecture might require that pointers occur at addresses that are a multiple of four (i.e., be four-byte aligned) or that doubles must occur at addresses that are a multiple of eight (i.e., be eight-byte aligned). Failure to follow such constraints can lead to hardware exceptions at run-time. " could be removed.
 
Als
@LucDanton: There is a good operator overloading faq by @sbi, but it does not tell how to overload new and delete, since those are big topics in themselves, I was hoping we somehow get to that, and this one is just leading to it
 
I feel that it could mislead people to think that they couldn't use malloc(sizeof(double)) to store a double.
(or operator new etc).
 
Als
@LucDanton: A third person review is must for faq, and glad you are doing it
 
3:13 PM
The standard guarantees that that kind of allocation is properly aligned for an object that size, right?
 
@RMartinhoFernandes Correct.
 
Als
@LucDanton: How do you suggest to go about that then?
 
"Other architectures are more forgiving, and may allow it to work though reducing the performance." is the important bit of context here.
 
Als
Folks. tell me how to improve it and I will.
 
Ok, I believe I can say I'll never (for some definition of "never") need std::kill_dependency, but the fact that I still don't understand why I'll need it is bothering me. I think I'll write up a question.
 
3:16 PM
@Als I'm trying to come up with a draft replacement.
 
Als
@LucDanton: Thanks, and I am going to add your name right up there in credits :)
 
sbi
@Als Another possibility is to just add another answer. The topic could also be split, like my operator overloading FAQ. Digesting and editing is better done in smaller chunks.
 
so much for london riots
 
Als
@sbi: Nice suggestion, @LucDanton: Please do that, tat ensures you get the well deserved rep, as well as it distinctly stays your answer.
 
On it.
 
sbi
3:20 PM
BTW, @Als, I don't have the time to thoroughly read your entry right now, but, assuming that the community will sort out any remaining problems, I have already linked to it from my operator overloading FAQ. :)
 
Als
@sbi: Yes that's right, I was hoping that we could have a how to overload new and delete since that comes up so many times in here in SO and it is not so commonly expressed in answers or not even known that commonly.
 
sbi
@Als Does this come up often? I'm surprised. But then I haven't been out hunting questions for almost a year now.
 
Als
@sbi: Not as a direct Q but replacing new and delete comes up in various contexts, like collecting diagnostic info or tackling leaks and so on
@sbi: It would be nice to direct users to a Faq which actually tells how to overload new & delete and that is such an deep detail that it does need a separate FAQ in itself.
 
@Als I have linked to an example in a comment.
possible dupe?
25
Q: Any reason to overload global new and delete?

MadHUnless you're programming parts of an OS or an embedded system are there any reasons to do so? I can imagine that for some particular classes that are created and destroyed frequently overloading memory management functions or introducing a pool of objects might lower the overhead, but doing thes...

 
Als
@FredOverflow: Feel free to decide. I didn't knew this existed.
 
3:30 PM
Hmm, sequence points are gone.
 
Added my answer.
 
Als
@DavidRodríguezdribeas: Glad you peeked in here
 
@Als Was there no operator knew at the time? ;-)
@RMartinhoFernandes In C++0x, yes.
 
Als
@FredOverflow: :)
@DavidRodríguezdribeas: hello
 
3:32 PM
Though apparently the same undefined behaviours you had before are still undefined by the new memory model.
 
@RMartinhoFernandes No, for example (++i)++ was undefined in C++03 but will be well-defined in C++0x.
 
@DavidRodríguezdribeas Hi
 
2
Q: Is (++i)++ undefined behavior?

FredOverflowIs (++i)++ undefined behavior? Is it possible that the side effect of prefix increment happens after retrieving the incremented object for postfix increment to operate on? That would seem strange to me. My gut feeling says this is undefined in C++03 and well-defined in C++0x. Am I right?

 
@FredOverflow It depends on the type of i
 
Als
@FredOverflow: Oh geez i hate to even see that variable i cluttered with + and - anymore :)
 
3:34 PM
@DavidRodríguezdribeas The type of i is always int, right? :)
 
I hate to read it, but some of my coworkers believe that iterators can be called i
 
it, dammit!
 
Als
@DavidRodríguezdribeas: Why just i?
 
faster compile times? :)
 
Als
3:35 PM
why not it or ite?
 
And again... even restricting yourself to integers... would std::atomic_int i be such a bad idea?
 
@DavidRodríguezdribeas Well, if doing iteration with an atomic type, I'd say yes. If doing something that is not iteration with a variable named i, again, yes.
 
Is atomic_int a typedef for atomic<int>, or is it something else?
 
This is just ridiculous.
0
Q: Lines of code per method - where are the recommendations?

JoeblackdevI have looked back at some posts on the recommended lines of code a method in a OO class should have, such as this. I see people stating 5 lines, 10 lines etc... I have the book by martin - Clean code and I can't find any reference to these figures. Can you point me in the direction where it says...

 
Either std::atomic_int is implemented in terms of std::atomic<int> or the opposite or they are unrelated but exactly equivalent
 
Als
3:39 PM
@LucDanton: Thanks for coming up with an nice detailed answer about the point.
 
The standard suggests that std::atomic_int can be a base class of std::atomic<int> or a typedef to it
 
> There shall be named types corresponding to the integral specializations of atomic, as specified in Table 145, and a named type atomic_bool corresponding to the specified atomic<bool>. Each named type is a either typedef to the corresponding specialization or a base class of the corresponding specialization. If it is a base class, it shall support the same member functions as the corresponding specialization.
 
Table 145, in §29.5/7
 
Woo, a typo!
 
@RMartinhoFernandes I like that one comment quotes '5 lines per method', and one answer 200. There is room for variance!
 
3:41 PM
Gosh, I do think 200 lines is too much.
When it stops fitting on my screen, I start worrying.
 
sbi
I'm convinced the only reason people still use vi is they can't remember how to exit out of it.
@Als If you think you'd rather have my OO FAQ question link to your question right away and delete my feeble attempt at the topic I'd be fine with it.
 
@sbi do you want to start a flame war?
 
I'm a vim user, and I agree. vi sucks.
 
Als
@sbi: Naah, i think the answer in operator overloading is very well scoped, and since you added an link to this(which is an detail, beyond the scope of operator overloading FAQ) I think its worth keeping it as is.
 
@Als, on creating FAQ entries, I have a strong believe that FAQ entries should be authoritative, and I am not sure that the one on overloading new and delete is so
 
3:45 PM
Always use some amounts of redundancy with communication! Always use some amounts of redundancy with communication!
@DavidRodríguezdribeas That's a good point, but it does stray from the meaning of FAQ. I feel that the answer in this case is not authoritative because the question doesn't warrant it.
Or should we put in a more assertive "Don't do it until you know what you're doing" disclaimer thing?
 
Als
@DavidRodríguezdribeas: it is an attempt, and no entries can be Authoritative unless the community comments on it.
@DavidRodríguezdribeas: Hopefully when an FAQ gets read, the feedback, positive, negative, critic should be used to improve it and then it can become Authoritative
 
4:02 PM
What's a speculative optimization?
 
Say, for the FAQ du jour: should we mention the Boehm GC? It can be 'plugged in' to a preexisting program with no other changes than providing a global operator new that gets memory from the GC and a noop operator delete.
 
No other changes at all? How does collection happen? Is there a method you call to force it?
 
Magically.
It's a GC after all.
More seriously, I have no idea.
It is a valid usage however. It has caveats when it comes to multithreading though.
i.e. blew up spectacularly when I tried it :(
 
Well, I'm sure it can be made to work. That's what Mono uses.
 
GCC switched to it and/or pilfered the code or something, too.
 
4:18 PM
0
Q: What does `std::kill_dependency` do, and why would I want to use it?

R. Martinho FernandesI've been reading one the new C++11 memory model and I've come upon the std::kill_dependency function (§29.3/14-15). I'm struggling to understand why I would ever want to use it. I found an example in the N2664 proposal but it didn't help much. It starts by showing code without std::kill_d...

 
The FAQ, for example, claims that there can be a performance benefit on providing your own allocators, there are recent studies (I would have to look again for references) where hand crafter memory pools are only more efficient than the system provided allocators, when the lifetimes of the objects follow very specific patterns. In particular the article I refer to claims that unless you can just forget blocks of memory (i.e. allocate from a pool, in bits, reclaim the whole pool at once)
 
All memory allocation strategies crumble under certain allocation patterns.
Each one has its own Achilles heel.
@RMartinhoFernandes There I've put it into a question. I really like that (I think) I gained a lot more understanding just from the process of writing it.
 
@RMartinhoFernandes I have heard that term, or related terms in different contexts, one of which is when a compiler presumes the value of a variable at one point in time, and starts the processing upfront even if the value is not guaranteed to be that. In many cases adding a check and fallback in case it is wrong.
 
Gosh, Google really likes SO. My question is already the fifth result for "std::kill_dependency".
 
And for that I'm really glad I'm using a nonsensical screenname.
 
4:23 PM
One such example would be a virtual dispatch mechanism in a loop in a JIT VM, where the JIT detects that the objects on which the methods are called on the same type and creates a thunk that performs a simpler test for the type and static dispatch. If the test fails, you have lost a couple of instructions, but if it succeeds you may have gained a good deal of them
In the example of your question, imagine that between the first and second line there were a good bunch of instructions that did not affect the r1. Then even if the third line cannot technically be called before the second, the compiler can rewrite it as
r1 = x.load(memory_order_consume);
r2 = r1->index;
do_something_with(a[r1->index]);
and then reorder the 2nd and 3rd instructions
 
Hmm, that a much better example than what I came up with.
 
Note that if there is a bunch of code between the first and second lines that access the current value of r2, there can be an advantage in that transformation
you could move the last part of the code up to a point there other instructions might still be reading the old value of r2
 
Hmm, ok, so it seems I understood it correctly.
 
4:46 PM
Oh, and get cracking on . I want the "Taxonomist" badge ;)
 
Now you're obligated to add a funny tag wiki.
 
Uhm... I am inclined to kill your kill-dependency tag... a bit too specific
 
Why :( Too specific?
 
I want to have a tag for every name in the std namespace!
 
4:56 PM
printf is an alien, not true member of std!
 
What is the value of having tags? If you want to know about kill-dependency you just search for it, if you want to read about multithreading, or memory-ordering or memory-model you can just use the tag and browse related answers
 
Tags are always arbitrary.
 
so let's add "++i" and "i++" as tags, and then mix and match
 
Well, I don't know what is the value of having tags anymore. Every time I see a discussion I see a bunch of conflicting viewpoints. Granted, I haven't spent much time around meta lately, so I don't know if there's a consensus.
 
4:59 PM
(as a matter of fact, that might be more useful that "kill-dependency", there is a greater number of questions related to ++i++ than to the former)
 
we should add that, indicating the presence of a tag
:P
 
The best thing to do is to not put a tag when you're not sure. More often that not I see knowledgeable people putting in missing and actually relevant tags.
 
@TonyTheTiger It already exists.
 
Als
@LucDanton: good point
 
@RMartinhoFernandes lol
 
5:01 PM
Feel free to remove the tag from the question if you think it is extraneous. I won't hold it against you.
 
Als
@RMartinhoFernandes: Where?
 
11
Q: What does `std::kill_dependency` do, and why would I want to use it?

R. Martinho FernandesI've been reading about the new C++11 memory model and I've come upon the std::kill_dependency function (§29.3/14-15). I'm struggling to understand why I would ever want to use it. I found an example in the N2664 proposal but it didn't help much. It starts by showing code without std::kill...

 
:) I don't really care, for me there is The one and only tag: [C++], and well... a close sibling [C++0x]. Anything else is, well not C++
 
Als
@RMartinhoFernandes: Oh Kill-Dependency, You managed to be the first person to ask a Q about that in SO did you? :P
 
Yeah. Expect something on [[carries_dependency]] soon ;)
 
Als
5:05 PM
@RMartinhoFernandes: Well you can just close your eyes, and seek through the C++11 standard, open your eyes and then you might find a Q that you can ask.
Goldmine of Q's C++11.
 
Let me try that.
 
That's not exactly my process. I've spent a significant portion of the day trying to understand this thing.
But I get what you mean.
 
std::treat_as_floating_point oooooh what's that.
 
Als
@RMartinhoFernandes: I didn't intend to mean that, I meant the standard is so new that no one understands it fully perhaps.
 
Yes, I know.
 
Als
5:08 PM
@LucDanton: Bingo! :P
@RMartinhoFernandes: you continue to do that, and you would be our resident C++11 standard expert :)
 
Honestly C++0x is really, really big to fit inside just one head just now.
 
You don't know how big my head is :P
To be honest, it's not that big :(
Or :)?
 
Well it's more a problem of throughput than storage, at least on my part.
 
There's still a bunch of sections of the standard that I barely know they exist.
 
Well, there is the fact that noone fully understands the old one, and the fact that this one is a huge superset of the former...
And when it comes to multithreading, the domain is quite complex in itself, and dependent on what you are actually working for (if you work in Intel you might never have had to face some of the problems that occur in PowerPC, for example, and it might be hard to understand why something might be a problem at all
 
Als
5:13 PM
Do the folks in the standards committee understand each and every aspect of the standard or their work is limited and scoped to certain parts?
 
I really liked those papers during the C++0x process that essentially asked "anyone remembers what we actually meant when we wrote that? what do we do now?"
 
5:25 PM
bitches
:)
 
I just stumbled on a quite good read about outsourcing and innovation. I'm not really the economic type so I don't know if it's superficial in its presentation of things however. (I'd recommend reading beyond the title and first impressions, the main points come after some context.)
2
 
> Lori's coworker was a PHP God. His computer was named godbox, which matched his login name of god. A project that took other developers three month to finish, he was sure he could do in three weeks. - from God Date Mangling
 
When I read that I couldn't help but wonder if he was sure he could do a three week project in three days, a three day project in three hours, a three hour project in three minutes, and a three minute projects in three seconds.
 
 
5:51 PM
 
Is the iPhone auto-correct so bad, or is this a meme just for the sake of it?
 
anybody know what lib and include dirs you need to set in VS2008 for using Qt?
@RMartinhoFernandes no, it's that bad, damnyouautocorrect.com for more
 
heh that's a good one
 
Install VS addin, it's got project templates.
 

« first day (310 days earlier)      last day (4640 days later) »