« first day (667 days earlier)      last day (4273 days later) » 

Ell
12:14 AM
hi guys
 
I thought you went to [bed]
 
Ell
I am in bed
I have ninja'd the laptop again
:D
my brother used up 775mb of 2gb playing kingdom of loathing :O
 
2GB? are you on wireless internet? what kind of volume limit is that :S
 
Ell
mobile broadband :/
but its enough for daily chatting and looking up a few things
2gb for a month :O
 
$$$?
 
Ell
12:24 AM
35 euros
 
hmm. my mom has 50/10 mbit broadband at home for 39€
 
Ell
50/10?
oh broadband
we don't have a phone line here, see
 
50mbit down, 10 up
you have no phone?
 
Ell
its a holiday home
so no phone line
 
ah
that makes sense :)
 
Ell
12:29 AM
its just annoying for when I want to download libraries
or things like doxygen which take up a bit of space
 
12:44 AM
good evening everyone :)
 
hi
 
would anyone happen to have any experience with python's mysqldb module?
 
not me
 
nope
 
Ell
nope
I'm off to actual sleep now everybody/anybody/nobody. Nighty night!
 
12:55 AM
Oh dear, JonTron and Egoraptor decided to make a YouTube channel together.
 
@Cheersandhth.-Alf excellent song!
 
yep
of course, like successful holliwudd movies there are follow ups, version II on Reload and version III on I don't remember
 
1:41 AM
does anyone happen to have experience with just mysql? :P
 
2:07 AM
@ITNinja I did use MySQL a few centuries ago, back when I was a PHP dev.
 
@EtiennedeMartel would you happen to know how to prevent string concatenation? i know in sqlite3 (python) '?' character, is there one like that in mysql?
 
@ITNinja What do you mean?
 
basically, is there an operator that takes a value as is? (to prevent sql injection)
 
No.
What you want is prepared statements.
(Or the equivalent on whatever driver you're currently using).
 
yes :)
ok, darn-it....
 
2:12 AM
The raw MySQL C binding has support for that sort of stuff. dev.mysql.com/doc/refman/5.0/en/mysql-stmt-prepare.html
 
Which means any driver has support as well, since they mostly wrap the C binding.
 
It felt rather painful last time I tried to code straight to it.
 
i just had an idea, i dont know if its a good one, but what if on registration i generated queries in advance to be executed later instead of generating them on demand?
(in a website environment is what i was thinking for ^^)
 
Erm.
Why would you do that?
 
idk, just a thought lol.
 
2:25 AM
Hmm quick question
Anyone here o_o
 
feel free to state your questions, but a flame retardant suit may prove helpful
 
@Managu Oh, we're not that violent.
 
oh? Well, the active regulars count does seem kinda low at the moment. I suppose the volcano might be calmed, slightly ;-p
 
2:51 AM
Well, seems like the guy doesn't want his question answered...
 
guess not lol
 
 
3 hours later…
 
2 hours later…
7:22 AM
^ Cute news from Chile: this dog saved her whelps from a fire, carrying them out of the burning house in here mouth (and giving them over to the firemen)
 
Using the using directive inside a header is usually considred bad practice since the using directive then also applies to all source files which include the header. Is putting everything, including the using directive inside an empty namespace a good practice?
 
no
it's the same problem
assuming that by "empty namespace" you mean "anonymous namespace"
but you can more safely (less unsafely) put using directives inside named namespaces even in headers
as long as it's clear that identifiers brought into those namespaces that way, are part of the public interface
 
Ah so named namespaces would prevent using from propagation, but anonymous not?
 
they don't prevent exactly. but then it's up to the client code. if the client code does using yourNamespace, where yourNamespace has a using namespace std, then perhaps there will be name clash with std::distance or whatever. but at least it's then up to the client code.
even more safe (less unsafe), you can add e.g. using std::accumulate in a named namespace in a header.
that's what i do, in general -- but then it's mostly only code for my own use ... :-)
afk
 
morning all
 
7:32 AM
@Cheersandhth.-Alf thx
 
