« first day (740 days earlier)      last day (4206 days later) » 

Ell
4:01 PM
@borgleader well I think you'd rather write "strict c" than c. like C but compiled with a c++ compiler
 
And write excessive casts when using malloc?
 
Ell
Yeah
 
@Ell While that has some good points (e.g., requiring real prototypes for functions, not just C-style declarations) it also has serious problems (like having to cast the return from malloc). If you're going to use a C++ compiler anyway, write C++.
@Ell A truly terrible idea.
 
Ell
Well i don't have any programming experience anyway :L
 
4:03 PM
probably "TP" and "two cents"
 
@LuchianGrigore Too tense
 
don't know more
oh , 2 tense
 
@kbok still no...
 
Ell
@luchian teepees and wigwams are two native American style tents
 
4:04 PM
ah
ok... I get it now
 
That was awful, can I say that? That was an awful pun
 
still a bad joke though....
 
It disappointed me, too
 
oh, you didn't understand the tent meanings. i don't understand the other (more obvious?) meanings
 
Meh, women.
 
4:06 PM
@EtiennedeMartel I love how they always find mugshots of the candidates when they do negative campaigning
 
silly americans
 
so, what does "i'm a teepee" mean other than being a tent?
 
They always look like they could kill somebody if they were having a bad day
 
@Cheersandhth.-Alf Nothing.
There's a reason it's a bad joke.
 
4:06 PM
@Cheersandhth.-Alf Who's a tent?
 
maybe me... :)
 
sin(gerine)/cos(gerine)
 
lol
"Can you please test the new version" "You added a pagination, did you ?" well erm yeah, isn't that supposed to be obvious ?
 
Bad pun time
 
 
4:14 PM
Oh god why...
 
 
@Neil Okay, bad pun time is over. Time to act like intelligent people again.
3
 
