« first day (348 days earlier)      last day (2488 days later) » 

6:44 AM
@PaulD Im sorry, I do not understand you. I am clumsy about these things. Do you have exact steps of how would I use the library? How do you mean add project to your solution? Isnt solution already a project?
 
7:43 AM
@PaulD Never mind, maybe I did manage to do it. Thanks anyways.
 
 
4 hours later…
11:27 AM
@MuhamedCicak lol no trouble man
@MuhamedCicak There's a difference between project and a solution in Visual Studio, actually.
@MuhamedCicak Project is essentially an entity uniting an implementation and header files with setting describing how to compile that and into what and for what platform. Solution is a union of projects, they can be in different languages and may target different platforms or even produce no binary at all.
@MuhamedCicak You create a solution and then you add to it all the needed projects, typically you need to build box2d as a separate project and build it into a dll or a static library
 
@PaulD I see. Thanks for the help. After I build it into a dll, I need to put the dll into my Windows/System32? I heared something like that, dont know if its true.
 
12:15 PM
@MuhamedCicak not really. putting dll's into system32 is a really bad, bad idea
@MuhamedCicak put your dll into the directory where your exe is situated
 
Ok :)
Thanks.
 
also there's winapi setDllDirectory
by default windows searches in your app directory, so put it there
read that
also
 
12:34 PM
Okay, thanks
 
 
3 hours later…
3:07 PM
@MuhamedCicak cannot second the DO NOT PUT STUFF IN SYSTEM32 enough
 
 
1 hour later…
4:32 PM
@PaulD You put your DLL in system32 if and only if you are part of the Windows development team at Microsoft. For everybody else, it should be considered completely off limits.
 
4:55 PM
@JerryCoffin well, that what's I've basically said
@JerryCoffin that by no limits he should put his dll into this dir
 
@PaulD Yup--just adding one more voice trying to spread the good word, so to speak.
 
5:12 PM
@JerryCoffin I still don't know why you mentioned public inheritance from Integer, which was removed in my corrected(?) code ;)
 
@Toreno96 Perhaps you posted the wrong link or something, but what I saw still showed it.
 
@JerryCoffin I double-checked link and it was correct, at least for me. But just in case there's some weird bug or something: pastebin.com/zVMZsyS6
 
hi there
you can return instance of abstract class as reference, right?
A & f() {
    static B b;
    return b;
}
can anyone explain this? I can't understand it.
What does static stand for?
also is this safe?
 
Scroll down to "Storage duration"
actually, no
scroll down to "Static local variables"
 
@milleniumbug Ok, but is this safe?
Will it get automatically deleted after the returned var goes out of scope?
 
5:24 PM
> Variables declared at block scope with the specifier static have static storage duration
> static storage duration. The storage for the object is allocated when the program begins and deallocated when the program ends. Only one instance of the object exists.
 
@milleniumbug Oh, only when the program ends. I need better solution. What'd you say about unique_ptr ?
 
@milleniumbug Out of curiosity: is this widely used in professional code?
 
std::unique_ptr<A> f() {
    return std::make_unique<B>(...);
}
@Toreno96 +1
 
@Toreno96 Not very often
@SzymonMarczak Yes, that's what you should use if the function is supposed to create a new instance
@Toreno96 It's basically a lazy-initialized global variable
9 mins ago, by Szymon Marczak
A & f() {
    static B b;
    return b;
}
> May be checked afterwards, because exception in ctor prevents whole construction, right?
@Toreno96 Yes, exception thrown in the constructor prevents from destructor body being called
(but all the already constructed subobjects are still destroyed)
don't have a non-explicit converting constructor from a type and an non-explicit conversion operator to a given type at the same time
 
@milleniumbug Why don't?
 
5:42 PM
Redundant
 
@milleniumbug Thanks, it worked!
 
ok, maybe not really "redundant", brainfart
 
@milleniumbug So, was it a bad decision to make a non-explicit converting ctor and non-explicit conversion operator, or not?
 
ok, ISTR there were problems, but I can really remember why, so disregard that advice
OTOH
your constructor from Integer is non-explicit, but potentially throwing
calling f(Digit x) with g(Integer(11)) will throw
(because a temporary Digit object is created)
 
6:00 PM
@milleniumbug I quess it's not desirable?
 