> We just stimulated her genitals
ಠ_ಠ
 
It's a good thing to do. Read on.
 
Xeo
> "You guys give me too much credit..So anyway, we were up at 3 a.m. feeding the kitten"
lol
 
I can't help but suspect 4chan style trolling... but it sounds ligit
 
7:43 AM
Pics later.
 
7:57 AM
@Nils Repeat "using namespace std; is evil" ten times a day until you're cured from std.
 
> Today he also dropped his first little kitten fart, which was pretty potent
lol
 
The smell of dying intestines?
 
> If you need an excuse for celebration, today happens to be an anniversary! The C++11 standard was approved by ISO on 12 August last year, exactly one year ago.
dang, we missed it!
room topic changed to Lounge<C++>: Happy birthday, C++11! [c++] [c++11] [c++-faq] [fun] [nsfw]
 
8:20 AM
0
A: why doesn't std::remove_copy_if() actually remove?

FredOverflow is there an STL algorithm for conditionally removing (moving?) elements from a container & putting them in another container? The closest thing I can think of is std::stable_partition: std::vector<int> v; // ... auto it = std::stable_partition(v.begin(), v.end(), pick_the_good_one...

0
A: What's the difference between void* and void**?

user1591701whats the difference between (void **)&x and (void *)x i will give u code plz help me out. float *xd; int size=width*width*size(float); cudaMalloc((void **)&x,size); 1 cudaMalloc((void *)x,size); 2 cudaMalloc(&x,size); 3 cudaMalloc(*x,size); 4 cudaFree(xd); I j...

How is this an answer? lol
 
It's a question. Not an answer. lol
 
Xeo
Flag, downvote, vote to delete
 
Wash, rinse, repeat.
 
Hey guys. I just have a quick question, pardon my possible lack of knowledge here.
I have a question about C# vs MFC. --> MFC uses message maps to avoid lengthy vtables for virtual calls right? So how is this overcome in C#/.NET? In .NET we have tons of classes and their base classes with virtual methods all over the place. Doesn't that create lengthy vables?
 
8:27 AM
There is no conceptual difference between a message map and a vtable.
 
Xeo
@gideon The pinned message on the right, read it.
 
@gideon ಠ_ಠ
 
147
Q: How to learn proper C++?

ChrisWhile reading a long series of really, really interesting threads, I've come to a realization: I don't think I really know C++. I know C, I know classes, I know inheritance, I know templates (& the STL) and I know exceptions. Not C++. To clarify, I've been writing "C++" for more than 5 yea...

2
I could swear I have never seen this question, but it already has my upvote. Brain, y u fail me?
 
@FredOverflow I don't think I've seen it either.
 
@StackedCrooked Did it already have your upvote, too? ;)
 
8:30 AM
@Xeo the one that says "if you're new here" ? I have, did I do something wrong?
 
@FredOverflow Yep. Er, no.
 
@gideon well... this is a C++ room...
 
Xeo
@gideon Not yet, but your messages were kinda indicative that you were going to. :)
 
lol
@gideon If you can't decide between C# and MFC, just use MFC#.
 
@thecoshman but my question is about how this C++\MFC problem relates to .NET.
 
8:32 AM
@FredOverflow MFC++ (Considering # means 4 plusses.)
 
@gideon your question did not mention C++ at all
 
@thecoshman MFC.
 
@thecoshman ah sorry, well the C++ in MFC to be precise. I assume this inheritance based eventing could be a general C++ problem?
 
@StackedCrooked How is ++ four plusses? :) I only count two.
@gideon Inheritance is a problem alright.
 
@FredOverflow I said # is 4 plusses.
 
8:35 AM
@StackedCrooked Wouldn't MFC# equals MFC++++ then?
 
Yeah.
 
@FredOverflow MFC+=2 don't you mean?
 
not ugly enough
 
but now that looks like MFC is wielding a gun that fires the a number two
 
MFC-(-2)
 
8:36 AM
@thecoshman That means taking a dump, right?
 
