« first day (569 days earlier)      last day (4380 days later) » 

11:04 AM
hi!
 
hello
 
I have a Q.
 
fire away!
 
is it possible to work some part of app in Java, and then proceed with C++?
Is there any technology that could bind those two things together?
 
yes, but it's non-trivial and probably not worth the effort if it's just performance you're worrying about
you can embed a JVM in your C++ application
and you can generate Java bindings of your C++ stuff (e.g. SWIG or Boost.Python)
but it's a lot of work and the bridge is slow
 
11:07 AM
I see, excellent! :)
Doesn't matter, it's for scientific reasons.
Thanks, awoodland. :)
 
(I can dig out a few references on both approaches if you're curious)
 
Sure, it would be very nice of you. :)
 
stackoverflow.com/a/7506378/168175 and stackoverflow.com/a/10126794/168175 (it's Python not Java there, but the process is the same except for the compiling/running bit)
 
Thank you, awoodland! :)
 
@SerenityStackHolder feel free to poke me in chat if you have a specific question on SWIG or JVM embedded in C++
 
11:18 AM
If anything is needed, I will surely address to you, awoodland. :)
Thank you on your assistance.
 
@awoodland Dat a good photo, the crane one :)
 
@ScarletAmaranth It's really not that complicated...
 
@awoodland Swig++ generates JNI bindings. This then is the usual technology to bind Java to native code.
 
@awoodland There's also JNI
 
@KerrekSB I realize that there's probably no black nor arcane magic involved but I can't seem to find a good resource.
 
11:21 AM
@ScarletAmaranth You don't even need that. Just a cup of coffee and ten minutes in a dark room should do
This is a straight-forward design issue that you can just think your way through.
 
@sehe depends which way round you want it, e.g. Java calling C++ is fine with SWIG, but SWIG is useless for C++ calling Java
 
@KerrekSB It's not the design that confuses me, it's the behavior of certain allocators and move semantics that sometimes gets me. Like: Oops, that method wasn't declared as const, I'm not gonna let it touch me :)
 
> is it possible to work some part of app in Java, and then proceed with C++?
@awoodland I interpret this in that direction, mainly. It is rather ambiguous though
 
sbi
Winner of the 2007 pattern abuse prize: RT: AbstractSingletonProxyFactoryBean. lol, Java. http://bit.ly/tLPleG /via @jonicklas, @joshprice
 
@sbi wow...
 
11:32 AM
I assumed there was no way it was anything other than a piss-take until I clicked that
 
sbi
Oh, @awoodland has a new avatar, and it's not an animal. Pout.
3
 
@sbi Apparently there is a picture of a crane, though, somewhere undisclosed
14 mins ago, by ScarletAmaranth
@awoodland Dat a good photo, the crane one :)
 
sbi
@sehe WTF? I have no idea what that even means.
 
@ScarletAmaranth Certain allocators? Why are you messing with allocators?
 
11:35 AM
I was somewhat confused by the crane thing. Perhaps bender has a different name in translations of futurama?
 
@sbi It's the first line from the javadoc for that pattern contraption
 
either that or my tinfoil abuse is lacking
 
sbi
@sehe I guessed as much. I'm still not sure this isn't a prank. I mean, that phrase is pure gibberish.
 
Sadly, it looks legit
 
@ScarletAmaranth The point is that in associative containers, the key element cannot be modified. That's really all there is.
 
sbi
11:38 AM
A. Woodland Cranes and Lifting Equipment Ltd., Aberystwyth, UK — sounds pretty impressive, IYAM. Well, you might want to move the company to a town with a pronounceable name. But other than that...
@sehe You know, I like how, when you quote it, there's that face-palming polar bear right to the left of it. Reminds me of some technical books that have those nifty and helpful icons besides the text ("Remember This!" "Never Do That!" "Beware!"). That polar bear fits this scheme perfectly. ("OMG!")
 
@KerrekSB Yeah i guess I'll just have to give it an aimed thought :)
 
@sbi cranes and lifting equipment, wtf? Where's that? There's an A J Crane hire or something nearby
 
