« first day (275 days earlier)      last day (4673 days later) » 

3:01 PM
Hi, I'm new here and I was wondering, is there a chat room specifically for C? This is the only room I could find.
 
I really have no idea if an implementation specific behaviour, i.e. reinterpret_cast from pointer to function type to void*, is allowed to bypass the lvalue-to-rvalue conversion that would, IMO, require an instantiation.
E.g. can reinterpret_cast<...>(p) always return 0 but not evaluate p? That's odd.
 
@Luc Well, the compiler did warn me that the cast was illegal … but it still allowed it
 
Hah. Diagnostic provided, conformance wins again!
 
@Luc unfortunately, the warning still persists
 
Which one is it?
 
3:12 PM
@kbok If you're talking about the language, I use it. But not by choice.
 
@Luc “ISO C++ forbids casting between pointer-to-function and pointer-to-object”
 
Oh wait I'm stupid. reinterpret_cast between unrelated pointer types would make it implementation specific.
For the record, that's exactly what POSIX recommends for portability.
I never realized until know that this recommendation falls within the implementation specific hook in C++ land. How convenient.
Well I'm writing that as an answer then...
 
@Luc Unfortunately I can’t change particular interface, the library is given. No idea why they accept the function pointer as void*.
 
@KonradRudolph You'll see when I'm done writing.
 
@Luc That said, while a reinterpret_cast is generally implementation-specific, the following cast is always defined to work: “pointer to object of type T” => void* => “pointer to T
 
3:20 PM
@Poik So do I :) I was wondering what was the difference between java.lang.NoClassDefFoundError and java.lang.Error: Unresolved compilation problems.
I guess java.lang.Error is thrown when a class is instantiated via reflection.
 
@nicotranquil I don't believe so, at least I haven't found one, otherwise I'd probably be watching it. I think most people in this room would prefer C++ over C generally, but you can probably get appropriate answers from them anyways.
@kbok I'd need a little more to go on than that. If I remember right, java.lang.Error is multi-purpose. And "Unresolved compilation problems" could be a few things.
For instance java.lang.NoClassDefFoundError is in fact a java.lang.Error. If you're getting the second one when you think you should be getting the first, and you're using reflection, then you're probably correct about that.
 
@KonradRudolph Answered.
 
thanks
this looks good, will try it soon
but now I need to go unfortunately
 
@Poik I see.
 
Well at least it makes me feel better about my module type that does this kind of casting.
 
3:28 PM
@kbok It's most likely that you're getting an Error instead of a NoClassDefFoundError because you're doing something that the compiler has no clue about, and thus can't give you a more accurate description of the error.
 
@Poik The message is followed by several lines like MQException cannot be resolved to a type, etc. So I guess this is the same as a NoClassDefFoundError in this case.
Oh, there's also some unresolved imports
 
Oh. That's different.
Also, I'm in the Java room as well if the C++ people don't want to hear more Java.
 
So, a more generic error is thrown because it contains errors of different kinds, right ?
 
I suppose. You'd have to track down why it's throwing the error, which it sounds like you have an MQException class trying to be cast as a different class.
Or that it doesn't have the correct handling for the MQException, and is throwing a different error altogether.
Oh, hey. This sounds like your problem.
I guess I should have googled before speculating. Did you not have the imports? Or possibly have the wrong ones?
 
Well the code Works On My Machine™
In fact i'm afraid it's just a missing JAR
and weblogic is messing things up with all the dependency injection/reflection shit
 
3:40 PM
That's terribly likely. Check also that the library doesn't need to have .so or .dll files put into the library path. This is one of the reasons JOGL was having problems working with NetBeans for me. (Which also seems like a bad practice on the part of JOGL to me.)
Just as a side note, it's sad when people care so little about a language that they'd rather discuss it in a room dedicated to another language entirely.
Then again, I would say that Java deserves that kind of treatment.
 
This room is currently dedicated to lynching. The "C++" in the name is just for show :)
 
Yeah, this is not the room ;)
To get back on topic, it's very likely that a .so is missing (or whatever is the SunOS equivalent).
 
I thought the C++ room was abandoned, and this one took over. Ah well.
 
This is the original one. Long story.
 
@kbok I'm going to be honest, I'm probably not that much help in this area.
 
3:48 PM
How do we quote again ?
@Poik No problem :)
 
I think I will have to mess around with Weblogic's configuration files, global environnment variables, etc.
19 hours ago, by Martinho Fernandes
We all know this is the C++ room, but it isn't the room.
Hum, this is not what I intented
 
