« first day (2378 days earlier)      last day (2479 days later) » 

7:00 PM
@Tobi That is really inefficient.
 
0
A: Sandbox for Proposed Challenges

MD XFHello, World! (CnR) cops-and-robbers decision-problem Your challenge is to write a program or function that, with a certain input, prints the exact string Hello, World! and a newline. Capitalization, spacing and punctuation must be exactly as shown above. Your program cannot simply print whatev...

 
exactly......
thats why im asking
 
Is there a CnR where you give code and output, and the robber has to find the input?
 
@StepHen Sort of.
No.
 
I'm assuming so
 
7:01 PM
@Tobi Please use something like pastebin or gist instead of pasting huge code blocks in the chat.
3
 
@flawr It's not that big, and big ones are automagically shrunk.
 
that wasnt huge lmfao
 
@Tobi What does imfao mean?
 
Laughing my fucking ass off
lmfao
 
@EriktheOutgolfer formal defn added.. what do you think?
 
7:02 PM
@wizzwizz4 They are still quite big, and there is a reason why we have this point in the chattiquette
 
So we know the problem, spacial grids or quad trees, anyone know?
 
@Tobi Grid seems a fairly natural fit for this, since the radii will tell you exactly how many grid cells to include in your check, and the objects can move around freely without having to recalculate much
 
@flawr Forgot about the chatiquette. :-/
 
should I set the grid width to the max diameter?
and when checking and object for a collision, you check the grid and all grids surrounding it, right?
 
@Tobi Yes.
I don't know whether radius... I'm confused now.
 
7:06 PM
same lmfao
u kept changing
i think radius makes sense, because it will leak out
and you will check all surrounding
grids
 
