« first day (515 days earlier)      last day (4440 days later) » 

4:02 PM
You can always
look at the source http://chat.stackoverflow.com/messages/2937345/history
 
If I start a bounty with the reason "One or more of the answers is exemplary and worthy of an additional bounty.", I should be able to award it immediately, right? Why isn't this allowed?
 
I agree. I have no idea why. You should probably search/ask on meta about it.
 
@bitmask you have to wait for some reason
I think it is so that people might come forward with a better answer
 
@thecoshman: I know (just noticed) but it doesn't make sense
 
@thecoshman But if you want to reward an existing answer, it makes little sense to wait for more.
It won't stop deserving it because another comes along.
 
4:05 PM
11
Q: Should the 24-hour timeout apply to bounties awarded for "exemplary answer"?

PhoenixOn "Bringing items into China for a friend - what to expect at customs?" I was impressed by the effort that Ankur put into his answer, and so I started a bounty so that I could award extra reputation as a way of thanking him for his help. As the reason for my bounty, I specified, "One or more of...

it was declined
 
the idea is that a better answer could come forward
last time I checked, there was a notion that there is always room for improvement
they even made a tv show to that effect
 
I sneezed
 
The EXISTING answer helped me with a problem I was fighting for for quite a while and I want to acknowledge the answer, not the question.
 
or was that home improvement
 
@bitmask Seems like it's to prevent abuse.
 
4:07 PM
@bitmask I see where you are coming from. but the bounty system was not added to reward people in that way
it is to try to get questions answered that aren't being answered
 
@thecoshman There is a bounty reason that is exactly that.
It reads "Reward existing answer".
 
I disagree, reputation is misused as currency in the bounty system. It precisely meant as reward for an answer.
 
@RMartinhoFernandes really? oh well now that fucking is stupid
 
It doesn't make sense to wait for other answers if you want to reward an existing one.
 
exactly
 
4:09 PM
still, I guess the theory to keep it is that better answer could come along
 
now I have to keep the browser tab open, so I don't forget
 
@bitmask Don't worry, the system warns you.
 
I think you get warned when the bounty is nearly out, and it auto applies it to accepted or top voted answer eventually
 
@thecoshman: Then you should also block accepts of questions that are younger than one day (I'd strongly support that!)
 
@bitmask agreed
to meta with you good sir!
the place where nothing the community wants get's listened to
 
4:11 PM
@thecoshman And then what? You won't reward the answer you wanted to reward?
It won't lose value.
 
Actually I have made it my own policy (which I sometimes break and accept already after a couple hours, if the answer is without doubt perfect)
 
@RMartinhoFernandes well, you would reward the better answer, and presumable change your votes and accepted answer
 
Als
hmm long time eh..
 
@bitmask yeah, I try to not accept answers that are perfect
 
4:13 PM
@thecoshman: not enough time to make a good point (elaborate meta-question) right now. perhaps I will remember to do it saturday
 
Als
@RMartinhoFernandes I thought I would never say this but well here it is "Damn good to see you again!" ;)
 
rough time @Als ?
 
Als
@thecoshman Yes, Kind of My grandpa has been critically ill & just a couple of months ago my grand mother expired.
So its been rough..a lot actually.
 
I know this is a sad time, but I can't help but be amused at your use of 'expired'
 
Als
@thecoshman English is not my first language, and its kind of odd to say "died" from the place i come from, so its usually said with the word "expired"
 
4:18 PM
expired makes it sound like food :P
"Oh, my grandmother's gone off, starting to go mouldy, need to buy another"
 
@Als: passed away
 
Als
@bitmask Makes sense, thanks
 
I have a memory of having just over 200 meta rep. I just checked now and I didn't magically gain 100 rep while sleeping. I must have dreamed about meta rep :/
 
Als
@DeadMG Not really in for even a iota of fun on this one, So please refrain from it. I know u mean no offence but just please don't.
 
@Als it seems to be a universal thing
 
Als
4:21 PM
@thecoshman Maybe, I don't want to discuss on this any further and I hope You would understand.
 
@Als yeah... I best not say much either, my foot tends to end up in my mouth
@Als no worries man.
 
If two shared libraries have global/static symbols of the same name, will this be handled correctly when loading both?
 
@bitmask probably not
 
(please say yes please say yes please say yes)
@thecoshman: crap, epic crap
 