@FredOverflow indeed it does :D
poop jokes all the way!
 
static locals are default initialized ;) Or was it value initialized? Damnit, I never get this right. — FredOverflow 32 secs ago
 
@FredOverflow I thought a variable is never initialised unless explicitly done so, or the compiler has chosen to add a value for you, such as debug mode
 
@FredOverflow Zero-initialized, then default-initialized if it has a constructor.
 
@thecoshman Na, that would be too simple a rule for C++. Initialization is much more complex.
@ecatmur Is that the same as value-initialized?
 
8:45 AM
also, does that question apply equally to 'C'
 
@thecoshman Sure, statics are always initialized in C.
 
I know it is good reinforce the that C != C++ (oh god it feels wrong to write that) but where a question can apply equally...
 
I don't see a C tag on that question.
 
@FredOverflow nah, value-initialisation does more work
 
Garbage-initialization.
 
8:48 AM
@FredOverflow I am suggesting one be added, and differences indicated
 
It's the difference between (function/class scope) char c; and char c = char();
 
@thecoshman DeadMG will kill you if you add a C tag.
 
Xeo
@ecatmur In C++11, I'd write the second as char c{}
 
@ecatmur Yes (though class scope depends on what ctor does).
 
@Xeo Too late, I already saw the MVP ;)
 
8:49 AM
Disregard me, I thought it was a question.
Derp.
My brain is definitely not working today. I barely slept.
 
Xeo
@FredOverflow What does that have to do with MVP? It's just the better way to ensure value init in C++11 :P
 
@FredOverflow ignoring him for this. Does that code snippet not compile to valid C code as well, are not the initialisation rules something to know about in C, are they the same or different, do we really need two question to point out the same thing when we can just say "same applies to C", does it really matter what Dead moans about?
 
@Xeo well, that's value-initialization via list-initialization. But yeah.
 
Chat input box is resizable, but a bit wonky at that.
 
C rules for initialisation aren't the same as for C++.
Why would you merge the two.
 
8:53 AM
@thecoshman There's the little matter of cout << ...
 
meh
not that fussed really
 
@CatPlusPlus They are for primitives and arrays, no?
 
C and C++ are separate languages. Treat them separately. Don't put them together.
 
@thecoshman ... >> cout notation is preferred.
 
Agreed, combining them here would just confuse the issue
And the OP is clearly confused enough already.
 
8:54 AM
@StackedCrooked >>= print
 
That's the bind operator iirc.
 
Asked nearly 3 years ago. And I still haven't resumed my Haskell. Time for change!
 
Haskell monads ~= C++ Lamdas?
also, mondas sounds like gonads... he he he
 
No, they're not lambdas.
 
9:01 AM
@FredOverflow I don't do "using namespace std;" for anything serious.
 
Don't do that for anything.
 
using namespace std was put into C++ as an April fools joke (Why introduce namespaces and then immediately invent a mechanism to completely circumvent them? That's just plain stupid.) Unfortunately, by the time Bjarne discovered using namespace std, it was too late to remove it, because too much code already depended on it.
 
Xeo
All compound assignment operators in C++ evaluate right-to-left, right?
 
They are right-associative, if that's what you mean.
 
No, the evaluation order is unspecified. In Java and C#, they evaluate left-to-right, by the way.
 
9:07 AM
@FredOverflow Is that really so?
 
Of course not :) Don't believe everything I write.
 
At least I expressed my doubts!
 
@Xeo Is that even legal?
 
Xeo
@CatPlusPlus If that means that f() += g() += h() += i() will be parsed as (f()+=(g()+=(h()+=i()))), then yes
 
int i{}; i += 1 += 1; looks too much like ++++i;
 
Xeo
9:09 AM
@ecatmur ?
 
I guess for class types it's OK.
 
@Xeo But the order of function calls is still unspecified. f, g, h and i could be called in any order.
 
Xeo
@ecatmur I'm mostly talking overloaded operators
@FredOverflow How unfortunate
 
@Xeo Yes, they associate to the right. :P
 
