« first day (280 days earlier)      last day (4661 days later) » 
00:00 - 19:0019:00 - 00:00

12:00 AM
I'm not in a state conducive to writing something coherent :)
Also the paragraph 5 leads to nowhere since it references what we already know.
 
Conductive? Are you made of platinum?
Still not :-)
 
I don't know what you mean.
 
(Condusive)
Just yanking your chain
 
That's a regional thing. Is it? Oh well it's not.
 
Hah, no, I'm sorry, you had it right! "conducive"
Bed time for me it seems
 
12:02 AM
From latin 'duco'.
 
Yep
I mean, both "conductive" and "conducive" are derived from the same thing. Like "case" and "cause"....
Anyway.
I've been meaning to write parallel CUDA code, and instead I now know 80% about C++0x and Unicode :-)
Time to stop SOing
 
 
4 hours later…
How appropriate following Kerrek's question.
 
4:23 AM
The culprits for the inclusion of "POO, PILE OF" in Unicode 6.0 are Google and Apple.
💩
Hmm, HTML entities don't work in the chat.
 
💩 should be it I should think.
 
Luckily, my font doesn't have it.
 
4:45 AM
If I'm writing a header-only library, how do I define a static member constant without running into multiple definition troubles?
 
Header only as in most of the stuff is templates, or header only as in brain-damaged inline definitions everywhere?
If it's a static member of a non-template class I question the sanity of what you're attempting.
 
Can you explain why it's not a good idea?
 
It's a personal peeve of mine to separate declaration from implementation, also I like fast compile times.
I don't have an objectively rational argument to justify it though.
 
Oh. That leaves me a tiny bit less worried :)
 
For your static thing you can cheat your way with a template.
Don't know how to make it nice without abusing inheritance though.
 
4:52 AM
Hmm, that sounds like I'll be doing something crazy just to stuff this in the header.
I think I'll give up on the header-only idea now.
I'm just not happy with the fact that some of the implementation will have to remain on the header.
Some member functions are templates.
 
What, templates?
 
Yeah I feel that.
Some of the time it's okay when e.g. the implementation is in terms of a private function.
It doesn't apply most of the time though.
 
How do you build a library in Linux?
 
