« first day (1956 days earlier)      last day (3216 days later) » 

14:01
Morning cabbage.
cabbage
Good morning gentlemen!
Haaaave a nice day!
Good Morning, Or as we say here cabbage
Today I am annoyed that Pillow.ImageDraw.Draw is a function rather than a class.
Now I can't subclass it to add much-needed optional parameters to Pillow.ImageDraw.Draw().text().
@MattDMo Please do me a favor and do not advertise any preference of spaces or tabs over the other in a comment to my answer. Using either is fine, as long as the use is consistent. — poke 12 secs ago
^ I couldn’t resist.
14:13
I forget, is it possible to alter the behavior of a method of a class instance?
@Kevin If by alter you mean replace it by a different, then yes.
Ok, that should work for me.
You should be able to just replace Pillow.ImageDraw.Draw.text, right?
Looked through the last hour or so messages, and was most startled to find that Antti broke his brother-in-law due to a help vampire. Fizzy's 7 keyboards seem tame in comparison.
No, because I don't know what type of object Draw returns, and even if I did and created a subclass, calling Draw will still return the parent class. Unless I also rewrite Draw, but that would require substantial source diving.
14:18
@poke classic bait.
@JRichardSnape Thanks for the TL;DR
@JRichardSnape Apparently it worked.
Ok, I can change what an instance's method name points to, but can I make the new object receive a self argument as if it were an actual method? The most obvious approach complains of an argument mismatch:
class Fred:
    def frob(self, x):
        print x

def new_frob(self, x):
    self.frob(x*2)

instance = Fred()
instance.frob = new_frob
instance.frob(23)
@poke :D Matt should know not to feed the troll by now ;)
Expected output: "46". Actual output: TypeError: new_frob() takes exactly 2 arguments (1 given)
14:21
ooh - interesting
this is because you're replacing on the instance, not the class, I suppose?
If you take the self out of new_frob definition...?
Ok, but then how do I invoke original frob from within the function?
super().frob?
I don't think super will be able to find the instance, but I'll try.
Update: I thought correctly.
Don't think super will work. I think this could get tricky. Because at the point you want to call frob - you've replaced it with new_frob already
Also even if it worked, it wouldn't work in 2.7, and I'm interested in a version-intercompatible solution if possible.
14:24
It's a little hacky, but this works.
class Fred:
    def frob(self, x):
        print(x)

def new_frob(self, x):
    Fred.frob(self, x*2)

instance = Fred()
instance.frob = new_frob
instance.frob(instance, 23)
So you'll need to save it away as old_frob, I suppose. But I'm not sure then how you're going to reference it from your newly replaced frob.
That prints 46.
I'm thinking you might need to do something where you pass instance into a function which itself returns a function that is "initialised" with instance. Similar to what Morgan does, but so you don't need to pass instance on each call.
I don't mind explicitly calling Fred.frob(self, x*2), but I don't really care for the change of signature in instance.frob(instance, 23)
instance.frob = lambda x: new_frob(instance, x) works too.
Then you don't need to explicitly pass a reference to self.
14:27
I guess I could do that...
I think @morgan's latest is pretty neat - that's where I was going with my thought process.
@JRichardSnape The sad thing is that after asking not to discuss it, they started discussing it. Why would you do that? Why is it so hard to accept a friendly “please, shut up”?
:D
You might need to do instance.frob = lambda x, instance=instance: new_frob(instance, x), I can never remember how lambda namespacing works.
14:28
Is this really a problem no one has had before? I half-expected to get linked to an SO post with 200 upvotes that shows exactly how to do the needful.
I guess I'm spoiled.
Sounds like opportunity for a nice little earner on a self-answer
Guess this is a bit similar: stackoverflow.com/questions/19545982
Ok, I don't actually need the new method to have the same name as the old one, so I think I'll ultimately do
class Fred(object):
    def frob(self, x):
        print(x)

def new_frob(self, x):
    self.frob(x*2)