@MartinhoFernandes Ah, see, I read that before. Does that mean there is no "official" C++ room anymore?
 
1 min ago, by kbok
I think I will have to mess around with Weblogic's configuration files, global environnment variables, etc.
@kbok You use a permalink to a message to one-box it.
 
I don't know what you mean by official, but this is the one where people sometimes talk C++. We could just rename it to Lounge<Java> if we wanted :) There's no "officiality" here.
 
3:51 PM
> You use '>' with text to make a quote.
 
@LucDanton Thanks
 
@kbok And you use :1037849 (really you click on the arrow on the right of the message) for a threaded answer.
 
There are two "Android rooms" for example.
This one has to be the most pointless edit ever.
Oh, it's fixed now :(
 
@MartinhoFernandes Err... No thanks. Okay, so there's less structure to these chat rooms than I originally thought. Awesome. :)
 
Dammit, forgot we can edit edits with impunity on SO.
But originally all that edit did was add "EDIT" at the end.
 
3:55 PM
lol
We can edit edit history ?
Do we have an history of edit history edition ?
Can we edit it ?
 
You have a 5 minute window to edit edits on SO. No paper trail is left.
 
I see. Bummer :)
 
I like it because, for example, lots of times, after an edit, I notice the tags are wrong. I edit the tags afterwards and it's just one big edit.
Lots of edits and a question/answer automatically goes community wiki.
 
Hmm, I think I observed this before.
BTW, It's very hard to come back to "regular" forums once you're used to the numerous features of SE.
Same goes for the chat.
 
Yeah, I noticed that too.
I keep looking for the edit button everywhere I go.
 
@ÓlafurWaage [tag:]
 
hmm how was it again?
ahh
 
My tag is butter.
I don't really miss editing in other places.
 
But, but, all those missing periods!
And lowercase "i"s!
 
4:04 PM
@CatPlusPlus I don't feel challenged with python. I feel like everything has been done for me and I just need to put it together. It's like advanced Lego.
<-- doing some python stuff
 
That's what programming is about, putting things together. You don't really want to reinvent the wheel.
 
What if you really, really, really, really need a square wheel?
Or a tesseract wheel?
 
Take existing one and use a hammer.
 
That's for nails.
 
Python: STFU and use our libraries!
 
4:07 PM
Hammertime!
 
C++: Library what?
 
Boost.
Also, I'm pretty sure you can't hammer a circle (or if you prefer, a rather short cylinder) into a tesseract.
Never stops amazing me.
 
odd...
 
@MartinhoFernandes For a second I wondered if you had entered 'hammer a circle into a tesseract' into WA.
 
Tried it. It knows about circles, about tesseracts, and about hammers, but it can't mix them.
Wow, us humans, just by existing, produce 475 GW of heat.
That's 1.3 times the electric power produced by all nuclear power plants.
Dammit, I think I got stuck.
 
4:25 PM
How come no one has yet used the name 'Vitamin C++' for a C++ project? "Use the Vitamin C++ library to pep up your programs!"
Too corny?
 
Definitely.
 
everyone knows vitamins are for pussies
 
hi, btw
 
hi... no monkey sex yet? Strange...
 
4:27 PM
@MartinhoFernandes It knows a lot of quotes.
 
@hexa not sure if saying "hi" after a statement like "everyone knows vitamins are for pussies" is required :D
 
it's not required, but i liek it!
 
It's not just the quote that it knows, it really knows the speed.
 
It isn't even a king to have to know those things.
 
Oh why did they have to put a "Random" button there!
 
4:31 PM
@MartinhoFernandes Yes, the results take this form where the quote only appear in the fine print.
 
There's no way out now.
 
'4 inch pipe PVC'? I must know all there is to know about it!
 
And unlike wikipedia's "Random article" I don't get sent to the three line article of some town no one ever heard of.
 
Ok, that's enough. Back to work now.
 
4:46 PM
Data breakpoints in VS C++, can I use that to watch strings?
 
@MartinhoFernandes If violence doesn't solve the problem, you aren't using enough.
 
Does that imply that there's a full ordering of problems, based on the amount of violence required to solve it?
Maybe we should create a notation for it.
Like, big-V or something.
 
4:59 PM
How come push_back returns void?
I guess it's used very often, so don't pay for what you don't use.
 
What did you want it to return?
The container or the element?
 
an iterator, like insert. But it's fine.
 
Hmm, I guess it's the don't pay thing. insert already uses iterators, the return value comes practically for free.
 