sbi
26 mins ago, by ScarletAmaranth
@awoodland Dat a good photo, the crane one :)
 
I thought you were saying the top hit for me on google was a crane hire company or something
 
Xeo
@sbi Which animals are present here anyways? We got an ape, a cat, a puppy, a chick, a polar bear, a dog, a lion, an ascii bird, what else?
 
sbi
11:49 AM
 
Xeo
Yeah, I couldn't quite tell what that is, though
It's not a normal fish
 
sbi
@Xeo It's two fishes.
 
Xeo
...
Okay, so add a fish
 
sbi
 
@sbi it's a good default for my utterances
 
11:50 AM
isn't that a snowman?
 
@jalf's avatar always cracks me up.
 
sbi
@awoodland What?
 
I think it's a penguin. With no feet.
And a funny face.
 
Hi folks!
 
@sbi Honestly, that javadoc contraption isn't much worse than 'declare x as pointer to function (array of pointer to function returning int) returning void' (i.e. void (* x)(int (*[])()))
 
11:52 AM
Like the guy who drew it was being chased by mobsters and had no time to finish.
 
sbi
And then there's the guy who's always here and rarely ever says anything:
 
Whether it's useful is a whole different matter
The Praetorian Guard () was a force of bodyguards used by Roman Emperors. The title was already used during the Roman Republic for the guards of Roman generals, at least since the rise to prominence of the Scipio family around 275 BC. The Guard was dissolved by Emperor Constantine I in the 4th century. History The term Praetorian derived from the tent of the commanding general or praetor of a Roman army in the field—the praetorium. They were an elite recruitment of Roman citizens and Latins. The emperors also often employed a small separate unit of bodyguards, distinct from and, ...
 
@sbi probably logged in once on a headless machine in a data centre somewhere and forgot to log out?
 
A while back there was a Q&A featured in the SO newsletter, where they explained why 10[a] is equal to a[10] in the C programming language. Does - by chance - anyone in here have the link to that Q&A ?
 
> In the film The Net, the 'cyber-terrorists' who use the internet to destroy the protagonist's life, at the bidding of a millionaire computer entrepreneur are called 'Praetorians'.
 
sbi
11:53 AM
@awoodland No. I think he's posted a message or two once in a while. Rarely ever, though.
 
@Xeo Seriously? It's the dopefish!
 
Alright, first day at work today. See ya everyone!
 
@sbi oh my, seeing it in this size I just recognized where it's from
 
Xeo
298
Q: In C arrays why is this true? a[5] == 5[a]

DinahAs Joel points out in Stack Overflow podcast #34, in C Programming Language (aka: K & R), there is mention of this property of arrays in C: a[5] == 5[a] Joel says that it's because of pointer arithmetic but I still don't understand. Why does a[5] == 5[a] ? Edit: The accepted answer is great...

 
and yes, mine is a penguin
 
sbi
11:55 AM
@jalf Snowman!
 
@Xeo wow cool. Thanks a lot
 
sbi
Who the hell would star an image link to @jalfs avatar?
 
I had a really hard time finding that Q&A via Google
 
Xeo
@yas4891 I knew that it was highly voted, so I just sorted the C++ question list by votes
 
@Xeo d'oh. I'm such a dumb ass
 
sbi
11:57 AM
@yas4891 Well, @Xeo is our assistant robot-in-residence, he finds such stuff in no time. Don't compare yourself to a machine.
 
@yas4891 No need to use offensive language :)
 
@sbi charming ;-)
 
sbi
@yas4891 Yeah, for an assistant robot he's quite nice, actually. He won't drink a beer with you, though. (When I talked to him, he preferred some dark, mysterious liquid. Yeuchz.)
 
Xeo
@sbi Sorry that I don't like beer!
 
@sbi someone who recognizes that it is AWESOME
obviously
 
12:01 PM
@Xeo in Germany this kind of behaviour is deemed offensive
 
What's mysterious about a brewed beverage with a bitter, acidic flavor prepared from the roasted seeds of the coffee plant?
 