instance = Fred()
Fred.frob_ex = new_frob
instance.frob_ex(23)
Caveat did not read it carefully - so may be full of cr*p
@Kevin Since you are overwriting the bound method, you need to supply a function that does not take a self (since the bound method also does not take a self:
class Fred:
    def frob(self, x):
        print(x)

instance = Fred()
def new_frob(x):
    Fred.frob(instance, x*2)

instance.frob = new_frob
instance.frob(2)
@poke: Or bind explicitly
def new_frob(self, x):
    Fred.frob(self, x*2)

instance.frob = new_frob.__get__(instance)
14:33
Ok, my favorite approach so far is the one from Snape's link:
class Fred(object):
    def frob(self, x):
        print(x)

old_frob = Fred.frob
def new_frob(self, x):
    old_frob(self, x*2)

instance = Fred()
Fred.frob = new_frob
instance.frob(23)
I just learned about this and it's pretty darn cool. Curl this URL: wttr.in/montreal in your shell, it even works for airport codes.
I didn't mention it explicitly, but it's acceptable to me that I'm changing the attributes of the class rather than the instance. I don't need to keep it in pristine condition as long as it runs.
@Kevin Also known as a Python decorator…
@idjaw Neat. It's quite accurate for my present location.
new_frob.__get__ is also very interesting.
14:35
@Kevin then just poke the function onto the class and it'll be bound for you.
But then you'd have to store the original function first.
It appeals to me that I don't pollute the namespace with old_functionname identifiers.
@MartijnPieters No poking please… ._.
@poke poke. poke poke poke
But ultimately it's not a big deal either way.
14:36
..
I reckon I'd poke stick it into the class if that's an option.
You can be glad that your name is not a verb!
lok'tar ogar?
consideres renaming to 'stick'.
14:37
Do you play poker?
@Jon Help me, I’m being mobbed!
errrr.... stab?
oh no wait - that's not good
@Kevin: Take a look at stackoverflow.com/a/2982/4014959 and types.MethodType
@Martijn I actually wonder what would happen if you changed your display name/image - how soon would a metapost go up :p
14:39
@poke @Jon is also a part of the mob
Yeah, I noticed that.
@Jon You two should swap names
^ For a day atleast and see the "fun"
@BhargavRao did the miss the inverted quotes around "fun"? :p
Ok, my problem is solved to my satisfaction. Thanks for the assistance, friends.
@JonClements Fixed :P
14:41
old_text = ImageDraw.ImageDraw.text
def text(self, position, string, **options):
    #snip...
ImageDraw.ImageDraw.text = text
@idjaw Huh, it has me geolocated about an hour south.
PyCharm debugger so good @____@
^^ It really really is. I <3 it
@MorganThrapp by plane, train or automobile?
OH HAI @tristan
:D
user559633
14:48
oh hi
@JRichardSnape Yes.
Curiously, discussed MethodType here almost exactly 1 year ago:
Feb 25 '15 at 14:30, by PM 2Ring
@Kevin Yeah, MethodType is great for binding a new method to an instance. But tonight I've learned it doesn't work for dunder methods. Oh well. :)
You have good memory @PM
This seems like the kind of thing that I would want to do, and then forget about it, and then want to do it a year later.
user559633
@Kevin what is "buy christmas gifts" for $500, bob
14:52
@BhargavRao Not really, but I'm pretty good with Google. :) I remembered posting something re MethodType, but I thought it was in an answer.
Just one quick response, and I'm considering this over. Comments on answers are for discussing the merits of the answer, pointing out issues, other ways of going about things, etc. I think it's pretty presumptuous on your part to essentially say "*My opinion is correct, please don't say things I don't agree with.*"

