« first day (646 days earlier)      last day (4310 days later) » 

1:01 PM
Anyone familiar with wxwidgets? I'm just wondering how it handles resource management. For example:
MyFrame *frame = new MyFrame( _("Hello World"), wxPoint(50, 50),
                              wxSize(450,340) );
frame->Show(true);
SetTopWindow(frame);
return true;
Who disposes the frame?
 
wtf, they have a thing called _?
 
Xeo
@FredOverflow Some global cleanup I'd guess
@DeadMG Sounds like T_ from windows...
 
but I'm not familiar
 
I've been cleaning up (Java too) like this:
if (a) {
if (b) {
if (c) {
return true;
}
} else {
return false;
}
 
@FredOverflow probably the top window code
 
1:02 PM
@Xeo From the usage, I'd agree. But at least T_ is not just _
 
Xeo
aye
 
user784668
@DeadMG Yes. A macro for l10n.
 
I'm no good at this chat stuff.
 
Xeo
@Fanael I knew WxWidgets sucked, but that much...
 
@Xeo That might as well simply be gettext & friends and be entirely unrelated to wxwdigets.
Nice FUD going on.
 
1:06 PM
female urination device?
I got that from google, didn't make it up :(
 
one of those self-published crapbooks?
 
Xeo
Seems like it
I love the "short" description
It's even too long to paste in here
 
Someone should write a review of it >.>
 
I google translated it to English, but "About the author" is in French?
 
Xeo
1:08 PM
Copying the name of Bjarne's book alone tells much about it.
 
You google translated? >.>
You didn't just change it from amazon.de to amazon.com?
Oh, the about the author.
 
Don't judge me. I don't know how to work the interwebs yet, I'm still learning.
 
/selffail
 
@Xeo I don't think so.
the short description mentions Stroustrup.
 
Xeo
And a whole bunch of other stuff
 
1:12 PM
very true
 
Xeo
Comparison of Java and C++
One sucks
The other sucks much more
 
if I had to guess, I'd say that he translated the book and was given some credit for that.
 
Xeo
Which language is that book even in?
> Language: English
So much for translation
 
oof, member function pointers make my head hurt :(
 
Xeo
@jalf Which part? :)
 
1:16 PM
probably the calling syntax :)
 
@jalf you just can't handle the beautiful syntax :p
 
MFP's just suck
they are a very C style concept.
 
C doesn't have member functions.
 
I know that.
 
user784668
 
1:18 PM
but they really don't fit in C++ and they'd fit a lot better in C
"Got a problem? Introduce a new pointer! Make sure the rules are completely confusing and WTF and hardly implementable."
 
haha that's a funny way to see it
 
@Fanael That image really screams: I'm a douchebag.
 
I personally love pointers, as it is something to have fun with. For a client however, using pointers is not always a profitable choice for him.
Unless he wants to pay for more and more speed
 
What.
 
Yay!!! more fun.
I also like to have fun with laser pointers.
And Slovak Rough-haired Pointers.
 
1:34 PM
yay
 
Just in case somebody doubted that there are stupid questions …
 
I have fun giving pointers to not use pointers.
 
0
Q: Issue Log in vb.Net?

DFabeiroI have a problem with a log in... Well let me explain you my problem, the problem is that i want to create a log in with restrictions, I have some textbox with the binding source property changed to my database. But when I type something that is not in the DataBase the program got freezes, I will...

 
lol, then comes the "blue vs green lasers"
 
Forgot to mention pointers
@KonradRudolph Begs the question: why did you 'answer' it?
 
1:36 PM
repwhore!!!! Burn him!!11!
 
-1 not enough pointers
 
-1 not enough cowbell
 
"More cowbell" is an American pop culture catchphrase originally derived from an April 8, 2000, Saturday Night Live comedy sketch which fictionalized the recording of the song "(Don't Fear) The Reaper" by Blue Öyster Cult. The sketch featured guest host Christopher Walken as music producer "The Bruce Dickinson" (as opposed to Iron Maiden singer, Bruce Dickinson) and regular cast member Will Ferrell, who wrote the sketch, as fictional cowbell player Gene Frenkle. In the television special Saturday Night Live: 101 Most Unforgettable Moments, this sketch is moment number five. Synopsis The ...
FTW
 