if that constructor had been explicit, f(Integer(11)) would be a compile error
and you'd have to use f(Digit(Integer(11))) which is more likely to be noticed in a code review
 
@milleniumbug Not related to C++: wow, you're from Poland, me too :P
 
@milleniumbug Hmm, that's true.
@SzymonMarczak Not just him ;)
 
@SzymonMarczak such a small world :)
 
@milleniumbug Yep :P I just wonder why do you do:

#ifndef HEADERhashHere
#define HEADERhashHere

instead of

#ifndef PROJECTNAME_CLASSNAME
#define PROJECTNAME_CLASSNAME
 
6:14 PM
heh, nowadays I just do #pragma once
but I can't be bothered with changing these
basically these are GUIDs with practically no chance of collision ever
also don't need to be updated if the class name changes
 
@milleniumbug That's true. What are the advantages of using #pragama once ?
 
less chance of getting it wrong (identifier changes and like), less boilerplate, less annoying
OTOH: not standard, supposedly can break if you compile your source code on a NFS filesystem
I don't consider the first one as a very big disadvantage
 
That's cool.
 
because a.) all major compilers I use support it (MSVC, gcc and clang all do, Intel C++ compiler probably too) b.) if I ever have to use a compiler which won't support it, conversion from #pragma once to your regular include guards is trivial, the other way around, not really
 
@milleniumbug Also, what IDE do you prefer?
I mean which is best in your opinion.
 
6:21 PM
Currently I use Visual Studio, CLion and juCi++
KDevelop is also decent
 
I've never used VS.
I just installed it and uninstalled a few minutes later :P
For me there are too many options.
I like simplicity.
 
VS is windows only so you may not like it, CLion is a paid product, and juCi++ is basically a hobby project
I use CMake to make IDE changes less painful
 
@milleniumbug I use CLion, best IDE IMO. What are the advantages of VS?
 
for me: debugger that works, not "works or doesn't randomly depending on your distro", better integration with everything
if it's about language support, well, VS uses a sucky compiler by default
but with C++ this isn't really about which one works properly
 
@milleniumbug So this is why I chose Linux :P
Some libs support MinGW or Cygwin and some not :|
 
6:27 PM
@milleniumbug What about Vim/Emacs and compiling in the terminal? :P
 
it's about choosing the one which is less problematic
@Toreno96 My debugging on linux experience is absolutely abysmal
 
@Toreno96 Just don't say you do it :O
@milleniumbug Why? Didn't you like GDB?
 
MSYS2 is a good choice for a non-VS environment on Windows
@SzymonMarczak <optimized out>
sometimes this happens with debug builds too
 
@SzymonMarczak Naaah, I'm learning Vim a little, but as a hobby. But. I really don't like IDE, I prefer to make my own development environment - editor of choice, compiler of choice (yes, in the terminal), debugger of choice... For now I'm using Visual Studio Code, GCC/Clang and GDB. And I really like it.
 
then there come all the integration issues
like, pretty printers that work or don't depending on your distribution
@SzymonMarczak I can use GDB from a commandline, but debugging with a proper GUI is way easier
 
6:32 PM
@milleniumbug Hah, I have got same issue. Printing is too slow in Ubuntu (HP printer), I have to wait 2 mins to print one page.
 
@milleniumbug There're GUI wrappers for GDB.
 
Yeah, they suffer from GDB problems too
Trying to wrap GDB is problematic
 
What about LLVM's debugger?
 
too immature yet
 
@Toreno96 I liked CLion. I have been looking for other IDEs, but didn't find any good for me. Also, someone told me to use Brackets, but it's slow cuz it's developed in Node.JS. I don't recommend to program in Node.JS. Choose Python or Java.
 
6:34 PM
but it's a good thing it exists
 
agreed
@milleniumbug Just curious, have you ever tried to make bindings from C++ to any other lang?
 
@SzymonMarczak Well, I'm learning Python at the moment, because I have an exam in the monday.
Installing OpenCV was an adventure.
 
@Toreno96 I've learnt the basics in one day. Classes, functions, tuples, etc. But I prefer C++. I have chosen it because it's lightning fast.
 
And it is strongly-typed.
 