Xeo
@yas4891 Was für ein Zufall! Rat mal wo ich her komm. :P
 
As long as it's brewed :)
 
@Xeo Geh sterben! :-) Das gehört ja verboten!
 
@yas4891 Schnell, hier braucht man Flags!
 
sbi
12:02 PM
@sehe It wasn't coffee. I suspect it was machine oil.
 
Xeo
@sehe He wasn't talking about coffee
 
@Xeo Where from exactly ? @sehe
 
sbi
@yas4891 The coffee?
 
@sbi nope, the guys :)
 
@yas4891 You just gave him a rather explicit threat :) He won't give you his GPS coordinates
 
sbi
12:03 PM
@yas4891 Have you tried to look at our profiles?
 
@sbi only Xeo's, there's no exact location
 
Xeo
"in your code" is very exact!
 
@Xeo, oh my... he's in my code!
 
@yas4891 I'm from holland! I'm not under any tirannic constitution that mandates the consumption of Bier.
Right here, coffee is the law
 
Xeo
Or, well, maybe not! Depending on the size of your codebase
 
12:04 PM
I knew there was a bug somewhere...
 
Xeo
>:D
 
@sehe yeah. And no longer serve coffee to foreigners :)
 
@yas4891 Huh
 
@Xeo LOL yeah. Two months ago I OH'ed a guy from Google say "small code base... like a million LOC" :)
 
Xeo
@sehe Is it bad that I don't like coffee either? /ducks
 
12:06 PM
@sehe "coffee" as in coffee shop. There was a change in the law, that the coffee shops are no longer allowed to sell Marihuana to foreigners
@Xeo So what's your drink ?
 
@yas4891 Oh that flew right by me. I don't drink 'coffee' in that way
 
@sehe neither do I. I heard it on the news
 
Xeo
@yas4891 Water, tea, soda mostly
 
@yas4891 not everywhere yet.
 
@yas4891 I heard you are required to have a card of some sorts. I don't know about any reasons that foreigners couldn't get one of those. I suspect it is just a measure to reduce 'casual' drug tourists
 
12:08 PM
Only in some of the cities in the south you need a weed card.
 
@classdaknok_t Not in Roosendaal? Is this an ad campaign?
 
@sehe In Roosendaal and Bergen op Zoom all coffee shops have been closed.
 
weed pass :)
 
@classdaknokt as of May 2012. But the restrictions will apply to the whole Netherlands in 2013
 
@classdaknok_t No way. I wouldn't have known.
 
In the news they had some local politician say things along the line of "the tourists are making trouble, i.e. being loud"
 
Oh most of them, not all.
 
and I wonder how many $$$ in taxes the Netherlands has gathered from those same tourists
 
:)
 
In my opinion Ivo Opstelten is a fool. If you close or restrict the coffee shops people start dealing on the street illegally.
Not that they don't do that already, in the alleys behind the school. :P
 
12:11 PM
@yas4891 well if that were so true, they would never stop them coming :)
@classdaknok_t near the railway station. It used to creep me out when I walked there.
 
@sehe yeah. I wonder how much it is - whether it is better for NL to allow it or not to
 
@sehe you've been in Roosendaal? That's cool.
 
@yas4891 I think it is quite simple: either allow the sale of soft drugs, or don't. Not some halfway measure.
@classdaknok_t I lived there for 17 years.
 
@classdaknokt I don't know. IMHO it is OK to prohibit the consumption of Marihuana
 
Remember, I went to het Gertrudis :)
 
12:12 PM
As long as you ignore those people they won't attack you or do anything.
@sehe Oh cool! :P
Wednesday is my last day with lessons. :D
 
@classdaknok_t Apparently I looked french or like I needed a shot because they would always approach me. Often in french
 
heh, that sucks
People asked me maybe once or twice if I wanted to buy some "shit". I just said that I don't need it to be happy and I went on.
 
@classdaknok_t I kept coming to Roosendaal for piano gigs and I'd always walk from central station. I guess that puts you in the 'target audience' for dealers right away
 