63 lines in the .cpp, 500+ in the hpp :(.
Compile with g++ CFLAGS -fpic -c *.cpp
Link with g++ LFLAGS -shared -o libapp.so
If compilation chokes on -fpic, upgrade to -fPIC.
 
4:56 AM
Ah, thanks.
 
You know how it goes with LD_LIBRARY_LOAD though?
 
Hmm, I know about LD_LIBRARY_PATH.
Not sure what that one is.
 
Because if you test your library with another program, since it won't be installed in your system, the dynamic linking will fail.
@MartinhoFernandes It's been twice this week that I've misremembered PATH for LOAD. You're correct here.
 
So usually one write a wrapper script to do LD_LIBRARY_PATH=$LD_LIBRARY_PATH:path/to/libapp.so ./clientapp
 
5:00 AM
Yeah, that part I can handle. I just never compiled one.
 
Alternatively one may use the -Wl,-rpath option to hardcode into the client program (not the library!) the path to libapp.so.
This is acceptable if e.g. libapp.so is not designed to be shipped separately and to be installed, but is just going to be used with the client program.
(Good practice is to use -Wl,-rpath,$ORIGIN to avoid hardcoding an absolute path in the executable.)
 
Ah, was about to ask about that.
 
Well
Let's assume we're in the path of your executable.
You're shipping with a bin/ subdirectory with libapp.so in it.
Then when linking clientapp you do g++ LFLAGS -Ldev/path/to/lib/ -lapp -Wl,-rpath,$ORIGIN/bin -o clientapp *.o
Where there is a libapp.so in dev/path/to/lib
 
Got it, thanks.
 
And when running ./clientapp then the linker will look into bin/, but relative to where the executable is run.
It's a bit of a pain to look up those things because there's a bit of historical crud, and e.g. Solaris oddities.
 
5:06 AM
Ah, Solaris...
 
But curiously current best practices boil down to the above.
Oh and do you plan on having dependencies for libapp.so?
 
Yeah, boost.
I think I'll only be touching the header-only parts though.
 
In case you need to link to something, just do it the usual way.
e.g. -L/path/to/boost/goodness -lboost_system_options
then let the dynamic linker deal with that for the final program.
 
So, it does the magic without hints?
 
As I understand it it's possible to use some options (including -Wl,-rpath I think) to give hints for the linker to look or whatever but huh that's quite complicated.
Right, but this is assuming a system library, i.e. one that is installed.
if libapp.so depends on foo (coming in libfoo.so flavour) and it's entirely in userland (i.e. no installation), all will go well until running the final executable.
Because the dynamic linker will fail to find your development library among the system's libraries.
 
5:11 AM
Can I just drop libfoo.so on bin/?
 
So append the path to LD_LIBRARY_PATH.
Or that.
The key thing is that you can link to whatever using -L... -l..., but you have to point the dynamic linker (unless it's found in the system) in the end.
Static libraries sidestep the dynamic linker 'issue' but are not best practices so there you go.
 
The issues with static linking are the executable size, and the inability to share the library among processes, right?
 
For Linux I think that's it.
Also IIRC the cost to pay for dynamic libraries is amortized.
i.e. affects mostly startup.
 
And only the first process needs to load it up to memory.
 
Righto.
Then there is dlopen & Co. to programmatically do what the dynamic linker does at startup time!
I don't know if you're interested in hearing but most of my stuff is a (dynamic) library.
Every now and then I start some side project that uses it.
It's not particularly painful to use, debug, etc.
I even do stuff like using visibility.
 
5:21 AM
What do you mean with "stuff like using visibility"?
(Might just be that I'm not parsing that correctly at this hour.)
 
GCC visibility settings.
 
That's how you pick what symbols to export?
 
It's one way, yes. A very convenient one.
 
I'm reading about it on the GCC manual right now.
Seems similar to what you do with MSVC.
Actually, GCC supports the MSVC style.
But the #pragmas seem more convenient.
 
-fvisibility=hidden is what I find more convenient.
I.e. unless specified otherwise a symbol is private/local/hidden.
 
5:25 AM
So they're visible by default?
 
(I have no idea is MSVC supports a similar style but I was under the impression from looking at API files that each symbol needs a spec.)
@MartinhoFernandes Without that option, yes.
(Disregarding the template stuff that has special rules.)
 
@LucDanton Yes, you need __declspec(dllexport) on every symbol.
I hadn't read about the #pragma when I mentioned that.
 
For the symbol you do want to export that's not a problem IMO.
Spelling out the public API is a form of documentation.
 
 
3 hours later…
8:39 AM
morning all
 
mawnin
 
sbi
9:08 AM
@DeadMG yawnin
@TonyTheTiger Really, SO has spoiled us terribly. Now we already need to fix two-word sentences. I'm no better than you are. Every time I post something at Twitter I'm terrified by the thought that I will never be able to fix anything I post there. Blowing my stupidity right out at the world...
 
I wish I had 'preview' buttons. Those seems to have gone out of style lately.
 
sbi
@LucDanton Did you edit that just to make a point? :)
 
I sure didn't. Somehow I wrote 'wished' the first time around.
 
sbi
Anyway, IME those preview buttons help little. You can look at such a preview however long you want, the moment your print your 20page doc, you see a glaring error you overlooked at the preview.
 
@sbi hahah
toothbrush pr0n
 
9:16 AM
hint for solving
14
Q: Weird use of `?:` in `typeid` code

Johannes Schaub - litbIn one of the projects I'm working on, I'm seeing this code struct Base { virtual ~Base() { } }; struct ClassX { bool isHoldingDerivedObj() const { return typeid(1 ? *m_basePtr : *m_basePtr) == typeid(Derived); } Base *m_basePtr; }; I have never seen typeid used like that. Why doe...

it has something to do with null pointers!
 
sbi
@Johannes: I'm not going to even attempt to solve that. You're well known for your code pranks, and I don't feel like walking into one of your traps today.
3
 
9:34 AM
@MartinhoFernandes wtf?
 
9:48 AM
@sbi why is this -.-
it's a puzzle. not a prank
 
sbi
@JohannesSchaublitb With you, there's very little difference between puzzle, prank, and code.
 
not true
I think I stated the code clearly. if you have any question wrt clarity of the question I can answer it
 
sbi
@JohannesSchaublitb Of course, not. That's why my message didn't get starred, after all. Oh, wait...
 
no prank hidden. your suspicion does it match
 
sbi
@JohannesSchaublitb I'm sure you can. So?
 
9:51 AM
so I don't see the whole point of you saying it's a "prank"
@sbi since "hidden feature of c++" was closed, I made it a question
it'S entirely non-pranky
 
sbi
@JohannesSchaublitb Now that's about a suspicious a statement as they come.
 
Why don't you just post the answer, instead of wasting someone's time?
 
not true at all
 
sbi
@JohannesSchaublitb And you don't have >120k. See, rep has to be earned, and yours is well-earned. Live with it.
 
@MartinhoFernandes it's not fun for others anymore then
you just said most of my answers are pranks. so my rep can't be well earned at all :(
@MartinhoFernandes i will leave it open until someone enlights us
@sbi i also don't know how you can fall into a "trap"
@sbi the fact that your message was starred by some doesn't necessarily mean those agree with the message's content. it may just mean that the message is funny
(in fact, I'm one of the starrers, because I think it's funny)
at least 15 other people voting my question up don't agree with you either
 
9:59 AM
You really think 15 people voted because they enjoy waiting for the answer?
 
why else would they vote up
i don't think they enjoy waiting for the answer (who does enjoy waiting for something?). but that they find the puzzle interesting
 
Can a constructor delegate to the copy constructor?
I seriously need delegating constructors these days.
 
room topic changed to Lounge<C++>: Norway :(
hope that didn't interrupt your flow there ;)
 
10:30 AM
Oh hai guise
Liking the new mobile interface
Now all I need is visual studio mobile :)
 
sbi
@JohannesSchaublitb Well, if many of your appearances here are pranks, and your reputation is that of a prankster, then that reputation is well earned, no?
Anyway, looking over that conversation I see that most of my messages are badly missing a smiley. I think you have taken this way too serious. I apologize.
 
ohh
i see now
 
sbi
@jalf No, that's very fine wit me. (Have you tried to reach Alf?)
G.W. Bush, 9/11: "We're gonna hunt you down." Stoltenberg, 22/7: "We will retaliate with more democracy". I'm proud to be Norwegian.
Oslo Mayor Stang asked whether Oslo needs greater security - "I don't think security can solve problems. We need to teach greater respect"
I like these two very much.
@LucDanton In C++03, ctors cannot delegate to other ctors. In C++11, though, I think they can.
 
wow that was a massive bomb.
 
sbi
10:46 AM
@JohannesSchaublitb Actually, most people (ten times as many as through the bomb) were killed by the guy shooting into young people on an island.
 
it seems it was the same guy doing the bomb that were killing the kids on that island
 
sbi
@JohannesSchaublitb That's what the news reported this morning.
Quiet heroes are the more than 20 small boatowners who rushed to Utoya to pluck fleeing people from water & pick others up from the island
 
sbi
10:57 AM
BTW, this is the guy who is believed to have killed >80 people:
One person with a belief is equal to the force of 100 000 who have only interests.
 
What was his belief?
 
sbi
@MartinhoFernandes Nationalism.
 
I don't get it. How does that equate to shooting kids?
 
who says it equates to shooting kids
 
sbi
@MartinhoFernandes I'm currently reading about this on a German news site. I'm sure you'll find attempts at explanations online.
 
11:00 AM
they say he's a christian fundamentalist
 
I doubt Jesus will be proud.
 
lol
i can't believe police took 40 minutes to get to that isle
 
You know, everyone was probably busy taking care of the damn bombing.
Someone managed to save a PDF version of Anders Behring Breivik's Facebook page before police took it down http://t.co/P6eV5Kh
 
sbi
@JohannesSchaublitb Those where 14-17 year old kids (I have one in that age), many of which jumped into the water and tried to swim 600m to the shore. They were picked up by owners of small boats coming from the shore, who took their boats to the fjord trying to pick up those kids while the guy on the island shot at them. One woman said it was terrible that she had to leave kids in the water when her boat was full after she had picked up ten of them.
 
yeah I read in teh news
 
sbi
11:16 AM
They are still searching the fjord for more victims.
 
Apparently, there was another killer.
 
why didn't they just kill the guy out of the police helicopter.
 
Because they're not savages.
 
he couldn't have killed that many then
 
11:33 AM
> Your use case is one of the better examples of wanting to use a singleton. You say in one of the comments "To me logging has always seemed a natural candidate for Singletons." You're absolutely right.
Yes, they bolded it like that.
 
11:57 AM
@CatPlusPlus: What question?
 
5
Q: Creating a singleton in python

BiggAlEdit (to clarify my use case) I have multiple classes which would become singletons, and would prefer not to have to resort to globals - IMHO they're a major code smell, and if you are forced to use them it represents a deficiency in the language, but that's obviously opinion rather than objecti...

 
12:33 PM
0
Q: Problem with drawing symbol on a bitmap

Niklv#include <iostream> #include <windows.h> #include <gdiplus.h> #pragma comment (lib,"Gdiplus.lib") using namespace std; using namespace Gdiplus; int main() { HBITMAP hbmp = CreateBitmap(50,50, 1, 1, NULL); HDC hdc = CreateDC(TEXT("DISPLAY"),NULL,NULL,NULL); HBRUSH ...

I think somethings missing in terms of the bitmap the OP creates and actually associating it with the rect and DC he's drawn with
but since I"m not very familiar with this, I'm not sure
anyone?
 
@sbi nah, I only know him from SO. I checked his blog for updates, but nothing since january there
@MartinhoFernandes it equates to shooting kids at a political camp discussing how to combat right wing extremism, if you're sufficiently crazy
 
Als
1:33 PM
@jalf, @sbi: I had seen @Alf posting around some answers around 15-20 days ago.
oh just checked his last visit here was just yesterday!
And off i go now
 
1:50 PM
oh man
I'm looking at the ICU libraries, and holy shit, they have a disgusting API
 
@DeadMG ported directly from Java, it'd seem
 
oh no, I wouldn't mind that too much
it's the C-isms that I'm struggling with
like, "Copy constructors should have a UErrorCode& parameter to signal errors." and such things
no exceptions? wtf kind of person writes a library without exceptions in C++?
because "some compilers don't support exceptions".
yeah, maybe some compilers from the 1990s or from platforms that don't have the power to handle Unicode anyway
why is it that practically every library except Boost does that? is it so hard to write a modern C++ interface?
 
2:11 PM
lol
there are modern C++ libraries that don't use exceptions either
LLVM/Clang
 
2:34 PM
"modern", sure
 
@JohannesSchaublitb "don't use" or "don't support"?
 
don't use. they support building with it, but their container's etc don't support throwing elements.
in a few corner cases of LLVm they use exceptions
 
why even bother labelling your library as C++?
exceptions have been Standard since there was one
 
lol
that's like saying "why even both to say you can speak your mother tongue? The word <some strange word you never used nor heard but that exists> has been part of the language since you've been born"
 
never used nor heard but that exists? exceptions are pretty fundamental to the language
 
 
1 hour later…
4:00 PM
2
Q: How can I find out if a device has a vibrator?

Octavian DamieanI have a device of which I don't know if it has a vibrator. Is there a way to query for the availability of the vibrator?

 
So, Android has a vibrator API.
 
4:24 PM
you can get an iPod vibrator
in the more traditional sense
vibrates in tune with music
 
sbi
4:44 PM
@0A0D I dropped that guy a note about our FAQ. It seems he would be interested.
Wow. I'm atop the c++faq tag! <nya-nya/>
RIP Amy Winehouse. What a star.
 
I smell tasty food and I can't it :(
 
@sbi aaahaha
I will secretly put "c++-faq" on some of my answer's questions now so that you don't notice
 
sbi
4:59 PM
@JohannesSchaublitb IF you tag a question c++-faq, the @Feed guy will post it here and I get a mail about that tag once a week, so it's really hard to sneak one past me.
 
sbi
@DeadMG You have my sympathy. I'm preparing artichokes for me and the kids. Would that be Ok for you?
 
5:14 PM
@sbi oh man, I love artichokes :) Enjoy them :)
 
