« first day (3011 days earlier)      last day (1927 days later) » 

12:17 AM
anyone knows why this cpp is not behaving like the js here?
 
too lazy to look, if I were you I'd simplify the code before dumping it here
 
any pointers for that?
cpp is giving me 23848, js is giving me 103806
 
Things like findCell can be done with std::find
 
oh
 
12:21 AM
I'm genuinely not sure if those make anything better here
 
So, basically you have` std::vector<claim> claims;` and need to use std::count with a predicate to count the number of elements that match your condition
 
findCell actually ends up having side effects, but I guess I can still return early
and std::count would help if I had all the cells in a continuous vector, rather than a set of them, which I guess would be better for readability anyway, doing the counting only after I'm done with calculating
hopefully I'm missing something about how these can be used
huh, apparently the pointer at line 57 is always the same value
not sure how to fix that
I'm guessing the temporary variable just gets deleted at the end of the function because nothing is holding an actual reference to it
is this where smart pointers come in?
 
12:40 AM
Okay, so you have an ` std::vector<claim> claims;`, what are you trying to do with it?
 
that just holds the input data
 
Indeed, so what are you trying to do with it?
 
the challenge is defined here: adventofcode.com/2018/day/3
I'll give it a short explanation
the "claims" are x/y/w/h rectangles, and I'm looking for how many of the cells are overlapped by 2 or more claims
it's quite a large number of individual cells, and storing them in a single array makes searching for them take quite some time
and trying to initialize every cell in node made me run out of memory very quickly
but using this y-tagged set thing, and then only searching for the x, makes the node version pretty fast
I'm now trying to see if shared_ptr solves my issues
 
At a glance you need to count the intersections between a set of rectangles. Not sure why pointers are happening.
 
and it solves it
@Mikhail probably because I don't know what I'm doing
how would you go about it?
the one thing that requires pointers for me is modifying a cell that is already stored
I guess you can do it in a more functional way, but it would probably take much longer for the program to run
 
12:53 AM
First off, its a collision detection problem so you build a quad tree, and then evaluate potential collisions between neighbors
Basically, build the structure using CGAL, then query for neighboors, and then collisions in neighbors. Should be about 10 lines of code and 10 lines of CGAL typedefs :-)
 
hold on, you're not counting how many rectangles are colliding
but how many cells are shared by different rectangles
maybe you can do that in cgal too
can't imagine using almost any kind of tree for it
 
1:20 AM
People has been talking about all sorts of privileges, but why no one ever mentioned intelligence privilege or dumb discrimination?
Why is it okay for society to discriminate against dumb people? They didn't ask to born dumb. It's not a choice.
 
1:37 AM
How do I link a slack sub channel on a public forum?
 
2:27 AM
@Yvette I need your expert opinion. Is this profile legit?
New member to the A.I. in robotics group, but profile looks fake.
 
 
2 hours later…
4:19 AM
Kicked 2 members. I need people who are as intelligent as quants and as good with hands as tradies. Not some fake accounts who are likely to spam at some point in time.
 
4:51 AM
 
5:48 AM
The sadness when you have completed building a robot from scratch, then discovered there are still few pieces and you don't know where to put them.
Now let's put a 'brain' on this claw.
Somehow I have this feeling this thing is not going to work as well as expected :(
 
6:30 AM
Hey, new to C but really just need confirmation:
I) Does pointer always points to a type? II)) Does a pointer always has a type because of (this answer)[https://stackoverflow.com/a/9802673/6799340] ?
How am I too dumb to format links? I can't even edit it anymore, so generations to come will be able to make fun of this :)
Also my grammar
nvm, didn't mean to bother
 
 
2 hours later…
8:23 AM
@RaisingAgent depends on how you define 'type', there are, for example, function pointers.
 
9:04 AM
I actually haven't used or come across function pointers yet. Will have to read up on them. Do they point to the memory address, where the function code starts?
 
@RaisingAgent Essentially yes. Now look at this stackoverflow.com/questions/2402579/…
 
Thanks
 
user3956566
9:26 AM
@TelKitty cannot see it
 
@YvetteColomb I have deleted the member from the group a few hours ago. There were 5 similar fake accounts, all carrying banner pointing to some porn website on their profile pictures.
 
 
2 hours later…
user3956566
11:38 AM
@TelKitty ah k
 
@RaisingAgent C is a statically typed language. If pointers weren't typed, the compiler wouldn't know the type of *p, and it wouldn't know how much to add in p+1. The only exception is the void* type, it can point to anything. But then *p and p+1 won't compile.
 
 
7 hours later…
6:24 PM
@fredoverflow ...with the minor detail that some compilers (e.g., gcc/g++) don't conform in this regard, and allow p+1 to compile (acting roughly as if a void * were actually a char * in this case).
 
 
2 hours later…
8:30 PM
@sehe heh
@towc probably
 
8:45 PM
Hey everyone I'm really interested in learning C++ from scratch for my next semester and I think I've found a perfect course for it. Can someone help me download it?
 
I for some reason can't get it to download
 
what about buying it
 
I wish I could. That's too much money for me considering I'm just in the first year of college.
 
then get something cheaper vOv
 
8:47 PM
I don't know if I can be assured about the quality of some other material. This one though is awesome
 
maybe that's the reason why it costs so much
 
Sucks to be broke I guess
 
kinda. Sucks to be a creator of awesome training materials that get stolen as well
 
True. I'm sorry.
 
there's plenty of resources around nowadays though
I'd also check with your college if they provide you with some subscriptions
@Tanuj Also is that this course? it's currently 92% off
$12 doesn't sound like a lot of money
 
9:22 PM
@Ian Oh my. That's a long time ago. Good spot, and none of that code would pass my own code review today. I updated the answer to be a little bit better :) — sehe 13 secs ago
Udemy sounds like a disease
@BartekBanachewicz Actually, I'll just buy it just to check it out
Those prices don't inspire a lot of confidence, so my expectations are low. I'm always ready to be surprised though
 
9:38 PM
@sehe well they do say it's 92% off
 
I recognize hot air when I smell sales
 
which OTOH seems to be a common thing there
 
Anyways Paypal is being a whiney bitch. As always
 
frankly I don't expect a lot from this course either
I mean, it's a video course
this in and of itself sounds like a problem
 
It is
 
9:44 PM
also I've rediscovered this album and it's pretty great: spotify:track:1T9g4CTdWwsBvYbr84meA9
some really exceptional guitar playing there
 
Seen any good C++ talks, lately?
 
10:12 PM
no
 

« first day (3011 days earlier)      last day (1927 days later) »