From September I'll be traveling by train every day. :P
From Roosendaal.
potential_customer.annoy(Weed());
Today I'm going to make myself understand rvalue references.
 
Use a stick and a belt. Makes you understand quite quick
 
12:23 PM
What? I have neither a stick nor a belt.
@sehe Oh yeah I know somebody with a red, identicon avatar said that, but I forgot you changed it so I didn't know it was you. :P
 
mind = blown
If someone asked me about your gravatar I wouldn't have been able to tell them what it was, not even the colour
 
@sehe I never had a default gravatar.
Oooh an rvalue reference is just a reference to an rvalue?
 
But I know your used to be known as daknok, then daknok_t then class_daknok_t and you're also known as WTP and WTP'' (or some addition) mainly for use on meta.
Amirite?
@classdaknok_t Nope. Or, sometimes as well
 
@sehe daknøk, daknok_t and class daknok_t, and WTP and WTP'--. In the past I just used my real name.
 
An rvalue reference is a reference to something that should be treated as a temporary (unnamed, hence usually rvalue). In that: the resources should be expected to be 'stolen' as the referenced rvalue/variable is about to die anyway
 
12:31 PM
So after casting an object to an rvalue reference, it's an xvalue? Well, after after.
 
I forgot about the ø and I didn't get the postfix right, but, my point was made: I don't care for gravatars
 
I remember people by their gravatars. :P
 
@classdaknok_t IIRC an xvalue is the superset of lvalue and rvalue
@classdaknok_t In my book, that means you don't remember people (on the net) :)
 
> An xvalue (an “eXpiring” value) also refers to an object, usually near the end of its lifetime (so that its resources may be moved, for example). An xvalue is the result of certain kinds of expressions involving rvalue references.
 
@sehe xvalue is the intersection of glvalue and rvalue
 
12:32 PM
The only thing you should do with xvalues is destruct them (implicitly), I guess.
 
@classdaknok_t ah then I was mixing it up with g*
Sorry
 
And if a function takes an object by value, it'll be moved when you pass it an rvalue, right?
And the same thing for returning them.
Only when they implement a move constructor, but that's obvious.
 
@classdaknok_t If you pass a true prvalue, it will be constructed in place, no move necessary.
 
@Potatoswatter that's cool.
 
Move never happens implicitly, there's only std::move. (Except sometimes when returning named objects.)
 
12:37 PM
@Potatoswatter unnamed? I guess both, really
 
@sehe No, named. An unnamed object being returned would also simply be constructed in place.
 