Oh how I love autotools and configure script that runs longer than the compilation itself.
 
yeah, it would be fine
fish are disgusting and I never ate them, so I wouldn't be so jealous of other people eating them
 
5:34 PM
@sbi That faq idea is great.
 
5:53 PM
Hey guys, I'm trying to debug a function in R that calls a C++ function but something isn't working. Can someone explain to me what these lines of code do?
installErrorHandler();
poDS=OGRSFDriverRegistrar::Open(CHAR(STRING_ELT(ogrsourcename, 0)), FALSE, &poDriver);
I'm trying to figure out why this C++ function won't read a file.
 
@RomanLuštrik this function opens a file with one of the registered drivers
per this
 
A-ha. So this is where the function fails and I get error that it cannot open file.
if(poDS==NULL){
  error("Cannot open file");
}
 
If this method fails, CPLGetLastErrorMsg() can be used to check if there is an error message explaining why.
you should try that
see what's going on
see the link I posted earlier
 
sbi
@DeadMG The kids want to have fish tomorrow. So if you want to eat with us, you'd better come over tonight, rather than tomorrow. :)
 
I'm looking at the link, thanks.
 
sbi
5:58 PM
@OctavianDamiean Good! If we get this going in other tags than c++, we might have some more leverage to wrestle additional support for this from the SE team.
 