@KonradRudolph I know when it is idiomatically used. I also know what it means. I'm sorry if I offended you by using the latter without prior written consent
 
1:39 PM
@sehe Now you confused me. My answer isn’t begging the question.
 
I have to be careful: while (I'm awesome) { // never terminates
 
it’s teaching him how to fish instead of giving him a ready-gutted one
 
@KonradRudolph No, but it is begging a question.
FWIW: I wasn't aware of the fact that 'begging the question' was usually used as an 'official' synonym for the logical fallacy petitio principii. Had I known, I'd probably understand your objection a little bit better
@keith.layne More precisely, the char literal is never terminated
 
@KonradRudolph rhetorical?
 
1:42 PM
@KonradRudolph It's sending him on an errand without a clear goal. If you teach him how to fish you teach him (a) how to ask a proper question (b) this is not one (c) to come back after trying things first :)
 
Using α for a lambda is fine but if you use area and αrea in my code base, prepare for nightmares. Yes, this is a personal threat. — Konrad Rudolph 22 secs ago
too strong? Or recognisable as a joke?
 
@KonradRudolph Recognizable as joke
Not a particularly strong joke, but still, obviously a joke
 
user784668
@KonradRudolph Bear in mind idiots won't recognize anyway.
 
People love to get offended here...
 
@keith.layne I certainly do ;)
 
1:44 PM
:)
 
@KonradRudolph α ρεrsoηαl τhrεατ, surely?
2
 
There's an "h" there!
You suck.
2
 
well, eta isn't exactly h-looking
already used up eta for the n
 
theta.
Oh wait, you wanted visuals.
Nevermind.
 
So, I wrote a programming in Haxell. It started out as a game but it morphed into a raytracer. The simplicity is tempting me to push it to a repo. Started commenting the code.
 
1:53 PM
Why is everyone saying this person got lucky when their program didn't crash for UB?
Last I checked that was unlucky.
 
-- Rayskell
-- Approaching raytracing like a functional motherfucker
-- Written by Domagoj Pandža, an imperative overlord
 
1
Q: Strings in ANSI C