though, they should each use there own name spaces, which saves you from that pain
 
Als
4:23 PM
@bitmask If those libraries are any good they would be using namespaces and so yes. If they dont then they are crappy I am sorry to break the news to you.
 
same namespace, same global objects
 
@bitmask then no, you have to change at least one
 
the point is, I was using .sos to solve this
 
@bitmask put each in a namespace
 
@bitmask yeah... your fucked
 
4:24 PM
2
Q: Can I sandbox a namespace that uses static data?

bitmaskSay I have (pretty large) C++ module in a namespace foo which has a lot (well, at least one) of static data, namespace-global data and Singletons and so forth, spread across a myriad of files and directories. Is there any way to "sandbox" that entire thing in order to run independent versions at ...

 
there is no solution to this problem except to change the source code
 
any hoops, I am of home
see ya!
 
that was what I've been trying to do
 
Als
@bitmask Just wrap them in different namespaces, should not be difficult.
 
it is
 
Als
4:25 PM
@bitmask :) You will still have to do it, so you may crib, cringe or cry but you have to do it. So do it with a smile.
 
If you look at the question, that's not an option
 
then you are fucked
 
@bitmask then your code running isn't an option either
@bitmask or you can link one dynamically (might not be the right word for that)
 
@MooingDuck: What did you mean? Didn't get it.
 
4:28 PM
he's on Unix
but there is an equivalent function
 
perhaps I should use MPI
 
someone mentioned dlopen, sounds related
@bitmask I don't see how that helps anything
 
dlopen + dlsym?
 