@sehe std::string foo() { std::string str = "bar"; return str; // moved str }
 
@Potatoswatter That's RVO
@classdaknok_t 'I guess both, really'
 
RVO is a little different. RVO (from C++03) is construction in place.
 
@sehe Didn't notice the edit.
 
12:38 PM
@classdaknok_t I guess I need to get myself a belt & stick as well
 
std::string f( bool q ) { std::string a = "foo", b = "bar"; return q? a : b; }
 
If I have a function that moves an object internally, should it take an rvalue reference? I'm confused. xD
 
^ No RVO possible because we can't construct both objects in place to be returned. But if the requirements for RVO are met, but it's semantically impossible, you return by implicit move.
 
@classdaknok_t I'd say as soon as it potentially moves from an argument
 
That is the only condition there's an implicit conversion to xvalue.
 
12:41 PM
-3
Q: Block Bad Word By Title Windows

Uhlv Oqv Oqvi want to block bad words by title windows for example if user seach google for "PRON" the program get title windows and compare it to blacklist in database ,the problem is how i can execute sql statement ,title windows ="Google search-PORN" when execute sql statment to compare the tilte with bla...

I fail to see the relationship between : Windows, SQL and Porn.
 
@sehe because then you cannot make the mistake of passing a named object without moving it, right?
// I've also seen something like this, which is pretty cool.
int main() {
  int a = 0, b = 0; bool foo = true;
  (foo ? a : b) = 42;
}
a will be 42.
@ereOn Not using any capital letters shows me that no effort is put in the question, and I'll just ignore it.
 
@classdaknok_t kewl, but no rvalue refs
 
Oh. :P
 
@ereOn They are all tied together by Delphi C++Builder
 
@classdaknokt: There are capital letters, where it matters: "PORN"
 
12:44 PM
@ereOn Precisely. I thought that was obvious.
@ereOn PRON
 
@Potatoswatter: Haha
 
@ereOn I was talking proper use of capital letters, for example when starting sentences. It's such a basic thing that "being bad at English" is no excuse.
 
By the way, what's the status of Delphi C++ builder regarding others compilers ? Is it as "advanced" as, say, g++ or VC10 regarding C++11 implementation ?
@classdaknokt: i Always fOund IT difficulT to knOw whEN to USE capiTAL LetTeRs.
 
@classdaknok_t I'm bad at shift-keys
 
@ereOn Stable release 7 months ago. That's too soon after the new standard.
 
12:47 PM
@ereOn Delphi C++ - is that thing?
 
@sehe and periods.
 
Xeo
@classdaknok_t As a man, of course he is.
 
@sehe: Not sure to get what you ask.
 
Says the ellipsis-abuser
 
What?
 
12:48 PM
@ereOn You asked "what's the status of Delphi C++ builder"
I know about Borland C++ Builder, embarcadero, and Delphi
Delphi C++ Builder sounds like a contraction of those, or have I missed the latest fashion wave?
 
@sehe: Doesn't C++ builder belongs to the Delphi suite ?
I know of the Delphi language of course.
 
@sehe the IDE is written in Delphi.
 
But I thought it was also the name of a toolsuite
I might be wrong however.
 
It's just called C++Builder.
> C++Builder is a rapid application development (RAD) environment, developed by Borland and as of 2009 owned by Embarcadero Technologies, for writing programs in the C++ programming language.
 
Xeo
0
Q: Can't return std::vector in a C++ function, compiling error

Thiago MoraesI'm having the following error while trying to compile the snippet below (using g++): error: invalid initialization of non-const reference of type ‘std::vector<pos,std::allocator<pos> >&’ from a temporary of type ‘std::vector<pos, std::allocator<pos> >& (*)(std::...

Close votes please
 
12:50 PM
Buzzword!
 
@classdaknok_t you must be joking. Even if the IDE was written in Python, it would still be call Embarcadero C++ Builder
 
@classdaknokt: If you took that from Wikipedia, I don't accept it as a proof :D
 
@ereOn I don't care about people who think Wikipedia isn't reliable. :P
 
@classdaknok_t that trailing clause sounded a little redundant
 
@classdaknokt: Have you never edited Wikipedia to proove something you know was wrong to someone you don't care much about ?
 
12:52 PM
@ereOn No.
 
@classdaknokt: Neither did I. But still, my point holds :p
 
When I lie, I get a bad feeling, especially when it's about knowledge.
2
 
Sometimes a good lie can save you.
 
Xeo
Woops, there I go with being a bit too hasty closing questions...
 
My biology teacher writes calcium ion as Ca++, with "++" above the letter a. Looks very funny. :P
 
Xeo
12:55 PM
Can we get that reopened please? :D
 
@Xeo You can never close too many questions.
 
@Xeo One way or another, that shoddily thrown-together question deserves to be closed.
 
Reopened.
 
Xeo
@KerrekSB Sure, it's not the complete code, but the error tells us what the problem is. I just didn't read it carefully enough
Maybe the sort_matches was originally an in-place sort function that returned the original matches vector, but for testing with a local vector the OP removed the reference from the return type
 
@Xeo and me, for blindly following suggestions
 
12:58 PM
Whichever way you spin this, the original problem is unrecognizable within the question. The OP needs to post real code, badly.
 
@ereOn Maybe, but in 97% of the cases, lies just get you into trouble. And if you need to lie, you probably are in trouble already or else you wouldn't need to lie.
 
Xeo
@KerrekSB It's a single character that's missing (most likely), it's not as bad as many other questions
 
@GManNickG @EtiennedeMartel hey you guys should really tells us we are awesome and stuff!
 

« first day (569 days earlier)      last day (4380 days later) »