Yep.
One last upvote before 3k.
 
That's the close vote threshold, right?
 
5:09 PM
Yes.
 
trying to understand how this piece of code works rsujskf.blog32.fc2.com/blog-entry-1006.html ..
 
> #define REP(i,a,b) for(i=a;i<b;i++)
I'd stop reading right here
 
ignorance is bliss
 
well i don't understand how it handles functions with multiple arguments
like asdf(a,b,c)
 
5:23 PM
It extracts each argument by finding the next comma at the same "parenthesis balance level" (k in the code).
And it invokes itself recursively on each argument.
 
It's a poor, poor code.
And that define is a "don't read me" sign, really.
 
I like the lowercase version for the case where you start with 0.
Real time saver there.
 
@MartinhoFernandes yes I got the second part
@CatPlusPlus the code is fine
 
No it isn't.
 
@Nils No, it's not.
It might work, but it's certainly not 'fine', by any measure.
 
5:26 PM
does it work well or not?!
it was written for a competition and not for a commercial product
 
Doesn't make it fine.
 
And doesn't justify the pointless macros at the start.
Nothing does, really.
 
And called rep. What the fuck does that mean.
 
rep[eat]?
 
inline functions, they exist
 
5:28 PM
@CatPlusPlus Your free to rewrite / improve it, show me your solution I would like to see how it looks.
 
Big repeat and little repeat!
It's missing rEp, the middle repeat.
 
@CatPlusPlus Would you be able to come up with such a solution for that problem? I don't.
 
Just by removing the macros and using Real for Loops™ would make it a lot better.
 
@Nils I'm not interested enough to try to guess what it is supposed to do.
 
so your not
 
5:30 PM
He doesn't know the problem.
 
My what?
 
And honestly, it's not that complicated.
 
@MartinhoFernandes can't VS do that for me..
 
Also why it's in the class.
It doesn't have any invariants or state.
 
Als
5:31 PM
Hello Folks
 
@CatPlusPlus tc
 
Or some similar language with REP instead of for.
 
@Nils Eh?
 
tc requires you to write a class with a specified method
so they can test it afterwards
 
Good grief.
 
5:33 PM
What happened to good old stdin => stdout?
 
That's even worse than your average online judge.
Well, a little better. But requiring a class is stupid.
 
I don't consider myself a genius but when I did competitive programming, I wrote readable programs.
And I went to IOI.
 
IOI?
 
The International Olympiad in Informatics (IOI) is an annual computer science competition for secondary school students. The first IOI was held in 1989 in Pravetz, Bulgaria. The contest consists of two days computer programming, solving problems of an algorithmic nature. Students compete on an individual basis, with up to four students competing from each participating country (with around 81 countries in 2004). Students in the national teams are selected through national computing contests, such as the Australian Informatics Olympiad, British Informatics Olympiad, and Bundeswettbewerb ...
 
Input/Output International.
 
5:37 PM
Gotta go now.
 
Als
hmm...
 
bye
 
Als
5:39 PM
geez @Nils, You are late in buying him, he byes and left :P
 
buying him?
 
Als
@Nils: pun intended
:)
 
well anyways I'm off solving some easier problems on projecteuler
:)
 
Als
@Nils: Sounds fun, Is that part of work?
I wish i would get to do that as a work assignment
@FredOverflow: Hola sire
 
6:23 PM
So, who's buying me something?
I don't mind, really.
 
No, we're just buying you.
Hope you don't mind.
 
6:37 PM
Oh, look, no one's bidding. That means he's still going for only $1.00
 
Ok, I place a bet. Value is now $1.50
 
I think I can outbid you all.
And in any case, I am the only one with access to the product.
 
i bid $1.51
with $1 for shipping
 
Hmm, where's that question about multidimensional indexing operators?
Found it.
 
6:57 PM
Ah crap
Back to reality..... TVTrope pages stopped rendering
Did they set a limit?
 
Als
@MartinhoFernandes: Darn did i start a bidding process here?
:P
 
@Xaade Works fine here.
 
Yeah, but I've visited like 200 tropes pages in the matter of 30 mins
Dammit you tab navigation....
 
I had an idea
another
 
@DeadMG Hmmm.... that's not good....
Usually those are rare events.
 
7:07 PM
hey
I have six pages of ideas scheduled to be posted on my blog
 
No, I mean sunflares......
Usually sunflares are rare
What if, Quantum states actually collapse when the universe code compiles.... and since it appears to occur during observation, it's simply because quantum code is JIT compiled, and time pauses until it's done.
 