@Tobi Using the max diameter will mean the centre of any object that collides with it will be in one of the 8 surrounding grid cells (if it's a 2d square grid). That keeps it simple. However, is some of your objects are a lot smaller you might still have to check lots of objects, so you could use a smaller grid which makes deciding which objects to check slightly less straightforward, but will help with efficiency
 
is . aliased to bash in linux?
 
@trichoplax how would you deal with objects that are too big for grid
 
@Tobi If the centre of your main object is at the far left of the cell, and the centre of the other object is at the far right of a cell two to the left, they will overlap even though they are not in adjacent cells. Using diameter will correct this
 
@totallyhuman No.
. is current directory in POSIX systems.
 
7:09 PM
i dont understand that @trichoplax
 
I assume you are referring to a standard GNU/Linux distribution such as Debian or Ubuntu, correct?
 
@Tobi If your grid is small so objects overlap multiple cells, you can either keep track of which cells they overlap, and store in each cell a reference to every object that overlaps it, or you can approximate this treated the objects as square, which is easier just means some false positives
 
@Tobi Imagine a Venn diagram. Now lay a grid over it with the width of the radii.
Can you get the intersection into a separate square to the two centres? The answer is probably yes.
 
@wizzwizz4 as a file name, sure
 
False positives are better than false negatives.
@totallyhuman What do you mean?
 
7:11 PM
But if it's being addressed as a command, it seems to be executing the argument as a bash script
 
im so confused
 
@totallyhuman That's ./thingy.
 
are there videos on this
 
@Tobi I can make you a picture.
My mouse battery is running low though.
 
(trusty)totallyhuman@localhost:~/Downloads/Workspace/intrnt$ cat /bin/wtf
man $2
(trusty)totallyhuman@localhost:~/Downloads/Workspace/intrnt$ .
-su: .: filename argument required
.: usage: . filename [arguments]
(trusty)totallyhuman@localhost:~/Downloads/Workspace/intrnt$ . /bin/wtf
What manual page do you want?
(trusty)totallyhuman@localhost:~/Downloads/Workspace/intrnt$ . /bin/wtf is man
MAN(1)                                                          Manual pager utils                                                         MAN(1)
 
7:13 PM
@Tobi Imagine a square cell with no object centre in it, side length equal to your object radius. The cell to the left has an object which can reach past the centre of that cell. The cell to the right has an object which can reach past the centre of that cell. So the two objects can overlap even though neither of them has their centre in that cell. Making the cell side length equal to double the radius means they cannot quite reach from two cells with an empty cell in the middle
 
@totallyhuman Run where ..
 
you mean whereis?
 
ill just diameter
i cant visualise what youre saying
you stated that using smaller grid sizes may be more efficient, how would you then check objects that have a diameter larger than the grid size
 
@Tobi You don't.
 
7:18 PM
?????
 
The minimum grid size is the maximum diameter.
You want the grid to be as small as possible, so you use a grid size equal to the diameter.
 
he said something about making it smaller than max diameter
 
And explained how that would lead to false negatives.
 
> Making the cell side length equal to double the radius means they cannot quite reach from two cells with an empty cell in the middle
 
im not talking about that steph
 
7:19 PM
@StepHen Ninja'd.
 
what does false negatives mean?
would uit be more efficient?
 
@Tobi false negatives is when it says it didn't happen but it did
false positive is when it says it happened but it didn't
 
13 mins ago, by trichoplax
@Tobi Using the max diameter will mean the centre of any object that collides with it will be in one of the 8 surrounding grid cells (if it's a 2d square grid). That keeps it simple. However, is some of your objects are a lot smaller you might still have to check lots of objects, so you could use a smaller grid which makes deciding which objects to check slightly less straightforward, but will help with efficiency
 
If you use a smaller grid then you may see some benefit if your objects are of widely differing sizes, but I'd recommend sticking to the simple version and getting that bug free before considering improvements
 
ok, ill do so now. thanks, very helpful
 
7:20 PM
Did I just get ninjad by myself??
11
 
If you're using a smaller grid, you'll have to special case large objects.
 
and I thought writing a coordinate-based physics engine was complicated
 
@StepHen It's really simple, if you don't mind it breaking on more than 20 objects.
I wrote a physics engine like that once, with the added benefit of not actually having decent physics.
 
@wizzwizz4 hey mine had decent physics though, we even did corner collisions
 
Collisions only worked properly a quarter of the time, and only for one of the objects.
 
7:24 PM
@Mego do u know why python doesn't have right versions of any of the comparision operators, only the math, etc. ones?
 
Half the time it didn't work for either object.
 
whats coordinatebased physics engine
 
im being forced to use << instead of <
 
how does it differ to mine?
 
@Maltysen Those are completely different things.
 
7:24 PM
@Maltysen What? Do you have an example?
 
@Tobi I don't really know how yours works
 
<< is a shift.
 
But coordinates is everything is in an xy plane
and you get centers of circles and radii
 
mines that too, right?
 
@Tobi A physics engine that represents positions by coordinates.
 
7:25 PM
oh
 
Ninja'd.
 
how are they different?
 
@DJMcMayhem you have__rmul__ and __ror__ but not __rlt__ or __rge__
 
@Tobi I don't think they are.
 
@Tobi Have you considered using Google?
 
7:26 PM
my circles has positions and raadii that i calculate
 
@Tobi then what's the grid for?
 
@DJMcMayhem DuckDuckGo ftw!
 
( I don't know what I'm talking about fyi )
 
to speed up collision detection??
 
@Tobi Optimisation ftw!
 
7:26 PM
2 mins ago, by Maltysen
@Mego do u know why python doesn't have right versions of any of the comparision operators, only the math, etc. ones?
 
@Maltysen Ah. I heard python and thought Ooh, I know about that! Maybe I can answer! but then I realized that's over my head and I don't know what you mean. Good luck :P
 
@Maltysen Wait what's the problem?
 
@Maltysen DO you mean there is no __rle__ method?
 
My python knowledge ends as soon as double underscores become involved. haha
 
@DJMcMayhem Double underscores are relatively simple. The magic methods are documented, and everything else is simple.
 
7:28 PM
What do you mean by "no right versions"?
 
Where "simple" is defined as "undefined and subject to change".
 
Here's the line of code from the old project of mine that we used for collision detection:
 
@DJMcMayhem how do you make a private method in Python?
 
@ppperry You don't.
 
Uhhh.... I don't think you can
 
7:29 PM
(I know, but am challenging the statement "My python knowledge ends as soon as double underscores become involved. haha")
you do, by prefixing the name with two underscores
 
But I could google it
 
@ppperry No, you don't.
 
Grats to Anders Kaseorg for winning the 500-rep TryItOnquine bounty!
 
@ppperry Oh.
 
They're not private that way.
 
7:29 PM
@wizzwizz4 well private in this case measn it doesn't show up in docs
 
@Maltysen Single underscore does that.
 
@Maltysen Will python automatically switch the order of arguments for such cases? Do you have a situation where that wouldn't help?
 
Double underscore is for not conflicting with other double underscores of subclasses.
 
But it's by no means private.
 
7:31 PM
@trichoplax i'm overloading << right now, and it switches the order automatically (so the first arg is self)
 
private static void __ThisIsn'tJava
 
but i can't find right < on anyone
 
https://www.asciimator.net/asciimation/11692
^ Cool site, literally the worst UI I've seen since geocities.
 
does python have closures?
 
Yes
 
7:31 PM
@ConorO'Brien yup
 
boom, private variables :P
 
> apple being ate
 
@ConorO'Brien No...
 
@ConorO'Brien You can still access their variables externally if you really want to though
 
func.__closure__
 
7:32 PM
@StepHen makes for a decent challenge imho: codegolf.meta.stackexchange.com/a/13564/59376
 
@MagicOctopusUrn I'm a simple man. I see Rick & Morty, I upvote
 
I STILL HAVENT WATCHED S3E2, NO SPOILERS.
 
@MagicOctopusUrn Title: Apple Being Aten
 
@wizzwizz4 And I was about to post a TIO link showing that.
 
@MagicOctopusUrn Of course not ;)
 
7:33 PM
@Maltysen I was thinking if the order is switched automatically you could use left > instead
 
Lol the title was "nompf nompf nompf... nompf nompf nompf......... nompf"
 
@Maltysen What are you trying to do
 
@Maltysen why exactly are you overloading operators? :P
 
@trichoplax the whole point of right overloads is that if the operation isn't implemented for the left operand, the right operand still gets a chance to make it work
 
And you are saying those don't exist for comparisons, like < and <=.
 
7:34 PM
 
@ppperry They exist.
 
@ppperry i can't find them if they do
@wizzwizz4 really? i don't mean overloads, i meant the right side overloads
 
@DJMcMayhem +1
 
@Maltysen Basically just prepend r to the name inside __ and __.
 
@wizzwizz4 yeah but i can't get that to work for comparisons
 
7:35 PM
@Maltysen Does using << instead of < gives operator precedence issues?
 
no it just doesn't look as nice ;P
 
@Maltysen The other side should be raising a NotImplementedError iirc.
 
returning NotImplemented, you mean
 
0
A: Sandbox for Proposed Challenges

Magic Octopus UrnHungry for Apples? This challenge is simple, given an integer 0 <= n or 0 < n, output an ASCII-apple with that many bites taken out of it. Here's the "ASCII-mation" of it happening: click player, then play. No bites (0): // .-.:|.-. .' '' '. ; ; : ...

 
@AdmBorkBork @MagicOctopusUrn I know it's probably been said but holy cow your avatars are similar.
 
7:37 PM
Is this what you mean?
 
@ConorO'Brien it's been thought by me "damnit Adm, your answer faked me out again" like 100 times.
 
@wizzwizz4 it does
 
Don't think anyone has said it outloud though. When looking for my answers I look for blue box.
 
@wizzwizz4 and it doesn't fall thorugh to my rlt
 
If I were to change my avatar I'd never find my answers <by scrolling> again.
 
7:38 PM
@ConorO'Brien They've been mispinged before
 
@ppperry This is what I meant by switching the order automatically. Greater than is right less than. @Maltysen is this useful?
 
@trichoplax oh cool
thanks
 
Also, dangit, I wish "New Sandbox Posts" put the image in the snippet lol.
 
@MagicOctopusUrn It puts what it gets in the feed.
 
@ConorO'Brien Yeah, I've actually done a double-take going "I don't remember posting that challenge?"
 
7:39 PM
is there any time when !( < ) is different than ( >= )?
 
@StepHen Yes.
 
@trichoplax thanks so much
 
But then the unicorns cry.
 
@AdmBorkBork it's funny how ACTUALLY different they are though, yet the colors just... confuuuse me/you.
 
I posted that, not trichoplax
 
7:40 PM
@Maltysen I had a feeling python did that, but I wasn't sure until @ppperry gave a working example
 
@MagicOctopusUrn Very true. They're just similar enough on a quick glance.
 
I can go invert mine, I think you've been here longer xD.
 
I mean if a == b is defined, but a > b is not, a >= b is still technically true. e.g. with complex numbers, 2 + 2i >= 2 + 2i
 
@MagicOctopusUrn I think it's the color not the orientation
 
Just add some tentacles
 
7:41 PM
Or invert the color
 
just remove the black background
 
Invert the color is ahem what I meant... I don't think the orentation of a cube really... erm, matters?
 
Find a picture where Calvin looks exactly like Dennis's profile picture
 
does func<_(args) or func<-_(args) look better for partial application?
 
@ppperry Sorry for the confusion. Thanks so much for clearing that up with such a concise example
 
7:43 PM
@StepHen Calvin of Calvin and Hobbes?
 
@wizzwizz4 yes
 
HelkaHobbes?=)
 