@R.MartinhoFernandes Could a conforming implementation implement the default copy assignment as a copy and swap if all (maybe even all but one) members are movable? It seems like that would be nonconforming :(
 
@MooingDuck No, it's memberwise.
 
@R.MartinhoFernandes spec needs rewording to allow it :(
 
4:19 PM
@MooingDuck Breaking change?
 
I wonder how much of the standard library has weak guarantees, when I thought they had strong guarantees. :(
 
Not saying I wouldn't like that, just that there's little hope for it.
 
@R.MartinhoFernandes T& operator=(const T&) = auto; maybe? :(
 
You can use contextual keywords there, so there's no need to reuse existing ones in confusing ways.
 
frick if I know what I'm doing.
 
4:21 PM
@R.MartinhoFernandes To get a proposal accepted, I think you'd just about have to do one of two things: either prove it really wasn't a breaking change, or else define fairly exact limits of what would be broken, and probably do some studies (e.g., of open source repositories) giving some indication of how little code would actually be broken (and it had better not be much).
 
@MooingDuck But the nuissance with that is that it disables automatic generation of all the rest. (same thing that happens with virtual ~foo() = default;)
 
@JerryCoffin it would change everything with a defaulted copy assignment operator, which would be... extensive.
That's it, we need a C++ restart. Not backwards compatible with anything.
 
@MooingDuck But how much code depends on the behaviour of assigning half of the object?
 
@R.MartinhoFernandes uncheckable
 
@MooingDuck Uncheckable?
To be honest, I think there's very little.
 
4:24 PM
@R.MartinhoFernandes probably, but there'd be virtually no way to check given a large open source project.
 
@R.MartinhoFernandes none. but it could impact on efficiency.
 
@Cheersandhth.-Alf also true
 
i'm thinking, the usual default in C++ is the unsafe efficient thing, then one has more verbose ways to express safe variants
and when those defaults are about core language things then it's difficult to provide an abstraction layer with the safe ops as default
 
I'm attempting to use std::thread and encountered this function used in its constructor: std::__bind_simple
What does std::__bind_simple do?
 
No idea. That's some internal implementation detail.
 
4:27 PM
the leading underscores tell you it's internal thing
 
So I probably should not directly use it, yes?
 
most probably it's an efficient but unsafe variant of binding
right
 
@LeviMorrison Definitely not.
 
Maybe you guys can tell me if I'm doing something wrong, then.
template<typename _Callable, typename... _Args>
explicit
thread_pool(int num_threads, _Callable&& __f, _Args&&... __args) {
    for (int i = 0; i < num_threads; i++) {
        pool[i] = std::thread(
            std::forward<_Callable>(__f),
            std::forward<_Args>(__args)...
        );
    }
    this->num_threads = num_threads;
}
 
is name calling, like "ID10T", sufficient reason to call on moderators and everybody who can see a flag?
i voted no but i'm not sure
 
4:28 PM
@LeviMorrison Is that your code?
 
@Cheersandhth.-Alf No, but reminding us of the existence of PHP is sufficient reason to call on the moderators to ban whoever flagged it.
 
If so, please don't use leading underscores for naming. Those names are reserved for the implementation.
 
@R.MartinhoFernandes Well, not the whole code, but I'm trying to pass the ... on to the thread. It compiles but I get an error while running it. "terminate called without an active exception"
 
Anyone have a -good- reference for HDC, HBITMAP, and other related Win32 shenanigans? I have no idea what I'm doing with this whole BitBlt business and it's annoying
I mean it works, but it's magic. I don't know why
 
4:29 PM
@Borgleader MSDN?
 
@LeviMorrison what is the type of pool and are you certain it has enough space?
 
@Borgleader msdn library, it's online
 
My screen! It's scrolling too fast.
 
Ell
MSDN is very good
 
clis
^ this pun
 
4:30 PM
@R.MartinhoFernandes u now, the Scroll Lock key?
 
@LeviMorrison why do you want so many threads with the exact same parameters?
 
@Cicada Is that a keming pun?
@MooingDuck A set of workers, perhaps?
 
@MooingDuck The threads figure out what work they need to do.
 
@R.MartinhoFernandes hint: no
 
4:31 PM
@JerryCoffin I know about MSDN, but it doesn't explain shit like if the data is on the video card your bmbits will be null (subject of my only question on SO).
 
@LeviMorrison Well, that particular piece of code looks fine (other than the reserved identifiers).
Can you run in the debugger and see what line blows up?
 
@R.MartinhoFernandes it was a pun on "guis" ;_;
 
@Cicada Oh gawd. So... undescribable.
 
hohohohoho
 
You should be ashamed of yourself.
 
4:33 PM
why the fuck would i
i'd rather be ashamed of yourself
 
That's what I said. Verbatim.
 
no it's not
 
@R.MartinhoFernandes No, actually. I'm on a remote system that doesn't have a debugger installed. I've tried compiling it with static to try to port the code to my machine, but it doesn't seem to work.
I've never used static compiling before because I've never had the need.
 
@LeviMorrison Oh, that's bad. You'll have to pinpoint that somehow :S Good ole log statements?
 
Guess so.
Thanks for looking at it anyway.
 
@LeviMorrison Oh wait.
There's something wrong with the code you posted. It may not be the cause of your particular crash, but it is certainly not good.
Suppose you pass an rvalue as the callable, or as one of args.
 
@LeviMorrison the static keyword is not related to porting, what do you mean "compiling with static"?
 
The first iteration of the loop will move it.
 
@MooingDuck I assume so, yes
 
Then what?
You probably don't want to move anything here.
 
4:37 PM
@MooingDuck I probably should have used the phrased "statically linked".
 
@LeviMorrison I don't see how that's related to porting either, but I'll trust you on that one.
 
Or does std::thread copy the arguments?
Now I need to check this myself.
 
I made it to:
        pool[i] = std::thread(
            std::forward<_Callable>(__f),
            std::forward<_Args>(__args)...
        );
 
Yep, seems it moves.
 
That's the line that breaks.
@R.MartinhoFernandes Well, that might be a problem for more than 1 iteration, but I'm calling it with one and still getting the exception.
 
4:40 PM
@LeviMorrison Are you passing rvalues as __f or __args?
@LeviMorrison Ah, ok.
 
@LeviMorrison so you have two problems.
 
@LeviMorrison Wait, what is your compiler?
MinGW?
Also, just to make sure, you must join all threads. When the destructor of a joinable thread runs, it terminates.
 
@R.MartinhoFernandes I'm using a fresh compilation of gcc 4.7.2
It never hits the join, btw.
I tell it to join, but it doesn't get there.
 
@LeviMorrison On Linux?
 
@R.MartinhoFernandes Yes.
 
4:45 PM
Ok.
 
CentOS to be specific.
 
Do you compile with -pthread?
 
Yes. Also tried lpthread
My threads work when I don't use the custom-made thread_pool wrapper.
 
Hmm. I'm out of ideas.
 
I've never tried to pass variable args before. I'm assuming my problem is there, somehow.
I tried doing it without using std::forward but nothing changed.
 
4:47 PM
Well, try with a normal, non-variadic ctor and see if it still crashes?
 
@LeviMorrison what are the args being passed?
 
Runnable* runnable = new Runnable();
thread_pool threads(1, &Runnable::start, runnable);
// class definition
class Runnable {
public:
    std::atomic<int> runs;

    Runnable() : runs(0) {
    }

    void start() {
        runs++;
    }
};
 
what is the main cause to 'undefined reference to Namespace::Class::Method' ?
 
@TonyTheLion For one, LOL is accurate -- I actually did laugh out loud at that. Not very loud, but still...
 
4:54 PM
heheh :)
 
@TonyTheLion I don't get it.
 
@rogcg Usually failure to define that method in that class in that namespace.
 
26
Q: What is an undefined reference/unresolved external symbol error and how do I fix it?

Luchian GrigoreWhat are undefined reference/unresolved external symbol errors? What are common causes and how to fix them? Feel free to edit/add your own.

 
@R.MartinhoFernandes you suck
 
@R.MartinhoFernandes No sense of humor at all! Q: What's the difference between a pregnant woman and a lightbulb? A: You can unscrew a lightbulb. [he doesn't laugh]. See, no sense of humor at all!
 
4:57 PM
@JerryCoffin Wait, what?
 
@TonyTheLion Evil penguins.
@R.MartinhoFernandes Sluuuurp.
 
@R.MartinhoFernandes It's from "My Blue Heaven" Worth watching some time when you have a couple hours to waste.
 
@TonyTheLion it also has text (not just video), nice.
 
I don't understand. Everything is set up. Even you guys saw my code (that stupid LexicalAnalyzer), and I fixed it.. now it's still failing to build.

undefined reference to all mehods in the class I instantiate
 
Ell
5:07 PM
are you sure you're compiling the .cpp ? :L
 
@Ell yes I typed gcc MyClass.cpp
 
try g++
 
When I try with gcc EntryPoint.cpp I get a bunch of undefined reference to std::basic_ifstream, (and I have included the properly libs).

When using g++ I have only undefined reference to my classes.
 
@rogcg you have to add all your .cpp files
 
Don't bother with gcc
 
5:11 PM
@rogcg you know how to compile and link multiple cpp files at once?
 
@bamboon should I use a makefile, or can I do it manually?
 
like g++ -o myprogramname main.cpp myclassA.cpp myclassB.cpp
 
@rogcg You can do it manually, but probably want to use a makefile.
 
@JerryCoffin depending of the amount of files
 
@rogcg He apparently has at least two -- that's enough.
 
5:16 PM
ok.. looks like it built. and it generated an .exe but it open/close very fast and it's written "file could not be opened"
 
use commandline
 
@bamboon same thing on command line
 
@rogcg You need to improve your error handling, so when things fail, it does a better job of telling you how/why.
 
Wait, if there are undefined reference to basic_ifstream, does that mean it can't link with the standard library?
 
@rogcg well sure, but you should be able to read the output from your program now
 
5:26 PM
@EtiennedeMartel either that, or you've somehow convinced it to (try to use) ::basic_ifstream instead of std::basic_ifstream.
 
@EtiennedeMartel He was compiling with gcc not g++.
 
@R.MartinhoFernandes now I used g++ and it built with no errors, and generated the .exe.. When I try to run the exe it says it could not open the file
 
@R.MartinhoFernandes In which case it's not that it can't link to the (c++) standard library, but that it didn't even try.
 
@R.MartinhoFernandes Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaah. I see.
 
wait!!!! I guess I know why!
 
5:28 PM
@rogcg Let me guess: It couldn't find a file it needed?
 
@JerryCoffin no..
worked!!
 
@rogcg Congo Rats.
 
hahahahh
 
@JerryCoffin Those are huge.
 
@JerryCoffin looks like some japanese pronounce
 
5:32 PM
@EtiennedeMartel That depends. Those from the French Congo are larger than those from the Belgian Congo.
@rogcg That would be Congo Lats.
 
@bamboon I probably made that joke before, but are you a baboon made of bamboo?
 
@EtiennedeMartel yup and yup ^^
 
@rogcg the best approach is to run the program from a command interpreter. in an IDE, if possible use the IDE's functionality for running the program via a helper that stops at the end (e.g. in Visual Studio, [Ctrl F5]). or for debugging, place a breakpoint at the final righ brace, }, of main.
but as mentioned, use the command line
 
@Cheersandhth.-Alf the unique IDE i'm using is sublime text. and it fails when I ask to build the EntryPoint.cpp
IDK how to setup this IDE, so I build via command
 
that's OK. you can still run the program from the command line.
 
user142019
5:42 PM
If it’s difficult to set up an IDE, the rest of the IDE is probably also crappy.
 
yes. I want to know how to do something like this:

pixel filename

instead of running pixel.exe and specifiend the name of the file directly on the source code.. got it??
 
sublime text 2 isn't an IDE
 
argc and argv.
 
@R.MartinhoFernandes interesting..
 
argv[0] is the executable, and anything after that is the parameters.
 
5:45 PM
@rogcg To get an idea of how to at least see what was passed on the command line: int main(int argc, char **argv) { std::copy(argv, argv+argc, std::ostream_iterator<char *>(std::cout, "\n"));}
 
@rogcg the built-in mechanism in C++ is the arguments of main. that works fine *nix. in Windows, due to the convention for the runtime library in Windows, it fails to handle international characters in filenames, so in Windows you might consider creating your own argument retrieval based on API functions such as GetCommandLine and family.
 
See 'Open File Guy'
 
lol
I doubt Google knows about the Open File Guy.
 
I dont know whats this
 
user142019
5:47 PM
Does Open File Guy support open-source files?
 
Alright, that's it, I'm gonna get into the depths of the chat's search. Wish me luck.
 
I'm going to call this a memewreck.
 
I'm going to write a Brainfuck interpreter
 
user142019
5:50 PM
 
Well, no big deal, I guess.
My god, that must have been a slow (morning|afternoon|evening).
 
user142019
@rogcg interpreter? That’s so easy. Write a JIT-compiler at least!
 
The only weird part is that one about "being damn good at it".
 
@WTP'-- everything in its own time..
 
5:51 PM
Otherwise, standard issue beginner question.
YOU'RE ALL MEANIES.
 
user142019
@rogcg lol
 
@EtiennedeMartel Yeah, the OFG idea is really silly.
 
@R.MartinhoFernandes Who started this? Probably daknok. It's always daknok.
 
user142019
OFG? Overly Foolish Guy!
 
user142019
@EtiennedeMartel nein.
 
5:53 PM
Well, damn.
 
@EtiennedeMartel I think it was kbok.
0
Q: Is it possible to Cast an Object to a not related Class?

sharethisSay I have two classes with different names but the exactly same structure. It there a way to cast an object of the one class to one of the other? This might sound stupid to do but there is a reason why I want to do that. The architecture of my application provides the abstract classes component...

Overengineering much.
 
@R.MartinhoFernandes Yeah, search history seems to say as much.
 
I was thinking about buying a raspberry pi to build my own git server.. but I decide not to do it, and created a bitbucket account with a private repository..
 
user142019
@R.MartinhoFernandes I think he needs an AbstractComponentFactoryProxyManager.
 
I don't even understand the driving motivation behind a Component base class.
But seems to be a common theme among game developers.
 
user142019
5:58 PM
OOP is good and giant inheritance trees are good and make code more maintainable.
 
Like Managers.
 
user142019
> Additionally, this isn't my final architecture. There is more like an event system and a system class putting all together for easy use.
 
user142019
A god class! Even worse!
 

« first day (740 days earlier)      last day (4206 days later) »