nah
 
Life is JIT compiled..... I don't know what I'm going to feel like until it happens.
 
that's not JIT compiling, that's just that state not happening yet
 
The universe is a blank slate. Particles are memory faults.
 
7:13 PM
perhaps it's impossible to express the universe in computing analogies
 
I just finished reading Effective C++, what should I read next ?
 
@kbok Around the world in 80 days
 
@kbok More Effective C++?
 
hmm, brain isnt working today, any spot what im missing here?
 
@Xaade I usually read one technical book and one non-technical one at a time
 
7:16 PM
yeah- you never defined or declared any foo in global scope
 
So i'm looking for a technical one
Though it's worth adding on my reading list
 
@DeadMG its declared as a friend in the class though
 
@EtiennedeMartel Yep, seems like the natural way to go
 
@Node Personal rule of thumb: always declare friends out of class first. Avoids a lot of hassle even though it's verbose.
 
@Node: So what? You never specified the scope of the function you're friending
 
7:18 PM
@DeadMG Well that puts it in the enclosing namespace then doesn't it?
 
@LucDanton: I don't believe so
you must explicitly declare the function to be friended before-hand
 
No you musn't.
(or is that a recommendation?)
 
@DeadMG It works fine if Test isnt a template type.
 
ok
and?
 
as Luc said, it would be in the same namespace as Test
 
7:20 PM
your problem isn't when Test isn't a template type
so I would suggest ignoring that fact
just declare the function first and be done with it
 
im more curious
 
> A function can be defined in a friend declaration of a class if and only if the class is a non-local class (9.8), the function name is unqualified, and the function has namespace scope.
 
if theres something like when you need to do mytype.template functionName()
 
Is that last clause a requirement or a consequence?
 
consequence, doesnt need to be in there. just wondering if there is a syntax for it, like mytype.template functionName() or bla::tempalte functionName()
 
7:23 PM
I'm trying to help but I seem to be facing Internet troubles.
> A friend function defined in a class is in the (lexical) scope of the class in which it is defined. A friend function defined outside the class is not
I'm not sure how relevant it is.
I can't access foo even when explicitly qualifying it.
In any case compilers are bad with this kind of thing I believe. Except for Borland, they tend to struggle with this stuff.
Yeah even if the lexical scope is the class's I think the name of the friend is present in it so that's not it.
> A name nominated by a friend declaration shall be accessible in the scope of the class containing the friend declaration.
 
declaration, not definition
 
When is a definition not a declaration?
 
true
 
@Node I don't remember the details but when the friended class is a template there is a lot of black magic going on.
 
yeah, nevermind. thanks anyways. s'pose i'll play about with that one later
 
7:38 PM
@kbok Or, "Two" at a time
I'm not good at doing one and one things both one at a time.
 
lol
It's one "one" too much
I should stop switching tabs in the middle of sentences
 
@Node After some more research I simply have no idea if what we see is conforming a lot. I found this link quite useful in summing up some of the gotchas that come with friends, but that doesn't address what's at hand.
 
thanks
 
I had a double-free bug today. Was kind of fascinating because I can't remember the last time I've had memory-related bugs
 
They remembered you.
 
7:47 PM
was in the only non-RAII'ified allocation I have, of course
 
I have no shame in having a finally wrapper to RAII-ify stuff when using less-than-enlightened interfaces.
 
I would be ashamed if I were you
 
That's why I code in Buddha
 
you should write a proper wrapper for it and encapsulate the poor interface, rather than hope you'll always remember to solve the problem
 
I don't 'hope' that I won't write lua_settop(L, whatever);.
The 'poor' interface is already encapsulated in luabind but not every call of the Lua API needs to have its counterpart.
 
7:54 PM
if you have to finally it on every use case, then it is just hoping that you will remember
and if it doesn't do it itself, then it is a poor interface
 
Every use case is two spots in the code.
 
yeah, that's what I'd usually do, but this specific case got kind of awkward. Type erasure on types with varying size and alignment, and allocated via _aligned_malloc and freed with _aligned_free. Ended up enough of a headache that I settled for soem kind of quasi-RAII ;)
 
What's the rule? Three strikes and you refactor? Well I'm one strike away.
I'm not going to write a wrapper for just two cases. Instead I have a wrapper that can adapt a variety of situations, including those two. I guess I'm still generic ain't I?
 
three strikes and you refactor?
where the hell did you get that from?
not being RAII is an 0-strikes refactor
 