@SzymonMarczak Basically you need to wrap your code in a C style interface and let other languages call that
Other options are next to impossible to do
(like "spend 1000 man-years" impossible)
 
6:42 PM
@milleniumbug Yeah. but don't you need to import that lang wrappers?
 
what
^^^^ was the answer to "how to call C++ code from other language"
if you're looking for "how to call other language's code from C++", fair enough
 
@milleniumbug Yep, you can call C++ from the other language.
@milleniumbug I wanna try out jucipp, but I got Could NOT find LibClang (missing: LIBCLANG_LIBRARY LIBCLANG_INCLUDE_DIR) while compiling. Maybe do you know how to fix it somehow? I'm just lazy and probably it will take you less time to answer than I would go for googlin' :P
Ok, this cmake -DLIBCLANG_LIBRARY=/usr/lib/llvm-3.5/lib/libclang.so -DLIBCLANG_INCLUDE_DIR=/usr/lib/llvm-3.5/include/ fixed it
now got Could NOT find ASPELL (missing: ASPELL_LIBRARIES ASPELL_INCLUDE_DIR)
actually, I'm ignoring this
maybe there are precompiled binaries?
nvm
 
@SzymonMarczak GNU Aspell spell-checker?
 
6:58 PM
@Toreno96 IDK what's that, first seeing
 
@SzymonMarczak what's your distro
github.com/cppit/jucipp/blob/master/docs/install.md <- here are supposed to be installation instructions for the common ones
 
@milleniumbug Thanks for clarifying it out
 
Yep, it needs GNU Aspell spell-checker.
 
7:15 PM
@milleniumbug assert or if [else throw]?
what would you choose? I'm not sure
 
assert has a quite narrow use case, so if you're in doubt, throw
 
@SzymonMarczak isocpp.org/wiki/faq/exceptions There's a nice article about exceptions and error handling. Assert is mentioned, too.
 
@milleniumbug But I only need to check if variable is true, so... ?
 
so what
if also checks if a variable is true
assert is optimized away with NDEBUG (IOW release mode)
so basically it only can be properly used if you're writing some code and you assume a condition is true, so it can properly notify you while you're debugging if that assumption is ever false
you potentially could check for input parameters, but only if they're precondition errors checkable by users
e.g. std::vector::operator[] could use assert in its implementation
but std::vector::at must obviously throw an exception
 
8:16 PM
@SzymonMarczak It checks if an expression is true--which is what any condition does.
 
9:06 PM
I'm deep in shit. It's midnight and I've no idea how to make my stuff work. Shit :(
 
nwp
I thought that was the default state.
 
@nwp And f-ng C++ takes hours to compile
2
@nwp I want to kill someone or commit suicide
 
nwp
@PaulD There are some ways to make C++ compile faster, those are not among them.
 
@nwp I know, but my current employer is not interested in speeding build times. And my PC is shit and they not going to update it
Maybe i just should leave that company and save myself psychical health and nerves
 
nwp
In my experience employers like spending like 2000$ on a new PC in order to make you work faster. It is an easy investment with clear benefits and probably costs them nothing because tax laws are dumb.
 
9:14 PM
@nwp not with my employer, unfortunately. My PC costs around 300-400$. I'm out of memory and when building I even have to close the IDE otherwise PC freezes
@nwp and that drives me mad
@nwp also they expect me to work "fast", while my pc works like pentium based pc from 90's
 
nwp
Well, explain to them that this is like digging a hole with a shovel. It can be done, but using a digger would be so much faster. They will put you near the top of the list for new investments.
@PaulD "I am working fast. The PC isn't."
 
@PaulD lol get out of there while you can
@nwp implying a company that provides PCs like that in the first place cares about this
 
@milleniumbug that's what i want to do. it's 00:16 on clock, i haven't eat, I haven't sleep, and today I almost got a nervous breakdown.
@milleniumbug not to say that I sit there everyday up to 11 pm
 
00:16 and you're still at work? that's a bigger problem than slow PCs
you doing overtime or what
 
@milleniumbug yep
@milleniumbug overtime
@milleniumbug well, if my PC were fast I would probably not sitting at work at that time
I think I should really leave this job. Health is much more important. And my salary is not that good to suffer from all this.
 

« first day (348 days earlier)      last day (2488 days later) »