@StepHen Can we find a picture where Hobbes looks exactly like Dennis' profile picture?
 
I have NO idea how to change my avatar.
How did I even set it in the first place lmao
 
user image
3
close enough
 
@MagicOctopusUrn Hehe, no need to. It's not a big bother to me.
 
That was so weird... "edit profile" wasn't under the first category when I was there before.
@AdmBorkBork I actually want to now, this is badass: imgur.com/a/uqQK9
 
@MagicOctopusUrn Different link.
 
@MagicOctopusUrn OK, that is pretty sweet.
 
7:48 PM
Okay, that's low res AF... lemme find a better way to invert it. The original image was like 900x600
 
@MagicOctopusUrn GIMP.
ImageMagick.
 
Post a challenge ;-)
 
@AdmBorkBork "invert and hd-ify an image"
 
@Poke Ouch.
 
7:51 PM
@StepHen Simple. Just bitmap it (not a rickroll, I promise).
 
Having a legal person write the indictment for a computer virus is laughable.
"USED A COMPUTER SOFTWARE CALLED CRYPTING" - lol'd.
 
@ppperry Looks like this question on SO might benefit from your example too
 
@MagicOctopusUrn What's worse is having an unguided legal person write computer laws.
"You may not store the video on your computer."
How else are we to play it?!
 
Dennis gets creepy inverted:
 
sorry that indictment was last month... he was just arrested because he was in the US at defcon
because of that indictment
lulz
 
7:58 PM
0
A: overloading less than in python

ppperryTo do this, you can override the __gt__ method. class comparison: ... def __gt__(self, other): ... 7<comparison(2) will then get transformed in the call comparison(2).__gt__(7), which you can override.

Not that that answer is probably ever going to be seen by the OP, since they were last seen in May.
 

« first day (2378 days earlier)      last day (2479 days later) »