yes, I am using dlopen and dlsym
is there any other way to load dynamic libraries?
(I'm relatively new to dynamic libs)
 
@bitmask I dunno how that works in unix, but on Windows that seems like it would solve your problem.
 
4:32 PM
according to wikipedia is LoadLibrary the Windows pendant to dlopen on unix/linux
 
@bitmask I don't think pendant is the right word there, but I got the idea. I glanced over the man pages, they look similar in usage. That should work around your problem.
(Not that it's not a massive amount of work unto itself)
 
how does that work around my problem? Did I miss something?
I use dlopen right now
 
@bitmask how does it not work around the problem? It effectively lets you rename symbols to whatever you want.
 
hang on, pendant means something completely different in english :)
I meant counterpart
 
dlsym(this dll, this function/object) is pretty specific
 
4:37 PM
that makes... so much more sense
 
@MooingDuck Does it create two instances of data?
 
@bitmask Wikipedia uses the word "analogous"
 
is it possible to friend specific member functions of another class?
 
@RMartinhoFernandes as long as they are seperate dll files yes
 
@MooingDuck And dlopen?
> If the same library is loaded again with dlopen(), the same file handle is returned.
 
4:38 PM
dlsym merely gives you the pointer to the function you want to call
 
@RMartinhoFernandes as long as they are seperate dll files they will have different data
@bitmask right, then you call it. It can also give you global variables
 
@MooingDuck So what? The program makes n copies of the .so file and loads them?
That sounds hackish as heck.
 
@MooingDuck: Yes, that is what I have, I actually hard copied my .so file, then dlopen both versions and invoke the respective function on both handles. They STILL use the same symbol, even if I close them in the meantime
 
@RMartinhoFernandes I think we have a communication problem here. Isn't he trying to load two objects with the same name from two seperate .so files?
 
@RMartinhoFernandes: I'm at a point where I would accept ANY hack. Seriously
 
4:40 PM
> Is there any way to "sandbox" that entire thing in order to run independent versions at the same time (in the same process, that is). How many versions are to be run will be decided at runtime.
 
@MooingDuck: yes, that's what I do.
 
@bitmask they're both altering the same global variables? really? Despite not knowing about each other's existance?
 
yap
 
@bitmask and that's why I use Windows.
 
to be precise the initialisation code of both is run once
@MooingDuck: That's hardly an argument
 
4:42 PM
@RMartinhoFernandes I assumed he meant he doesn't know how many .so files will be there to load
@bitmask no, it isn't. I temporarily gave up.
 
I will simply copy them at runtime (yep, desperate)
 
@MooingDuck Then there would be no problem...
 
@bitmask I feel like that can't be right. It just... can't.
 
the second call segfaults
 
The identity of the libraries is not determined by their filenames, but by their headers?
 
4:43 PM
@RMartinhoFernandes now that's a good idea
 
@MooingDuck: It's a mere prototype, and I need it working by tomorrow ...
@RMartinhoFernandes: Interesting.
 
How does fork interact with dlopen?
 
@bitmask actually, why are you wanting two copies of the same dll again?
 
to run two versions at the same time of code that massively relies on singletons
well, two or more. but if I can run two, I can run any number
@RMartinhoFernandes: Do you happen to know how I can tamper with the header? google refuses to help me
 
@bitmask Erm, no, I don't know.
I'm not even sure if that's sane.
 
4:49 PM
@bitmask are you absolutely positive you want 2+ of each singleton? That's rarely the case. If someone made an object a singleton, it's usually because no matter what you only want one.
 
No
 
@MooingDuck Or because they like singletons.
 
@RMartinhoFernandes I'm assuming some level of competence, as well as ignoring the "no singletons" rule\
 
I want to do something with the code that was never intended by the people who wrote it (ns3 maintainers)
 
4:50 PM
perhaps there are ns3 people here, I don't know
 
There are singletons involved and you assume competence. Nice joke.
 
+1
 
@RMartinhoFernandes I'm trying to assume the best :/ It's hard
 
Well, I'd try with fork before trying to play linker and mess with the libraries headers.
Unless using a single process is really, really, really a requirement.
 
no, it's not
I'll just have to refresh my knowledge of inter-process comm
 
4:53 PM
3
Q: Loading two instances of a shared library

Nils PipenbrinckFor a test I'd like to load two instances of a shared library from an application. The code in the library provides an API but it does not allow me to initialize two (or more) instances of the library because some of the functions rely on static variables.. I'm currently writing unit-tests for t...

RTLD_LOCAL sounds like a good idea.
 
@RMartinhoFernandes: error: ‘RTLD_PRIVATE’ was not declared in this scope
LOCAL didn't work
PRIVATE also wasn't mentioned in the man
 
maybe it was removed
oh man, I need exactly that! Why!!!
 
5:08 PM
However, according to
 
Arrrgh, why do people claim i++ + ++i is googleable?
3
 
4
A: Loading two instances of a shared library

BorealidYou can load a library twice, in theory, if it's compiled as position-independent code (-fPIC). On some Unices, you can then dlopen the library twice if your loader has an RTLD_PRIVATE flag, or by having two "different" copies of the library with the same symbols (put it at two different paths, ...

it should also work with my file-copy approach. I just checked for the 100th time that I'm really passing -fPIC, which I do.
 
@RMartinhoFernandes google.com/search?q="i%2B%2B+%2B+%2B%2Bi";, two of the top 3 results are relevant
 
@MooingDuck What if my variables have proper names?
 
@RMartinhoFernandes ah, fair point
 
5:11 PM
You can't expect people to know that i is the magic word.
 
i++ + ++i is undefined anyway, why would you need to google it?
 
@bitmask to find out why it isn't working, (in the case you didn't know it was undefined)
 
your compiler should tell you
 
@bitmask my compiler doesn't (does clang?)
@bitmask even if it does, we get asked that question many times per day on SO.
 
Google should have a programmer mode.
 
5:13 PM
People don't compile with warnings on.
 
@RMartinhoFernandes: Which should be punishable by cutting one of your finger off.
2
You could do it 10 times.
 
@bitmask Oh, I agree.
 
@bitmask what about subsequent offenses?
 
I lost track of the number of times I told people to just turn them on.
16
A: C++ constructor: garbage while initialization of const reference

R. Martinho FernandesI'll let my compiler answer this one: $ g++ -std=c++98 -Wall -Wextra -pedantic test.cpp test.cpp: In constructor 'X::X()': test.cpp:9:26: warning: a temporary bound to 'X::b' only persists until the constructor exits [-Wextra] $ You should turn on the warnings on your compiler as well.

I even answered questions just by posting my compiler's output...
 
for males, even 21 offences are imaginable ...
 
5:14 PM
@MooingDuck you can't do that anymore then.
@bitmask you can use the cheese slicer-over-nipples method after 21 offenses. :P
 
Wut.
You can't write code with your nipples.
 
Of course you can.
 
@bitmask you all forget voice recognition?
 
@MooingDuck Doesn't work.
 
@RMartinhoFernandes hypothetically :D
 
5:18 PM
"eye plus plus plus plus plus eye"
 
@RMartinhoFernandes I've seen it before, but theoretically, it could work.
 