Xeo
That really means you can't easily adopt monad's bind operator with operator overloading, eh?
 
9:10 AM
@Xeo So that's why ostream couldn't use an augmented assignment operator overload?
 
Xeo
And even without operator overloading
 
ostream couldn't use assignment, because it needs the operator to be left-associative.
Otherwise foo << x << y would not do what it was supposed to.
And that'd make poor streaming metaphor.
 
Xeo
@CatPlusPlus y >>= x >>= cout :D
but now you can't have operator>>= as a member of ostream
 
2
Q: How do you organize your code

ErèbeI usally code in C and C++ where implemantation and declaration live in a different file (.c/.h and .cpp/.hpp), but I often code in Haskell/Python/D where this distinction does not exist. My problem is when my code tends to grow I struggle to have a clear vision of what is inside a file. I miss ...

 
9:15 AM
@Xeo Seems like that'd be a conforming extension
 
This question is based on so horrible premises, and the answers are even worse.
I guess it's that does it.
 
Just allow free augmented assignment operators, and bingo!
 
@CatPlusPlus Four language tags? -1.
 
@CatPlusPlus Could be OK on programmers.se, I think
 
@Xeo << isn't a member, either?
@ecatmur Yes, migrate horrible questions to a horrible site.
1
Q: is it safe to store ssh keys on github?

ErèbeI would like to know if is it safe to store public and private key on a public git repository ? These keys are password protected. I'm willing to do that in order to save my current linux configuration. If it's not safe to do so, do you know a way to achieve my goal ? Regards

Ye gods.
 
Xeo
9:18 AM
@CatPlusPlus It is for many types
like void*
or char const*
 
But it doesn't really have to be.
.write should be enough in public interface.
 
Xeo
well, not my descision
 
You should never not question decisions that went into IOStreams.
 
The interface of streams is a mess anyway.
 
Xeo
indeed
Maybe we should start a Lounge effort and write a new IO lib? :P
 
9:22 AM
I love how someone just asked a question with a tag marked as DON'T USE.
Boost.IOStreams is pretty decent.
 
@CatPlusPlus ¬_¬ that's pushing the 'programming related' part of SO questions
 
@CatPlusPlus Belongs on SU IMO
 
the bane of my productivity... dependcies, and their lack of management
 
I was not talking about compilation's model superiority, but about readability. editing... — Erèbe 3 mins ago
Yes, declarations are so good for readability and editing, OP, g'job.
 
Xeo
@CatPlusPlus He is editing
atleas that's how I read the comment
 
9:33 AM
Why would he announce that he's editing the comment.
 
Xeo
the question
 
simple thing is not simple :P
 
mawning
 
hi
 
Xeo
9:48 AM
3
Q: Why aren't template type parameters inferred as 'const'?

MehrdadIf I have template<class T> void foo(T &) { } and I call it as foo((const int)5), given that the argument is a const int, why doesn't the compiler automatically infer T to be const int?

 
hello
 
Xeo
Anybody willing to pull together the standard quotes?
Don't have my copy of the standard handy
 
That's a lame excuse.
 
i dont even have any copy
 
Xeo
9:50 AM
@R.MartinhoFernandes shaddup :P
IOW, I'm too lazy to do so atm
 
-3
Q: Making a game in C

Renzo DimayugaI need help in making a Space Invaders-like game. I have two problems: 1.) How can I simultaneously control my character while my enemies are moving towards me? I tried combinations I can figure out using my user-defined functions scroller(); and enemy();, but I cannot simultaneously make my ch...

you should look at what the OP posted originally
 
> Please, do not put in anything C++ related! This is related to C only!
 
Xeo
Well, atleast he got that destinction right!
 
ikr
umm I cant delete it anymore ....
but then why is java allowed? xD
 
For 1, use threads. — Rohan 11 mins ago
 
9:58 AM
lol
 
Also, what's up with the beginners talking about "user-defined functions" ? I'm sure it's from a bad book or something
 
where does it say that?
 

« first day (667 days earlier)      last day (4273 days later) »