Yup, I'm all for it.
 
sbi
@TonyTheTiger I'd say you know where I live, but then I have only one artichoke for each of us. When @Dead appears here (ten minutes left), I'd already need to relinquish mine, and I don't think one of the kids would do that for someone else. :)
 
@sbi hehe, It's too far to come over for an artichoke
 
sbi
@OctavianDamiean Do you already have more such questions in the Android tag?
 
but I would like to come visit Berlin properly some day
 
6:01 PM
I'm from the Android tag actually but yes I can think of quite a few questions.
 
sbi
Oh, kids are ready, I'd better get going, or they'll eat my hair...
@OctavianDamiean I know. :)
(Sorry, I knew it was one of those alien tags.)
Anway, gotta go... I'll be back in an hour.
 
6:21 PM
@sbi: It's been more than ten, am I too late?
my grammar is so incredibly ambiguous
how could I parse something like identifier(meta_function([](){}) id)?
 
sbi
@DeadMG Yeah, we're done. Yummy!
 
6:36 PM
it's ok
I went to the local shop and stuffed my gigantic face on chocolate
 
sbi
@DeadMG What do you expect? You're speaking English, and it's hard to not to be ambiguous in English. :)
 
lol
 
sbi
Actually, it's nigh impossible.
 
nigh
not neigh
 
