« first day (1352 days earlier)      last day (3598 days later) » 

7:00 PM
I have never seriously fixed a problem by debugging :-/
 
@rubenvb It's hard to output a large tree structure.
 
Does that make me a fool?
 
I have fixed quite a few things by debugging
 
user1804599
@Ell Do you also like GHB?
 
I used to hate GDB.
Then I actually learned how to use it and now I like it.
 
7:01 PM
IMO it's best to detect the problem then you can see the whole call stack.
 
user3010322
I hate GDB frontends.
 
@Puppy yeah, ok backtrace I've used.
The rest? no, not really :-p
 
user3010322
Still love VS's configuration of the debugger though
 
What configuration? :v
 
user3010322
Being able to NOT step into every move.h and the like is greatly helpful.
 
7:02 PM
I can do that too!
 
user3010322
By manually specifying the function with all of its template parameters.
 
I should really get back to writing actual code...
 
user3010322
Or by finding the file buried deeply in the mingw folder and excluding it...
 
brb making a file just to prove you wrong
 
Ell
I've never used a GDB frontend
besides gdb itsself :3
It's a shame that it's apparently so coupled
 
user3010322
7:03 PM
But wait! It doesn't work in .gdbinit because gdbinit is loaded before the functions for gdb are loaded and thus the query to block a file does not register.
 
@Ell coupled?
 
user3010322
And rather than GDB specifying a "what's the default answer when it asks you to block any instances of this file/function later?", it instead just says NO to everything.
 
user3010322
NO.
 
user3010322
NOOOOOOOOOOOOOOOOOOOOOOOOOOO.
 
user3010322
And then you have to enter it manually, after your shit loads.
 
user3010322
7:04 PM
Which is always a pleasure.
 
I'm sure you can script some python to do stuff for you.
 
user3010322
I tried.
 
user3010322
The python scripts for QtCreator, anyways.
 
user3010322
They were all called too early, and thus the MAchine INterpreter automatically spit out NO to all my gdb commands.
 
user3010322
gdbinit itself was called too early.
 
user3010322
7:05 PM
I don't know how to make it happen later.
 
Also, Clang code model rules.
 
user3010322
And GDB refuses to allow me to specify a "please say yes to this command if it fails."
 
you know you had too much zeal when you started the project if, after some time, you delete what are essentially stub modules, because the thing is cluttered like hell and it's best to work on a single module at a time
 
user3010322
There's not even a generic argument, like gdb command --after_arg=y
 
user3010322
Or w/e.
 
user1804599
7:08 PM
Did anyone here ever use cocos2d?
 
Ell
No
 
user1804599
Oh. Meh.
 
nope
 
@TonyTheLion well, the other kind does exist -- at least to some extent. Whether the code works for the customer is (and should be) a fairly important characteristic, but good employers are far-sighted enough to also invest in the code being maintainable and something you can (and want to) work with in the future
 
user1804599
I think I will use Allegro with Box2D.
 
7:09 PM
if I had to make a game for iOS I'd use Unity
if Unity was not an option, I'd just go for HTML5
 
user1804599
cocos2d is a Python library.
 
user1804599
I’m not referring to Cocos2D-Swift.
 
Ell
@rightfold what you making?
 
isn't cocos2d that game lib used for iOS games?
 
@ThePhD until?
Oh wait you mean confirmation
 
user1804599
7:10 PM
No, that’s Cocos2D-Swift.
 
lol
 
aight, got it
so it's like Box2D with its many target languages and platforms
 
user1804599
Nevermind.
 
user1804599
Fuck game development.
4
 
lol
 
user3010322
7:13 PM
:D
 
user1804599
-1
Q: Abstract class declaration issue

user3705076I have a very strange issue when creating an object of the class "CorrelatedNormalGenerator". Please see code below. The class Matrix is used by the class CorrelatedNormalGenerator. Thanks in advance for your help. in Matrix.h #include <string> #include <vector> using namespace std; ...

 
user1804599
Worst question of the year award.
 
	public enum MoodType {
		Neutral,
		Happy,
		Sad,
		Angry,
		Excited
	}
I'm going to turn my virtual assistant into a dominatrix
 
user1804599
Eww, no comma after last element.
 
7:15 PM
that's confusing, it gives me the impression that something follows it even if it doesn't
 
user1804599
I will love your diffs.
 
user3010322
@Rapptz I don't understand what that's doing and why.
 
it's you sucking
 
user3010322
You're skipping over 2 lines?
 
AMD still has not fixed the font rendering stuff for Firefox.
 
user3010322
7:17 PM
Anyone can skip over that.
 
They use some fancy Windows smuck now.
 
user3010322
That's not a feature. It's basic.
 
s is step
not skip
 
right
 
You said you had to go through every single move.h
 
user3010322
7:18 PM
... So you've just stepped twice. How the hell does that help?
 
turns out I tried to destruct a reference to the object, not the object itself.
 
and I'm showing you that you don't have to
unless you just mind numbingly just do step step step step then you need all the pain that's coming to you
 