I've always been a fan of open-source. But the problem seems to be that you have to work with other peoples poop-crap of shit-code.
sry, just a tad frustrated here
 
@bitmask software sucks. Deal with it.
 
well
 
5:35 PM
hehe, when I'm really in a hurry, I start refreshing my questions after 7 seconds to check if somebody answered :)
 
Anyone have a nicer answer for: stackoverflow.com/questions/9706055/…
@RMartinhoFernandes the warning GCC very helpfully gives is perfectly googleable though
 
@awoodland: You don't need the select variable
 
@bitmask you mean use an initalizer_list in the call to pick()?
 
yes
what's the c++ name for Haskell's map?
 
std::transform?
 
5:41 PM
then, I don't have a better version :)
 
the static_cast in the std::bind version is so ugly it makes me gag though. I nearly asked "can it be made written less verbosely?" a while back, but I concluded that the answer was "no" before asking
 
@awoodland Sure, but newbies don't compile with warnings on.
(Though I noticed recently that recent Code::Blocks comes with -Wall by default.)
 
@RMartinhoFernandes assuming you're talking about meta.stackoverflow.com/q/125626/153020 the question explicitly mentioned and then ignored the warning
 
@RMartinhoFernandes: Any clue why compiler's don't activate at least a -Wall level of warnings by default (allowing you to deactivate it)
 
@bitmask Exactly what I was thinking. What I’d really like is map (in[]) s.
 
5:48 PM
@awoodland Oh, teaches me to read to the end.
 
Haskell gets me to wishful thinking. :P
 
haskell invasion alert! (Where's sbi?)
 
@JonPurdy Some things are just so incredibly simple and elegant in Haskel, that you're broken for all other languages (at least a bit)
 
@bitmask because they're warnings, not errors? A lot of software produces a lot of harmless warnings by default
and it can be practically impossible for cross-platform software to ensure that none of their supported compilers emit warnings
 
I believe I remember precisely one warning in my entire C and C++ time that was truly something that the compiler thought was a problem, which in fact wasn't.
 
5:50 PM
I take the view that I'm making a Faustian bargain with the compiler - you spot thing that look funky and I'll write clean code
 
@bitmask Well, you can reasonably do a lot of Haskelly things in C++—and Haskell has certainly informed the way I write some templates—but to do so requires a lot of infrastructure that Haskell hides from you, for better or worse.
 
they try to default to a "reasonable" compromise which doesn't bother the user with too many false positives, while at the same time catching a good number of actual errors
 
@jalf -pedantic should be on by default though.
Without it, it accepts invalid code without diagnostic.
 
@jalf: I don't do a lot of cross-platform stuff, but if you are close to the standard, you should be good, right?
 
@RMartinhoFernandes should it? Think about how much software would break :)
@bitmask no. Warnings don't necessarily warn you about violations of the standard. They warn you about anything that the compiler writers thought might be an indication that something is wrong
 
5:51 PM
yes, but that is easily fixed
you can still ignore a warning, if you know it's harmless
 
@jalf -pedantic is about violations of the standard.
 
annoying warnings like for if (foo = newValue) are also useful, if you know the difference between = and ==.
 
@RMartinhoFernandes I meant comments in general :)
and far from all software tries to be standards compliant A lot of it relies on all the many compiler extensions :)
 
@jalf Sure. My view is that extensions should be opt-in, not opt-out.
 
6:25 PM
@RMartinhoFernandes yeah, my point is just that a lot of existing software relies on it, and compilers try to make everyone happy :)
 
a good reason to provide as few extensions as you really can
 
@jalf But they don't make me happy! (Ok, ok, I'll stop whining soon)
 
How can a message passing interface not support fork. It's a complete mystery!
worst. pi day. ever
 
6:43 PM
What? I had free pie.
It's a great pi day.
 
too long a story; if you're interested read the transcript.
2 hours ago, by bitmask
If two shared libraries have global/static symbols of the same name, will this be handled correctly when loading both?
 
I have an idea for "parametric polymorphic object definition" syntax for my CTwist thing: class(someparam,otherparam) A { } What do you guys think?
 
fail
 
why?
 
@bitmask it depends on how you load them. If they link staticially: failure. If they link at runtime initialization: failure. If they link after execution begins, you're fine.
 