sbi
6:38 PM
@DeadMG Ah, thanks!
 
neigh is the sound of a horse
 
sbi
I think "neigh" is what horses do, right?
 
or as in neighbour
 
sbi
@DeadMG Ha! Thanks again.
 
@sbi I r a genius
 
sbi
6:39 PM
@DeadMG So is a neighbor one who is born by a neighing mare?
 
Most likely.
 
sbi
@DeadMG Who's Ira?
 
@sbi @OctavianDamiean I third the -faq tag
 
sbi
@Raynos What's that??
 
@sbi It's shorthand for "I are a", which is, uh, internet-speak for "I am a"
 
6:40 PM
wasn't he called Neigh Butterworth ?
 
sbi
@DeadMG Oh, I really didn't know that!
@JohannesSchaublitb LOL!
 
how could a guy in Germany know English Internet speak?
 
It is the lolcat-meme-speak.
 
sbi
@DeadMG By, um chatting in English on the interweb?
 
recently, I've begun to consider Internet as almost it's own language, a derivative of English
 
6:42 PM
Oh no it actually isn't. Skip that.
 
@sbi Not in the SO chatroom :P Internet-speak doesn't tend to exist in places where people put up their real names
 
Oh it does but only for a very short period of time.
 
sbi
@DeadMG Yeah, and cause we all give our real names here...
@Raynos What are you referring to??
 