It's extreme programming IIRC.
Again, I'm not writing a type just to call lua_settop in two spots of my code.
 
8:01 PM
Has anyone used completion ports ?
 
not much. I've played around with the api a little bit
 
Is it worth learning it ?
 
@kbok Well, I believe Boost.Asio wraps it so in case it covers your use-case already...
 
Lol
I was considering asio in the first place but a friend of mine told me to have a look at completion ports
So I gues it's settled
 
@kbok It's the most efficient async I/O API there is on Windows. So that, or a library which wraps it (like Boost.Asio) is very much worth learning if you need highly performant async I/O :)
 
8:05 PM
You may want to check the docs for yourself first though. Don't take my word for it.
 
the completion ports API is a pain though. The documentation isn't all that helpful, there are virtually no examples or tutorials available
 
Asio seems like the way to go then.
 
I have to build Boost 1.47 and check its move support heh.
Doing away with enable_shared_from_this will be awesome.
 
@LucDanton how does move support affect that?
 
Substitute some_asio_type.some_async_operation(bind(&T::completion_handler, shared_from_this(), asio::placeholders::error)) with some_asio_type.some_async_operation(bind(&T::completion_handler, std::move(*this), asio::placeholders::error))
 
8:22 PM
My power just went off at work a few minutes ago. I was hoping for an early day.
 
Seriously, I don't understand all this excitation about google plus
tbh google plus sucks
 
i like the group chat in it
but that is about it
 
There is no interpersonal interaction
You can't customize the visibility of your posts
You do not even have friends
 
@kbok Yes you can.
 
It's like, a social network for nonsocial people
@Poik How do you do that ?
 
8:30 PM
Only people in the circles you allow get to see them.
 
I know
but you can't specify it on a per-post basis
You have to create a circle for that
 
In fact, every time you post things, it shows you the circles that it's showing it to right under the post.
 
It's incredibly ineffective
 
@kbok Since when?
 
@Poik Oops, I meant "on a per-person basis"
I'm getting tired.
 
8:32 PM
@kbok Since when?
I just did.
Type + then a persons name in the same place you would put circle permissions.
 
@kbok You mean like facebook.
 
@Poik Oh.
 
@Xaade Yep.
 
Facebook isn't a social website. Facebook is a turn people into barcodes and feeds. I don't really see comments to wall posts as much anymore. Kinda hard to do now that people think every one of their thoughts is golden.
You know what my facebook page amounts to? A Bing advertisement about how bad search engines are. I feel the exact way.
 
That's what twitter is for, keep it off of FB (and GPlus).
 
8:36 PM
I say something and about 50 people look up, stare blankly, and repeat useless information.
 
You're criticizing people's behavior.
 
Yeah, I don't keep track of people on FB anymore, I only use it for event planning.
 
"Hey guys, my mom isn't feeling well." "Mom? I had a mom once." "Panda bears have moms." "A panda can't survive on fish." "Fish are dissappearing in Japan."
 
@Xaade It just sounds like your friends/acquaintances are trolls then
 
No, this is typical FB in particular
 
8:39 PM
My FB must not be typical then.
 
I agree with @Collecter here. I haven't had anything that bad.
 
I would know, now that everyone on facebook is a friend of a friend somehow, and that makes them entitled so view all my information. Yeah, new facebook setting..... and I was told about this 10 minutes ago. Too bad I can't change it for a few hours....
 
It always surprises me how people accuse facebook when the real problem is their peers.
 
No, the real problem is people in general
Facebook: Input people, output stupid robotic chat clones.
 
People will be on any networking site worth its time you go on. So no complaining
Alright, well work is over. See you all tomorrow.
 
8:41 PM
Funny, I said the same stuff a few weeks ago and it was starred.
One day you'll wake up and you'll hear facebook feeds in your head and find out you bought stuff online in your sleep.
"I'm sorry, would you like to be my neighbor on my farm. I need to increase its size so I have have virtual manure in my yard." "You want me to virtually sit next to you, so you can put shit in your virtual yard?"
 
virtual shit
it's virtual shit in his virtual yard
 
Virtually a shitty yard.
 
there's something virtual about the fact that it's shitty?
 
He virtually put shit everywhere.
 
he put shit virtually everywhere
 
8:49 PM
I think we have a winner.
Why facebook sucks? It leads to virtually shitty yards.
 
i r winrar
 
Is there anyone in the world still using WinRAR? I thought 7-zip has already won everything.
 
@DeadMG Congraduration!
 

« first day (275 days earlier)      last day (4673 days later) »