People can (and have) argued tabs vs. spaces *ad nauseum*, and I don't want to repeat that here - everyone is entitled to their own opinion, and the consequences/benefits of implementing it. I appreciate your viewpoint, I just don't agree with it, and I believe I have the right
bother. No formatting in long posts. Darn...
Google acts pretty well as a prosthetic memory.
@PM2Ring Lol, I need to learn those skills too :D
We're all of us effectively cyborgs, as far as I'm concerned. If you remember the query needed to find the thing you're trying to remember, then for all practical purposes you remember the thing.
user559633
uhh, don't mis-transhuman me. i choose to identify as a tamagotchi with a full hunger meter
user559633
14:59
unrelated: i am bored out of my mind
Haha - a fellow bored meanderer.
Triggered. "transhuman" contains the letters S-H-A-M-U, and now I'm getting flashbacks to when my entire extended family was swallowed by a whale at Sea World. I can't believe you could be so insensitive.
A thought I had today: isn't "trigger warning" self-defeating when you're speaking to someone with gun-related PTSD?
There are many good arguments for and against tabs/spaces; but they don’t really matter. It’s a choice that has to be made at one point, but from then on, it doesn’t matter anymore. That’s why I personally don’t recommend anything, don’t say anything about preferences. It only matters that you are consistent, because missing consistency is the only reason that things break.
@MattDMo Thank you for bringing this up here. Let me give you a quick reasoning on why I posted my comment in the first place. It’s not that I don’t value discussion or that I want others to shut up and think only my view is correct. But tabs vs spaces discussions, as you said yourself, are far too common, and if we can sum them up in one word, then that would be “pointless”. There is no need to discuss the topic, since it’s—even with or without guidelines—all down to personal preference.
And guidelines, like PEP8, are just that: Guidelines. They are not fixed rules that are enforced. Yes, guidelines may be mandatory in certain situations (like PEP8 is when contributing to the standard library), but two guidelines can be easily contradict themselves—and that makes neither of them invalid. It’s just another opinion. And it just happens that PEP8 is a very vocal opinion, making it seem more relevant than others.
So basically, I was just asking you not to discuss it on my answers, since I openly discourage discussion about preference. It’s pointless.
"trigger warning, huh? I wish I had gotten a warning about the trigger that killed the entire rest of my squad... thousand yard stare"
I had another OP delete on me when I was halfway through writing the codez. But I decided to finish, since it was relatively simple but still kind of interesting, and I need the practice with the csv module. stackoverflow.com/questions/35578955/…
15:03
:28919181 Heh. I should have warned you before.
@Kevin I have a 20 yard stare because I'm short-sighted ;___;
user559633
i wonder if the crybully squad will start stating they have attachment disorder when yahoo shutters tumblr
Tumblr makes the worst interface design choices whenever possible so I'll be thankful to never see it again
FWIW I've written another answer to that question which says that using tabs for indentation is wrong
@tristan Why, what’s going on with Yahoo and Tumblr?
15:14
@poke Yahoo is for sale: businessinsider.com/…
@Antti It feels like you just wanted to say that now to spite me… :P
user559633
@poke marissa meyer made a series of incredibly questionable decisions, hastening the collapse of yahoo!, with tumblr being a $1.1bb USD bid when they just bleed money
well pep8 surely is just an opinion
user559633
@Kevin how did you make that?
15:16
but one should be pretty clear on how widely the 4 space indents are adopted
My attempt to visualize the tree of possible moves for this puzzle is marginally successful.
I've yet to see another programming language with this widely adopted single style
@tristan Manually, with this code.
user559633
@Kevin you're a wizard, jerry
@Kevin Looks like one of those Rock Paper Scissors super-versions.
15:17
But it's not actually useful because the boxes overlap lines that don't connect to them. This is most prominent on the right hand side of the image.
@poke Since I just got out of a meeting to find 130 new comments this extension to the spaces discussion might be unwelcome. But I would like to make the point that the PEP8 guidelines are mostly about maintain comprehensibility of the code. Since they are so widely adhered to, a wide digression from them is likely to reduce the comprehensibility, and therefore the usability and potential popularity, of your code.
If it's just going to sit in a private code base, fine. If it's intended to be widely used, less OK
(7,15) has two lines that apparently connect to (22,1) but really the second line is going to (1,22).
user559633
the fewer people the know how to maintain my code, the safer i am in my job. mixed tabs and spaces are just one portion of my glorious plan
15:19
wat is comment?
@tristan yeah, but we don't all suffer from your insecurities
@poke wish to see which are those tab repos
user559633
wat iz luv. bb dont hurt me
I would like to create a graph that has the minimum number of overlapping lines, but I haven't got a clue about how I would do it.
@poke Wow, Python's the only one with majority of space users
15:19
I wonder if an evolutionary algorithm would be useful here...?
user559633
@holdenweb i actually have the opposite problem. i think it's commonly referred to as "general dickishness and manchildness?"
@holdenweb I’d argue that using tabs instead of spaces as indentation does not have any effect on the comprehensibility of code. Copy-paste-ability, sure, but that’s about it.
With 23*2 degrees of freedom, I'm not sure if I would settle into a useful maxima.
Who uses 8 spaces?
user559633
i use 3. and on airplanes, i buy two
15:21
That's what I want to know.
@tristan yeah, but we aren't all prepared to be as obnoxious as you either
@holdenweb But yeah, that’s exactly my point: You choose the guideline to follow based on what you do and where the code you write is intended to go. That’s the implication from my only rule: “be consistent”.
user559633
@holdenweb early bird antagonizes the worm, i say
@poke but that would imply that you never want to write any code for publication, otherwise you would be forced to adopt two inconsistent styles. I suppose my general point is "there are recommendations; don't go against them without good reasons"
@tristan :P
@poke and the desire to be different is no more a good reason than general dickishness and manchildness
user559633
@holdenweb oh i can't wait to hold this against you out of context later.
15:24
@holdenweb If I’m in a team that says “use tabs”, then that’s what counts, not the “global recommendation”. Do what you want, but be consistent. If following a big guideline is what you want, do that, but don’t try to force it on others who explicitly chose not to do that (for whatever reasons).
And just so that’s clear: I have multiple code styles, which I use depending on what the target is. I’m in both the tabs and the spaces camp. But I’m not against either of them. I accept that one may choose one over another. I’m just against this endless “use X not Y because salad”.
@poke I'm not trying to force anything on anyone. I'm merely pointing out the implications of such a wrong-headed decision. Since you have to work in that environment you do well to avoid banging your head trying to get them to change
Bah Joke spoiled by chat input sanitizer. Curse you, sanitized input fields.
@poke so your rule is actually "be consistent within one context but not necessarily others", no?
15:27
Changing indentation is easy. Really easy. If it’s consistent, then converting it into any format is not an issue at all.
Sure, Wing IDE actually has buttons to do it for you
I can have 5- or 3-space indented code if I want, I simply choose not to
@holdenweb Consistency rarely applies across projects or abstract contexts, yes.
Ah haa
" "
boom
timing, it's all about timing.
cabbage
Cabbage @davidism
15:33
cabbage davidism
I won't be around as much for the next four days, I'm going skiing again. :-)
Oh nice, have fun :)
and lots of snow
@Kevin The trick to that puzzle is P1 can always force P2 to make a bad move by making both piles as equal as possible.
I never went skiing. I really should learn soon.
downhill skiing is not skiing
15:37
Huh?
is another this vs that battle about to start?
consistency!!! Either do only downhill skiing, or never downhill skiing!
uh oh..
xD
no: pep8 says downhill skiing is not skiing
15:38
Surely it depends on the context. When in Finland, do... (cont. p94)
@AnttiHaapala PEP8 also says no skis longer than 80 centimeters
but wait....does snowboarding count as a type of downhill "skiing". Is snowboarding a type of skiing? what is going on here....did I start world war ski
Snowboarding is just an implementation detail.
so it inherits from ski?
It implements the ski specification: “Standing on a thing, on snow” (or whatever)
user559633
15:40
what about spaces and tabs at the end of the line? how many should i put there?
@tristan obviously you need to fill up to 80 characters
Can you guys stop typing such long lines? I can't see past 80 characters on this monitor
> Can you guys stop typing such long lines? I can't see past 80 characters on th
I think you'll be needing this -> \
@RobertGrant What is the last character you see on this particular very long sen
15:52
@BhargavRao OCD reporting here, assert len('@RobertGrant What is the last character you see on this particular very long sen') == 80
@AnttiHaapala Even on your screen? The last word is sentence. See on a different monitor
nice
reminds me of the “your computer automatically converts your password into stars” IRC log
user559633
oh crap, disregard this please
exactly
user559633
Haha never read that before
Is there an easy way to determine whether the top vertex of a triangle is within the boundaries of the base of the triangle? I've got the coordinates of each vertex. The base isn't necessarily parallel to the X axis.
I'm 95% sure I answered this very question a couple months back, but I couldn't find it.
This sounds a lot like the dot product stuff.
@MorganThrapp Lolol, those are all damn funny. Thanks for that :D
15:58
@Kevin You mean that if the vertex of the base are (a,0) and (b,0) and the third vertex is at (x,y) you want to check whether a <= x <= b?
Yeah.
Wait, have people really not read the top page of bash.org? I was being sarcastic about it because the hunter2 meme is so overused.
It's sort of an XY problem because I really want to know whether P lies between A and B, given that P, A, and B are almost perfectly collinear. I can't guarantee perfect collinearity because of the restrictions of floating point numbers.
DSM
DSM
Late morning cabbage.
But if they're not collinear, it's on the magnitude of like 10^-15 arbitrary measurement units.
15:59
Let's say the top of a triangle ABC is C. If AB * AC is negative, C's off base. If BC * BA is negative, C's off base.
Whoops, time for my interview.
user559633
@Kevin Make sure to assert dominance by refusing to speak first
* here means dot product
Good luck
I really hope they ask him lots of questions about Raytracing and math.
@DSM cabbage
@Kevin Not sure but don’t you just need to check whether the angles on each of the base vertexes are lower than 90°?
16:01
@Kevin That can get tricky. Fortunately, there's GraphViz. There are Python modules for it, but I find it easy enough to write stuff in the DOT language, either directly, or via a Python script.
@poke Yea, but that just changes the question to "Is there an easy way to check whether the angles on each base vertex is lower than 90?"
@QuestionC Trigonomic functions?
GraphViz programs can output graphs in a ridiculous number of formats, both bitmap and vector-based.
@poke There's easier ways.
it depends on what information you have I guess
16:07
Here's a very simple GraphViz example, related to Collatz sequences. This is a PNG, the SVG is a bit prettier.
wat
@PM2Ring Please tell me that’s not about that triangle problem
@poke > Let's say the top of a triangle ABC is C. If AB * AC is negative, C's off base. If BC * BA is negative, C's off base.
@poke It's not! It's about Collatz sequences. I just posted it for Kevin as an example of a graph laid out by GraphViz.
@PM2Ring phew!
@Kevin Surely if either base angle is oblique the apex is outside the base?
Or can they be rotated, and does that make a difference?
16:14
guys :\ client side code is super annoying sometimes
And it only took you like 3 years to figure that out?
That's why you should always tip your server
4
Oh, you...
I always liked server better, I don't get why front end is so popular lately, client is super limiting
huh?
sorry....I don't understand what you mean by that.
16:16
@corvid I assume you mean browser, and not all client-side code
you want users to use your product. If your client sucks...no one will use it. Typical user does not care that your backend is built with all these neat bells and whistles. When they click on the thing that should do the thing, they want it to be easy and painless.
I'm back. @tristan's advice was good - they extended an offer before I said two sentences.
'grats!
@idjaw yeah, but it should really just be hooks to tell the server to do the thing so it should be really straight forward and minimal
you mean an API?
DSM
DSM
16:19
@Kevin: is this within BigCorp or elsewhere?
@corvid there's also response times to consider. Server round trips make response times longer, so sometimes it's better for tasks to happen client-side
Heading home, rbrb
@Kevin Nice.
rbrb poke
rbrb, poke. cbg, DSM.
16:21
@poke Yes I can, but if I can do it without trig, I'd like to know. I suspect atan would be a bottleneck so I want to compare approaches.
cbg Florian
@DSM It's the competitor of my current employer, who won the big customer's contract away from us.
there's something I don't completely understand with contextmanager, I'm afraid
I got the impression that they just want to port the whole department over wholesale with no internal changes, which is fine by me.
16:22
best explained by a small REPL session:
Python 2.7.11 (default, Dec  6 2015, 15:43:46)
[GCC 5.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from contextlib import contextmanager
>>> @contextmanager
... def foo(bar):
...     assert type(bar) is list, "bar is not a list"
...     return bar
...
>>> foo([])
<contextlib.GeneratorContextManager object at 0x7f84c70f5390>
>>> with foo([]) as b:
...     print b
...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
why is with foo([]) as b: not working?
@Kevin not surprising
Doesn't the function decorated by contextmanager have to be a generator function?
@FlorianMargaine Wouldn't you want to yield an item from the list? I'm not so sure what you are trying to do
What it yields is the result of the context manager's __enter__ method, IIRC
@corvid ah, right
my bad.
ok, sorry for bothering you guys :)
16:27
It's all good because you always help me with javascript
hmf, back to my bug then...
In gay slang, a "friend of Dorothy" (occasionally abbreviated FOD) is a term for a gay man. The phrase dates back to at least World War II, when homosexual acts were illegal in the United States. Stating that, or asking if, someone was a "friend of Dorothy" was a euphemism used for discussing sexual orientation without others knowing its meaning. A similar term "friend of Mrs. King" (i.e. Queen) was used in England, mostly in the first half of the 20th century. == Origins == The precise origin of the term is derived from Road To Oz, a sequel to the original Wonderful Wizard of Oz. The boo...
@DSM: Do you know any good algorithms for Egyptian fractions? I got nerd-sniped by this SE.mathematics question about sets of 10 numbers <=52 with no repeats whose reciprocals sum to 1.
The misunderstand section is fantastic.
I once worked in an organisation where being a "friend of Bob" meant you smoked weed
DSM
DSM
16:35
Conservatives in Hollywood used "Friend of Abe" for similar purposes. (To indicate group membership, not to smoke weed, that is.)
Hmm, having a O(N^2) fitness function for my evolutionary algorithm might be a problem...
@MorganThrapp So's the Talk page.
DSM
DSM
@PM2Ring: I looked at that Q too. :-) But I just did recursion with short-circuiting, nothing special.
@PM2Ring I didn't even look, but I'm sure.
@DSM I tried a recursive version, but it was slower than my version that generates 5-tuples < 1, and then creates 10-tuples from those. My best version now runs in 1m 11s on my 2 GHz machine, which isn't too shabby.
16:40
@FlorianMargaine Whatcha trying to fix?
@MorganThrapp I dispute that the term's origin is from Wizard of Oz: I'd always heard that it referred to Dorothy Parker.
@PM2Ring Yeah, that seems to be most of the talk page. I'd never heard the term before, so I have no opinion one way or the other. :P
Some classic Dorothy Parker quotes. I've long been a fan, and not just because I was born on her birthday. :)
@Kevin that would be very problematic. However, if you could compute fitness differentially, then it might not be so bad
One of her (many) well-known quips: "You can lead a horticulture, but you can't make her think".
16:45
Yeah, I was thinking that. I calculate fitness by counting the number of intersections of line segments on the graph. The population mutates by changing the position of a single vertex in the graph, so theoretically I shouldn't need to recalculate the intersections of any line segments that didn't move.
@PM2Ring Wow, you look good for 122.
That would bring it down to O(N) amortized, which is an improvement considering N is somewhere around 100.
@MorganThrapp :)
and since fitness computations are usually independent, you can very easily throw multiprocessing at this
I'm just trying to come up with a good design for remembering the intersections on static line segment pairs. It's non-trivial to work it into my current program.
16:52
@corvid it's... complex :)
and would require me to violate some NDAs to explain
@kevin what is a line segment? as defined by your thing?
AB == BA?
if so just use sets ?
Right now a line segment is represented as a two-element tuple of Point instances. But I'm not married to that idea.
Anyway, what data structure to use isn't the problem.
When trying to make connected nodes look pretty, I always wondered if you could do it by just having each node push away from the others, but edge on the graph pull nodes together.
Like putting rubber bands around protons.
@Kevin: I entered the conversation late. Could you please explain exactly what you're trying to do?
DSM
DSM
@QuestionC: there are spring-layout algorithms which work similarly.
17:05
@inspectorG4dget Ok. Given a connected bidirectional graph, I want to render the graph's nodes and intersections with the minimal number of overlapping edges possible.
Or, if proving minimality is computationally expensive, "close to minimal" is also fine.
@DSM A news site I had used did something like that, but I dunno the details of how it worked.
@Kevin Are they that slow? I never knew.
I know D3.js has the notion of charge, gravity, and more, for their force layout.
I'm writing an evolutionary algorithm to mutate the position of nodes in 2d space, and using "number of edge intersections" as my fitness function. But for N nodes, there are up to N^2 edges, so there are up to N^4 intersections of edges. Completely recalculating all intersections with each mutation is very expensive.
I believe chemical molecules also work similarly.
DSM
DSM
17:07
Finding the crossing number of graphs can be tough.
That moment you look for a dupe target and the first result is an answer from yourself…
The optimization I'm persuing now is: since a mutation only changes the position of a single node, no more than N edges changes position along with it, so I only truly need to re-evaluate the intersection of those edges with each other edge.
Edges that stay in the same position don't need to be compared to one another.
I remember this problem from somewhere... now's a really good time for you to kick in, coffee
basically, it has to do with computing the slopes of each segment, and then ignoring the parallel pairs
doh intersection as in crossing the streams not as in set().intersection()
@QuestionC Sounds like the model commonly used to render cloth. See graphics.stanford.edu/~mdfisher/cloth.html.
If I can get intersection-based fitness working, I do want to add an additional component to it that accounts for positioning of neighbor nodes in a springy way.
17:19
That's cool
DSM
DSM
Dup vote, if anyone's interested: here -- the dup I linked is the very first google result for "python find mode". :-/
I do enjoy when people say "I'm trying to make my own function from scratch", but mean "I'm trying to have other people write a function I can call my own".
@DSM please add so I can go-go-gadget-hammer
gogo gadget, @inspectorG4dget
DSM
DSM
Wait, I thought it was the original tags which controlled.
apparently not anymore. It seems that DSM can retag for iG4 to hammer
17:32
@DSM They changed that a while ago
As long as you weren’t the one who added the tags, you can use them to banhammer
DSM
DSM
Ah, makes sense. That probably avoids most of the gaming possibilities.
for item in iter_unique_unordered_tuples((node, neighbor) for node in self.data for neighbor in d[node]["to"]): ugggghhhh
tool req convert MATLAB cod to bython Gotta love the attention to detail in that title.
re-cbg
@DSM, you never posted that golf answer.
17:39
@PM2Ring rejected the edit on that too.
DSM
DSM
@MorganThrapp: I've never posted any golf answers. :-)
@BhargavRao Good idea.
@DSM Weren't you working on one last night? Or am I hallucinating?
DSM
DSM
@MorganThrapp: yeah, but certainly didn't get anything in good enough shape to publish.
Ah, gotcha.
17:46
too broad / no mcve / links to code stackoverflow.com/questions/35567590/…
I have 5 IDEs installed. I need an IIDEE to aggregate all of them..
DSM
DSM
This OP just put the mydict = {} line outside the loop when it should be inside. Typo or not?
Ok, got per-generation time down to ~1.5 seconds. 100 generations gets the number of intersections from ~750 to ~400.
DSM
DSM
@PM2Ring: guess you decided it was above typo grade. :-)
@DSM I think he doesn't know the consequences. Someone has already commented on that, and just in case, I added a little explanation.
17:58
Yeah, it's really a logic error

« first day (1956 days earlier)      last day (3216 days later) »