Neil, Johannes, and Martinho all have, I think
 
@sbi He is referring to the tag faq idea.
 
6:43 PM
obviously some like me much prefer to keep myself a secretâ„¢
 
sbi
@DeadMG Don't distract. This is between you and me.
 
OIC :P
you know
I had a genius idea about parsing my grammar
I could just work backwards
 
in the beginning i just was called "litb"
 
sbi
@OctavianDamiean I knew that much. However, I read @Raynos' statement as if there already was another -faq tag besides the c++-faq one. And that's what I'm asking about.
 
but I figured I would reveal my real name
 
sbi
6:45 PM
@JohannesSchaublitb Now you're called "stdlitb".
 
I mean, think about it- every function ends with a } at namespace scope
 
@sbi I meant I'm looking through questions to make
 
if I worked from the back instead of the front, I'd find them easy-mode
 
sbi
@JohannesSchaublitb When I was a young whippersnapper, I, too, used my real name. I since learned that this was wrong.
 
6:46 PM
@sbi Oh? Wrong in what way?
 
sbi
@Raynos "0 questions tagged javascript-faq"
 
@sbi That's why I'm looking for questions
 
sbi
@Raynos I was trying to be encouraging. :)
 
Like a drill sergeant? :D
 
Its hard to find the duplicate with the most upvotes
 
sbi
6:50 PM
@Raynos You'd have my kids' sympathy for that statement. :)
 
What the ... there are still no questions marked javascript-faq. ON YOUR FACE, GIVE ME 50!
 
sbi
@Raynos I usually try to find the one I consider the best.
@OctavianDamiean If you knew my real name, you'll find it smeared out all over the Internet, especially Usenet. You can find what I'm thinking about C++, programming in general, Microsoft, politics, child raising, cycling, certain books... You name it, in more than a decade I have posted about it. One day I discovered that, when I type my name into google, it would suggest the rest when I was halfway through my last name. That was when I drew a line.
 
Its hard to find the duplicate with the most upvotes
 
sbi
@Raynos I usually try to find the one I consider the best.
 
I guess the easiest thing is to find closed js questions
 
6:54 PM
you know
 
@sbi Meh, I don't really care about that kind of stuff to be honest. I know very well that I'll step certain people on their toes with my opinions and what I write on the internet but that is just how life works I think. They'll have to live with it.
 
maybe I could write a compiler-compiler for a parallel grammar
 
And then compiler-compiler-compiler for compiler-compiler.
 
n-compiler for (n-1)-compiler
 
Compilerception.
 
sbi
6:55 PM
@CatPlusPlus Now you're getting meta!
 
Actually just write a compiler that compiles itself
 
@Raynos: That's how C and C++ compilers are usually written
 
sbi
@Raynos For that you should get the generalist badge.
 
Many compilers are written that way.
 
even managed or interpreted languages can compile their own compilers, although of course in order to write the VMs they run on you still need something else
 
6:56 PM
@CatPlusPlus Which makes them even creepier.
 
And then bootstrapping is a bitch.
 
sbi
@OctavianDamiean You know, when I was younger, I also participated in a few rows and flame wars. Nothing I'm proud of, but it's all out there, and will be for all eternity. I once asked a boss of mine whether he googles for names if he gets an application. His answer was something like "would you apply without googling for the company first?"
 
that's the main reason I don't put my real name out
 
sbi
@CatPlusPlus The bootstrapping bitch.
Ugh. Now that it a picture uncalled-for. Can someone pass me the brain bleach, please.
 
Hi.
 
00:00 - 19:0019:00 - 00:00

« first day (280 days earlier)      last day (4661 days later) »