6:47 PM
because you don't need it
parametric polymorphism is just a subset of all useful metaprogramming
a generic system which can perform useful metaprogramming can also perform parametric polymorphism
 
@MooingDuck: no, it turns out I'm not fine in any case
 
there is no use for a parametric polymorphism-specific syntax or semantics
 
@bitmask right, I forgot the conclusion, my bad
 
so C# generics, C++ templates, etc... are all just puffs of smoke?
 
yep
 
6:48 PM
that is the most useless answer I could never have expected
Anyone else have useful constructive input?
 
template<typename T> class X is equal to type X(type T) { return class { ... }; }
 
@DeadMG do you know a language that did it right? Lua or something?
 
@MooingDuck Wide, probably...
 
Lua hardly even has types
 
wait, I didn't mean lua... I meant lisp
 
6:50 PM
@DeadMG That makes me think of the terrible, wonderful things that would happen if you were to give C++ dependent types.
 
mm
I haven't used Lisp much, but from what I know, it could be pretty similar
 
(Runtime-value–dependent types, that is.)
 
@DeadMG I started googling it, and I realized my mistake
 
sbi
Gah! This guy is stupid! (Pardon me French, but I had to get this out.)
 
the problem with parametric polymorphism is today you need parametric polymorphism, and tomorrow, you need std::unordered_set<float, std::string> as a return type
or something like that
and any facility you design which can cope with generally useful metaprogramming can also do parametric polymorphism just fine
@sbi Wow, that's really... kinda dumb
 
6:52 PM
but I thought polymorphic parametrism was the most general term for all this cruft?
ie better than templates/overloads/generics
 
@DeadMG Provided there is a useful typed subset of the metaprogramming system…
 
parametric polymorphism is only parameterising types
if you can parameterise types, why not any other kind of data?
 
please give an example of "other kind of data"...
 
and if you can parameterise anything, like, say, how normal functions work? then it's obvious to see that "types" is a subset of "anything"
 
sbi
@DeadMG Thanks for confirming. I was wondering whether I am missing something really obvious. I guess I really have to give up on him. There seems to be no cure.
 
6:53 PM
Yeah, what would parameterised values look like?
Functions?
 
@JonPurdy Yes.
 
Well, that’s okay then.
 
@rubenvb Well, an easy example is factorial and other Turing-complete computations done in templates.
they're hacked in because the parameterisation is strong enough to be Turing-complete, but there's no parametric polymorphism in the factorial algorithm and really, it's just a function you're calling at compile-time
if you design a system which can deal with normal functions at compile-time, then you can also use it to implement parametric polymorphism, as that is simply a subset of "all functions" where the functions return "type"
 
Don’t know what the prevailing opinion is here on D, but D has such a thing.
 
hahahaha, yeah
if you wanna wait 200,000 seconds and crash the compiler asking for 10MB of memory
 
6:56 PM
I just can’t take it seriously.
Alexandrescu is a great guy and all, but.
 
D has templates, if you have metaprogramming, you don't need templates
 
@JonPurdy: I love D but I never get the chance to use it, so I'm slowly forgetting all the bits I knew about it.
 
also, D is a disgusting language
 
@DeadMG isn't templates just another implementation of a subset of metaprogramming?
 
it's got that enforced-inheritance-from-Object bullshit, and the value-types-can't-inherit bullshit, and the we-broke-rvalues bullshit
@rubenvb Yes, that's my whole point.
if you have a system which does "metaprogramming", then you don't need to implement it again with templates or a templates-a-like
 
6:57 PM
but at some point we need an implementation of something right?
 
right
 
@DeadMG Can you fault D for being disgusting when its roots are in C++?
 
so implement general-purpose metaprogramming and you will gain parametric polymorphism for free
@JonPurdy Yes.
 
@DeadMG Hey now, equal-opportunity hate, please. :P
 
@DeadMG and the only way to do that is copy your way (allow functions to return types), or what are you trying to say?
 
6:59 PM
well, that is the most natural expression of it
I mean, what you're saying with "class(param1, param2) A" is "Give me param1 and param2 and I will give you a class, oh, and my name is A"
that is equally expressed with "class A(param1, param2) { }", if you get my syntax
 
@rubenvb Have you seen the matrix? "What are you saying, I can dodge bullets?" "When you're ready, you won't have to". If you have true metaprogramming, you don't need templates. Templates are a workaround
 

« first day (515 days earlier)      last day (4440 days later) »