MahmudemamThis is the third program in C language. This program is to demonstrate string concept. From study I know that string at its end has a null character '\0' to terminate the string. I wrote that code : main() { char name[8]; strcpy(name, "Mahmoud"); printf("The contents of na...

 
It is unlucky.
 
If you look at the history for the top answer, it was in there, too.
 
1:54 PM
You link to a C question and don't warn us to wear the goggles?
 
you know you've done too much Java when you enjoy doing some JS
 
You need goggles to C code. Get it?
 
Wow, the third C program ever.
 
No? Okay. :$
 
std::string& mystring = toStdString(myWString);
will this crash because the return value of toStdString goes out of scope ?
 
1:56 PM
does toStdString create a string in its body? Then yes.
 
What's toStdString?
 
probably a wide character cstring passed into something that makes an std::string out of it.
 
user784668
@helmus What's the type returned by toStdString? If it's not std::string& or the returned type has no implicit conversion to std::string&, it won't compile.
 
Fourteen flags? Well, well.
 
And probably tries to return it by reference, and bam, out of scope.
 
1:57 PM
Ewwww, wide chars.
 
@Fanael std::string toStdString(const std::string& s, UINT32 codePage=1252);
 
@thecoshman ogonek::codepoint FTW.
:P
 
that's the signature
 
@helmus It won't compile then.
 
@R.MartinhoFernandes you like your chars skinny?
 
user784668
1:57 PM
@helmus Then it won't compile.
 
fat bottomed chars are the only ones for me
 
but then again, it does
 
It returns an std::string, therefore, you cannot take a reference to it. Only const.
 
0
Q: Do people nowadays still code in machine language? In the Year 2012

ivanwong888899999This is quite a simple question, just a shot in the blue. I'm a student and I know embedded C , embedded Assembly and VB.net, with limited C++ Do machine language, those 0's and 1's, still got used nowadays? Because, I've read somewhere in this same forum, that if a new hardware is created, th...

I like the title.
 
In Visual Studio, when warnings are below W4
 
1:58 PM
@R.MartinhoFernandes I tried to work out what you where replying to for far too long :(
 
this is ignored.
 
but then how can it work ?
the warning level is 3
 
user784668
@helmus Non-standard extension.
 
@helmus Because Microsoft made a dipshit decision a long time ago and a lot of dipshits started to depend on it.
And now we pay the legacy price.
 
@chris THIS POST IS LIKE, KILLING ME.
You use /W4?
MSVC has warnings in the standard library with /W4.
 
2:00 PM
lol
WTF?
 
@helmus Set to /W4, then it will whine.
 
go figure, it's Microsoft
 
How the heck did they do that?
 
I don't think even MS recommends /W4, it's useless noise.
 
@CatPlusPlus True, but just for argument's sake, to prove a point. :D
 
2:01 PM
1
Q: How to use source-level multithreading in C/C++?

Sergey K.I need to gain performance by using 2 hardware CPUs on MS Windows. I write the following code: #include "windows.h" int main1(int argc, CHAR* argv[]) { // ... } int main2(int argc, CHAR* argv[]) { // ... } to write two main functions - one for every CPU. The compiler tells me: D:/M...

Is this a joke?
 
What is this C/C++ everyone keeps talking about?
 
Not bad as far as error messages go: "Warning: test.jar modified in the future."
 
Xeo
@CatPlusPlus I didn't get any in VC10
 
@Neil was the doctor involved?
 
How do I do X in Curry/Haskell?
Schmucks.
 
2:02 PM
@DomagojPandža It's C divided by C++.
 
user784668
@DomagojPandža let 5 = 6 in X
 
@keith.layne Not that I'm aware of, though maybe I was involved in an adventure involving Dr. Who and I don't remember any of it on account of the past having been altered.
I won't exclude that possibility
 
@DomagojPandža You think about it, then you just flip the table and do it in Python instead.
2
 
Who's this Dr. Who you're talking about?
 
@Neil you just exploded my head.
 
user784668
2:03 PM
@EtiennedeMartel If only Python had multithreading.
 
@R.MartinhoFernandes "The Doctor", actually. Last of the Time Lords.
 
@R.MartinhoFernandes Doctor Who for non-pedants.
 
@Fanael I heard that's mostly a problem with CPython because of the GIL.
 
He's not called Doctor Who whaaaaaaaaaaaargargbl
2
 
@R.MartinhoFernandes You're not british then I take it.
 
2:03 PM
you guys' sarcasm meter is off apparently
 
@Neil I'm a pedant.
 
@R.MartinhoFernandes So why wouldn't it be Dr. Who?
Sorry.. Doctor Who then?
 
user784668
@EtiennedeMartel And most of the time, CPython is the implementation.
 
@Neil It's "The Doctor" or simply "Doctor". "Who" is not part of his name/title.
 
@Neil Because it's "The Doctor".
No one is named "Who".
 
2:05 PM
Baaam.
 
user784668
@R.MartinhoFernandes Who?
 
yes
 
Lord Yu.
 
For all you know, his name really is Who
 
my favorite system lord
 
user784668
2:06 PM
@Neil His name is Ohw.
 
Actually, it's Neo
 
@ecatmur “a regsial thgeat”?
 
@Neil Nah. "The Wedding of River Song" pretty much implies that no, it isn't.
 
@Xeo basically, I need a nice way to create std::functions from arbitrary member functions (with fixed signature) of arbitrary classes. I want to be able to call something like register(this, &T::foo) (where this is T*), and have it bound as a std::function, but the syntax for it eludes me :)
 
I want a robot that will shrink me and let me command it from the eyeball
 
2:08 PM
I don't always make const expressions, but when I do, they're functions with no arguments.
 
@EtiennedeMartel Well the episode of "Doctor Who goes to the store" proves.. that.. um.. that it is! QED Pwned!
 
I always wonder why I try to counter troll logic with actual logic.
 
@EtiennedeMartel Because xor?
 
Troll logic ҂ actual logic.
 
I wrote a morphism once between troll and actual logic. It refused to work.
 
2:11 PM
@jalf std::function<R(A...)> register(T* thingy, R (T::* memfun)(A...))?
 
VARIADIC TEMPLATEZ0RZ
 
template <typename Class, typename Signature>
using member = Signature Class::*;
 
@jalf You can't.
 
Erm, why not?
 
overloads?
 
2:13 PM
And detonates.
Killing kittens in a 5 mile radius.
And we don't want that.
 
oh, and no C++11 either :(
 
Kill all the non-incremented cats.
3
@jalf You don't need the alias. (But it's cool)
 
@R.MartinhoFernandes yeah I know :)
 
Alright guys, I'm off to work. See you all in 30 minutes.
 
@R.MartinhoFernandes what exactly does that using directive do?
 
2:15 PM
@R.MartinhoFernandes memfun is not a member of T
 
@keith.layne Makes it easier to reference it.
 
@keith.layne Lets you do member<some_class, void(int)> for a member function of some_class that takes int` and returns void.
 
what does the * mean there?
 
@keith.layne Pointer to member.
 
@jalf Curious error. It should simply name.
 
2:17 PM
Coincidentally, it also works for member<some_class, int> for data members.
@jalf That's weird.
 
fun
thanks
 
@DeadMG it should simply name what?
 
the parameter
 
Lemme try it.
 
of course, it doesn't say T in the error, but the actual type being passed in as T
oh wow, I got something working
 
2:26 PM
What did you do?
 
@chris - int * and int[] are the same thing. Oh, please no.
 
Damn implicit decaying! DAMN IT TO HELL.
 
@R.MartinhoFernandes This is a template alias, right? I was confused about the context.
 
@R.MartinhoFernandes honestly, not sure what the difference is. There must've been some stupid typo somewhere
 
2:29 PM
Damn it, @jalf, grind that rep to 100k, it's painful to watch it at 99.5k :Đ
 
@DomagojPandža Give it another 14 days ;)
 
oh noes, I just came across a TVTropes link on Reddit. I'm forever trapped :P
 
Xeo
@chris Who said that? I have my fork ready.
 
@keith.layne Yes. The coolest thing since sliced bread.
 
Amen.
 
2:31 PM
@keith.layne, Yes, you can use using like a typedef: using i = int;
 
@R.MartinhoFernandes I tear bread with my bare hands. Makes me feel manly.
 
I gave an ideone proof.
 
oh wait, I broke it again. Goddammit
 
Xeo
@jalf Code?
 
sizeof is %u, right? If not, I'll have to change that.
 
2:33 PM
%z.
 
Use std::cout.
Oh wait, C.
 
You can also prove the underlying types, in the defining scope, it retains its size embedded in type info.
 
> Thanks for not providing any context in your question. It makes it a lot easier to help.
 
yeah, I thought that was classy
 
But, but... the Summer of Love!
Joel Spolsky on July 20, 2012

It’s summer here at StackHQ. Have a flower!

You’re welcome. Now on to some serious work. Can we talk about cultural anthropology for a minute? I’d like to talk about what happens when a community (online or off) gets to be about… oh, three or four years old.

Every community starts out needing to recruit members, so they tend to be very friendly to newcomers.

After a few years, an insider group of old-timers forms. They get to know each other. They know the rules. They know the history and the legends of the community. And it’s only natural to get little bit irritated when newbies show up who don’t know the rules. …

 
2:34 PM
Yeah, sorry. I much prefer cout.
 
(+++) :: Vector4f -> Vector4f -> Vector4f
Hah, defining vector ops in Haskell is so much fun.
 
Xeo
@DomagojPandža Why +++, WHYYYY
 
@Xeo Experimentation :D
 
cause it's more plusier
 
@Xeo Because + and ++ are already taken.
 
Xeo
2:36 PM
you can have inside operators (however they're called) and just use dot or cross D:
oh, simple addition
 
I hate using named operations, I prefer infix operators for such things.
 
@DomagojPandža Considered Num Vector4f?
Meh, some ops would be weird.
 
@R.MartinhoFernandes Yeah, but taking it step by step, I'm just enjoying the ride for now. It prints out some nice images as it is, I'll get into refactoring soon. And add more stuff.
I would like some way to make it infer the proper operator overload on incoming "type" :(
 
I don't understand.
 
To use + without too much hassle on Vector4f
 
2:39 PM
That's what typeclasses are for.
 
@R.MartinhoFernandes Without hassle. :Đ
 
What he said.
 
@DomagojPandža ’s no hassle
 
Ell
hi guys
 
Just an hour or two and I'll get down to rewriting it. Tried to reduce it to as little as 400 lines. Mostly the size comes from dealing with primitives and the rendering pipeline. Going to add in a loader for models from modeling packages.
Classes ought to make it sexier, but less friendly to the beginner.
 
2:44 PM
hi
 
@R.MartinhoFernandes And to make everything, you know, scientific, we’ve started actually measuring friendliness in comments, automatically, using Mechanical Turk. We’ll share some astonishing results of that study with you soon. Neat!
 
SO much love...
 
♦ Community moderator on Electrical Engineering.

I'm a student of Electrical and Computer Engineering at GVSU, with minors in Math and Computer Science

And says `int* == int[]`
 
keyword student
 
@DomagojPandža So? It’s not as if students of X learn proper C
(or proper any programming language)
 
2:51 PM
He's a minor in CS though lol
 
Actually, I would say it has nothing to do with being a student. It was just overconfidence in a wrong answer. I say wrong shit all the time. As long as he learns from his mistake...
As if anyone learns anything in school anyway....
 
@DomagojPandža there was a question on that last week, I think
 
Yeah it's good to accept when you're wrong.
 
I learn stuff in school, but it's not what they teach.
 
exactly
it's a function of you, not of your schooling
 
2:54 PM
5
Q: C/C++ int[] vs int* (pointers vs. array notation). What is the difference?

Alexander ReshytkoI know that arrays in C are just pointers to sequentially stored data. But what differences imply the difference in notation [] and *. I mean in ALL possible usage context. For example: char c[] = "test"; if you provide this instruction in a function body it will allocate the string on a stack...

 
@DomagojPandža how goes the web site?
 
It's a surprisingly nuanced difference.
 
@thecoshman He's playing with Haskell. What do you think.
 
@R.MartinhoFernandes (╯°□°)╯︵ ┻━┻
 
@DomagojPandža whenever I see your name I think of Kung Fu Panda.
 
2:55 PM
@thecoshman I took a little detour because of @R.MartinhoFernandes preaching Haskell. Damnz him!
 
I need an excuse to dig into Haskell again.
 
@keith.layne Parsers, raytracers, bragging-rights games?
 
I mean a good excuse :)
 
@keith.layne You took a bullet in the ass and it will be a while until you can do legitimate code? :Đ
 
Xeo
@keith.layne pure-functional masturbation?
 
2:58 PM
@DomagojPandža Woah, who's this? He/she goes to my alma mater.
 
@SamDeHaan The pointer-is-array guy?
 
@DomagojPandža Ayup.
 
as a default for pointers, would you say raw pointers or std::unique_ptr?
 
You should renounce any knowledge of him. stackoverflow.com/users/325514/kevin-vermeer
 
@DomagojPandža sadly, I have no clever response. Touche, sir, touche.
 
2:59 PM
Oh dear! I'm 15 minutes late!
 
fail
 
@thecoshman If you're doing high level work, smart pointorz. Low level work, raw pointers with extra care on the side.
 
@DomagojPandža He looks somewhat familiar, I may have seen him before. Weird, people on the internets who live near me.
 

« first day (646 days earlier)      last day (4310 days later) »