user3010322
Right. You have fun with manually punching in s [#] whenever you need to go through a function.
 
I only need to do s 2 for functions with template parameters
 
@Rapptz How would you know how many to step over unless you manually check the backtrace every single time you want to step?
this is a far cry from having the debugger automatically know how many to step over and eliminate the uninteresting frames automatically.
 
7:20 PM
it's easier w/o template parameters
but he mentioned template parameters so I added some
 
hmm
I think I double-destructed the base type.
 
user1804599
Debuggers should be cumbersome to use.
 
user1804599
You should prevent from needing them.
 
Ell
@rightfold To stop you from writing bugs? PP
 
@AlexM. Check my big balls.
 
7:22 PM
ding dong
 
gist.github.com/Rapptz/a89f3f008dae52216cce without template parameters you just specify what function you want to go into without doing all the nonsense
you can do it with template parameters too -- but you have to specify all of them so the alternative is to step over the function call (i.e. move)
 
@jalf True, but I have yet to meet an employer that far sighted.
 
Is using a random number generator a good way to generate a UUID for internal app integer-is-something-a-lot-more-complicated?
 
Ell
Why doesn't Just Eat allow specifying a delivery address besides the one I signed up with. How ridiculous >.<
 
user3010322
std::atomic<uint64_t> id;
 
7:29 PM
hmm, this will introduce global state into my program
fuck
Or I just use rand... hmmm
Or make a thread-safe store of a semi-large number of random numbers and regenerate the list when required.
 
@rubenvb I use template<typename> uint64_t id() { static std::atomic<uint64_t> current{ 1 }; return current++; } for this kind of things.
It's technically "global state", but huh.
 
user3010322
Between current++ and the return, the number could be incremented again.
 
@Griwes Ah, well, I have nothing against function local thread-safe local state.
 
@ThePhD current++ is atomic.
It would be pointless if it wasn't.
 
user3010322
Oh,I thoughtit returned itself. Turns out it returns T
 
user3010322
7:36 PM
All good then :D
 
Ell
My chinese is now ordered. I hope they bring the plastic cutlery I asked for :(
 
@ThePhD -.-"
 
user3010322
Sorry. :b
 
@Griwes that template is specialization so you can choose the integer size?
And thus quite unnecessary if I want to use a fixed size?
 
the template is useless there
 
7:38 PM
OK. Great. Thanks.
 
@rubenvb The template is there so I can generate different classes of IDs.
 
user3010322
id<my_tagging_struct>();
 
For example, I call id<thread>() to get a new thread ID and id<process>() to get a new PID.
 
user3010322
id<messages_t>();
id<posts_t>();
 
lol that use case completely escaped me
 
7:39 PM
@Rapptz :D
 
Hmm interesting.
But all those types are some form of integer then anyways?
 
@rubenvb No, the template argument is a tag.
For normal usage, that atomic should probably be std::atomic<std::uintmax_t>.
 
Ell
struct message_t {};
struct posts_t {};
 
I wrote uint64_t since I do use uint64_t explicitly in my kernel code.
 
Ell
idk :P
 
7:40 PM
Oh ok. I see now. It's irrelevant to the number returned, but each class has its own range starting at 0.
 
If I had to answer Herb's "favorite <10 lines of C++ code", I'd probably answer with this template.
 
I'm bored
 
@rubenvb With 0, or, as in my message, with 1 (so I have a "null" value).
 
user3010322
id's shuld always be 64-bit integers.
 
gonna die of boredom
 
7:41 PM
@ThePhD IDs should always be uintmax_t, unless you strictly need 64 bits, because, say, you are a kernel.
(Remember, uint64_t might not even be there!)
 
@Griwes ah yeah, noticed the {1}
 
user3010322
@Rapptz How about reviewing my pull request? :D
 
Herb's favourite 10 liner was a singleton wasn't it
 
@Rapptz It was a resource cache.
 
lol this is probably something that I'd do (NSFW) i1180.photobucket.com/albums/x419/hairybumslapper/jfgdsb.png
 
7:43 PM
Map of strings to weak_ptrs basically.
 
@Griwes They're called "pointers".
 
user1804599
@AlexM. let’s find out :3
 
This is why C++ is so cool. You think you need a whole shebang of crap code to do something, and in the end all you need is one line.
 
@Puppy Erm?
Are you telling me I should always use pointers, and never IDs?
 
@ThePhD it's the year 3000, humans blended with an alien race and are fighting for control over the whole universe, ThePhD's pull request is still open
@rightfold <3
 
user3010322
7:44 PM
@AlexM. :(
 
Ell
IDs are opaque
pointers aren't opaque
 
what I'm saying is that every object already has a convenient, unique ID that's always the right number of bits and doesn't require any extra structures to index through to find the thing.
 
@Puppy doesn't work so well with movable objects though :)
 
@Puppy It doesn't work universally.
 
yes, I know there are limitations.
 
7:46 PM
Basically, it only works with dynamically allocated objects, and only works when you want to give someone the pointer.
And when those are local. :D
 
well, it'll work with automatic storage duration too.
you can't reference an automatic storage duration object after destruction, regardless of how you reference it with an integer ID or not.
@Griwes You don't have to tell them it's a pointer. That can be an implementation detail.
 
@Puppy Hey, dear user, here's this awesome PID.
 
user1804599
 
what about it?
 
Oh wait, dear kernel, it looks like 0xFFFFFFFF80003f4c. Is it a pointer?!
Oh hey, it is!
 
7:48 PM
@Puppy but it does mean that two objects can have the same ID, as long as their lifetimes don't overlap
 
Let's use this security problem you don't know you have to crash you forever.
 
you'd still have to be in kernel space to use that pointer.
by which time you're probably fucked anyway.
 
> Let's use this security problem you don't know you have to crash you forever.
 
why not just de-reference NULL instead? same crash, no pointer knowledge required.
 
the security of people being able to acquire the address of the objects they're manipulating? Gosh, whatever shall we do. ;)
 
Ell
7:49 PM
@rightfold kek
 
@Puppy Would crash just the app, not the kernel, though. :P
 
user3010322
Well, it's a pointer from a routine run by the kernel, so it'd be an address in the kernel's stackspace, no?
 
@Griwes You can't crash the kernel from in user-space, unless the kernel is already bugged in some other way.
 
1 min ago, by Griwes
> Let's use this security problem you don't know you have to crash you forever.
 
@Puppy because that's undefined behavior and can be optimized out
 
7:51 PM
@rightfold haha
 
@Mgetz lol.
 
that's the reason Excel's icon has an X on it
 
if I already have aforementioned security problem, then my security is already breached, so it doesn't matter if you use it that way.
 
and not an E
 
you could use it to crash my kernel anyway.
 
user1804599
7:51 PM
:P
 
So, finding ways to prevent other bugs from ever getting executed is bad?
 
not giving you the address of an object in kernel space doesn't prevent anything.
 
sigh
 
Wisdom tooth. Great.
 
besides
 
7:53 PM
kernelspace pointers that point to something not mapped in userspace are pretty opaque
 
@rightfold You really are just hopelessly obsessed with cock, aren't you, @rightfold?
 
let's face it: most people here are not and never will be writing kernelspace->userspace code.
 
@LightnessRacesinOrbit I know those are really annoying if they don't grow properly
 
might as well say "Don't use exceptions, they're hard to implement in kernelspace so therefore don't use them in general!"
 
sigh
Alright, don't use IDs that aren't pointers.
 
7:54 PM
if you can implement it in userspace you can implement it in kernelspace
 
mine grew properly so I never had issues; didn't even feel pain while they grew
 
example: SEH
 
I dare you to never ever use such a construct in your programs.
If your kernel is sane (i.e. it's a microkernel), you don't need exceptions in the kernel, because a fault in the kernel is always fatal. vOv
 
@Griwes A microkernel isn't exactly sane. There's a reason they're not really used in practice.
 
@jalf QNX disagrees
 
7:55 PM
a microkernel is a sane idea, but not much more than that as far as I can tell.
 
@jalf It's the only sane architecture, because it's the only one that doesn't let 3rd party code into the kernel.
@jalf The problem with their low usage is that they are damn hard to get right.
 
this gif, kinda boring... until you see it with this caption
 
@Griwes and the fact that you need even more (expensive) transitions between kernel and user space. And a few other problems
It's nice on paper, sure, but lots of things look nice on paper, while not really working out in the real world
 
How would drivers work in a microkernel?
 
@thecoshman lol
 
Ell
7:57 PM
@rubenvb they are userspace programmes
 
@jalf If you have implemented it the way it needs relevantly more transitions between the kernel and user space, you have proven that they are damn hard to get right, because you didn't.
 
Ell
which communicate with messages/other ipc
 
Also, if you put most of the kernel in userspace, and it crashes, that's not necessarily easier to recover from than if the same code is in kernelspace and it crashes there
 
most "microkernels" that I've seen lately basically have kernelspace processes for certain things to keep performance up
 
oh god
 
7:58 PM
So the userspace has low-level direct access to hardware?
 
@jalf It is, because it crashing doesn't bring the entire system down.
 
Ell
@jalf It's not necessarily easier to recover that particular server but it does prevent one server bringing the whole system donw
what griwes said
 
Sure, coming back up from VMM's crash isn't really doable.
 
Ell
To me microkernels look better
 
But that's universally true.
 
7:58 PM
@Griwes If half your kernel is corrupted, then you are pretty much fucked, regardless of where the relevant code resides
 
@jalf The thing is, if your userspace service goes postal, it only kills itself.
 
@Ell sure. They do. They sound elegant as hell. They're just not practical
 
@jalf They are just hard to get right.
 
@Griwes not if your kernel relies on it. Which it does, because all the userspace stuff is still logically part of your kernel
@Griwes Yeah, like cold fusion
 
Ell
I don't believe that they aren't practical
 

« first day (1352 days earlier)      last day (3598 days later) »