« first day (2645 days earlier)      last day (2303 days later) » 
00:00 - 18:0018:00 - 00:00

wim
12:00 AM
as it should
 
@AndrasDeak Don't gamble on the foreign speaker part. Probably the time I gave it away
 
wim
Martijn is almost always right
and when he's wrong, he edits until he's right
 
@Simon well I wasn't sure, but if I had to guess I would've guessed native
 
Correct: UK
 
just today we discussed that Germans alone are really good at English, so one can never be sure
I'm sure a lot of Scandinavians are equally good in general
 
12:04 AM
I think the dutch might be quite good.
 
@cᴏʟᴅsᴘᴇᴇᴅ Sure, and we have gone over this. And the question I was talking about is a bit of an odd one: the OP was wanting to shoehorn something inappropriate into a list comp, and they didn't explain what they were actually trying to do. Martijn said they couldn't do it. I realised that their code was a LZW encoder, and I showed how it was possible to do what they asked in Python 2, but I firmly said it was really dumb to put it into a list comp.
I'm pretty sure I got at least one downvote from people who disapprove of answers that show how to do bad things (eg making dynamically named variables by manhandling globals())
 
@Simon yup, them too. And the Swiss I guess? And all the rest I don't want to enumerate now :P
 
Oh I forgot them. Yes they are good.
You are unnaturally good at guessing. I am quite young as well but you got the foreign speaker part totally wrong.
 
@PM2Ring Yeah, I've learned that in such scenarios it is better to just refrain from answering.
Okay, unrelated. I have a Point class here:
class Point(object):
    def __init__(self, x, y):
        self.x = float(x)
        self.y = float(y)
    def __getitem__(self, idx):
        try:
            return [self.x, self.y][idx]
        except IndexError:
            raise ValueError("Invalid Index")
Now, instantiating p = Point(1,2) works, and p[0] does, as it should.
But doing p[100] will throw this:
 
is that like a stripped-down namedtuple?
 
12:12 AM
Traceback (most recent call last):
  File "<stdin>", line 7, in __getitem__
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 9, in __getitem__
ValueError: Invalid Index
Meanwhile I just want the ValueError, since that's what I'm raising. I don't want users to see the other exceptions that were raised and caught.
 
raise from None?
 
@AndrasDeak Yes, pretty much
 
Okay... raise from None is cool.
 
raise from None should suppress the first part (the context). Thanks to @poke :)
 
12:14 AM
Thanks a bunch!!
 
thank him; I've never even used it, only heard him and others mention it here :D
I still find it funny that he calls it a bug request
 
@cᴏʟᴅsᴘᴇᴇᴅ There's a slight problem in that raise from None won't work in Python 2.
 
even better, one can get rid of the (object) ;)
 
Deliberate python 2 incompatibility could be considered a feature to some
 
@PM2Ring Oh, useful to know, thanks.
(I just used that in an answer, now, added that note)
 
12:23 AM
cabbage
 
cbg
 
Hey Andras. I've been playing with my Nanodot magnets lately, making various symmetrical truncations of the octahedron. So a couple of days ago I wrote a Python script to search for such shapes that contain a given number of spheres. And then I wrote a POV-Ray script to render them. Here's a colourful octahedron in 3D.
 
Nice!
I like the reflections, too
Makes it look... idk, more pies de resistance.
 
@PM2Ring neat!
I should play with my nanodots too :D
(no, not a euphemism)
 
Thanks guys. Here's a slightly more realistic metallic one.
 
12:31 AM
ooh
 
super cool
 
@piRSquared nah, metals usually don't do that
 
If you lean back when you look at the screen it looks very real.
 
Top notch, 👍
 
12:33 AM
@Simon the coloured one is stereoscopic 3d
 
@AndrasDeak I deserve that... made me laugh (-:
 
@AndrasDeak what about metglass?
 
I just rendered an anim of one of the truncated octahedra, but unfortunately I didn't do enough frames, so it looks a bit jittery.
 
@AndrasDeak Makes it more interesting I suppose. Much more of a challenge
 
@Craig never heard of it; let me google
@Craig thank goodness I said "usually" ;)
 
12:35 AM
@AndrasDeak It's an amorphous metal, so supercooled so to speak.
 
My tomato of an internet won't load the page, XD. I'm sure it's cool.
 
Bookmark it until you have a better connection or something. It's well worth a look.
 
My internet is at it's peak right now, XD
 
Wikipedia has a page on amorphous metals that describes some others.
 
12:40 AM
@Mr.Zeus You could download with a Python script if you can get the URL.
 
Oh, good idea.
but is it worth the time, got to rhubarb soon
 
They have some cool properties, like very high tensile strength and very low ductility, but I think I'm getting off topic.
 
And here's a truncated one. It's a frame from the anim. It's kinda stereo 3D, but I didn't do the 3D correctly, it's just 2 copies of the object side by side, so the stereo divergence is a bit too intense.
 
@Mr.Zeus Most here reckon so. Use urllib set no timeout. That's what I did when I had weak internet
 
The colours make it look weird/cool.
rubarb
 
12:43 AM
@PM2Ring Cool renderings. Thanks for sharing.
 
rhubarb
 
@Mr.Zeus Rhubarb
 
I'm off for now too. rhubarb
 
@Craig Rhubarb
 
That last one has 216 spheres, so you can build it using a standard Nanodot set.
 
12:46 AM
metal is hard to come by here, so I only have a 64-piece (I think) ;)
 
@Mr.Zeus It's surprisingly hard to come up with a good colour scheme for these things. If you make them all the same colour it gets a bit boring. I like the "gumball" effect of the first one, but after a few hours of looking at images with that colour scheme I found I was getting a bit nauseous. :)
@AndrasDeak That would be pretty boring. 216 is ok, but I wouldn't mind a few more.
 
"we don't use here real coordinates but basic numbers" What the yam is that supposed to mean? Is he talking about reals vs integers? If so, why is that even relevant?
 
they are counterfeit coordinates, not the good stuff
 
1:06 AM
Huh, the comments seem to have been deleted
 
1:31 AM
Rhubarb all.
 
1:47 AM
Hehe, just bumped up this answer with its first vote, and it looks like this is going to become a HNQ soon.
 
2:12 AM
@Ajax1234 Welcome.
Nice to see you here :-)
 
@cᴏʟᴅsᴘᴇᴇᴅ Thanks man
 
Not to be a niggler, but I would encourage you to write answers that are a little more readable at least
(continuing from our discussion under your answer)
@cᴏʟᴅsᴘᴇᴇᴅ I am not entirely sure it is bad practice to merely to show a shorter solution to a problem, perhaps utilizing more esoteric builtins. If the problem comes down to a more lengthy explanation, I am happy to provide that. — Ajax1234 36 secs ago
I see.
@Ajax1234 I believe good explanations should come by default, not by demand ;-)
 
2:57 AM
Huh, tried to exert the @AndrasDeak hammer on him, didn't work
@user2357112 I've decided to delete my answer. I found a "workaround" with globals but I don't believe the answer fits the standards of a good answer to the question. There possibly is a way to determine figure out all the variables in the present "scope" and devise a modification which works, but it would only seem messy IMO.
@user2357112 By the way, your answer doesn't have a code solution yet, so if you can figure out how to fix my function to reliably work in any context, you're welcome to add it to your answer. I've already upvoted it, it's really good.
 
Who is @user2357112?
 
3:18 AM
Default username guy
 
He liked the number because it contains a series of primes, so he decided to keep it when he registered.
 
But 1 is neither prime nor composite. Unless you count it as 11 ;)
 
Well yes. He has the first five primes, in order: 2, 3, 5, 7, 11
The final 2 is a little unfortunate; OTOH, 2 is such an important prime it's worth repeating. :)
"All primes are odd, except for 2, which is the oddest prime of all".
 
@PM2Ring Need a steady eye here. Has this been correctly closed? stackoverflow.com/q/48219087/4909087
I figure the kid is a bit ticked off with all the nagging lately, but this might've been a little too vindictive
 
3:35 AM
I would have had to register a lot earlier to be user235711.
@cᴏʟᴅsᴘᴇᴇᴅ: I didn't include code because the idea was that it'd be integrated into the code that needs to recursively traverse the dict, as an on-the-fly check, and I don't know what that code looks like. I guess I could sketch up something generic.
 
Fair enough...
 
@user2357112 Or a lot later to be user23571113 :)
 
what do you think about that closure?
 
3:50 AM
@cᴏʟᴅsᴘᴇᴇᴅ That target was for a different question. I've removed it and added two better links.
 
Satisfied, thanks
 
I love that groupby(enumerate trick.
Huh? The OP just deleted.
 
Hmm... those answers solve different questions. Those guys wanted every sequence
This one wanted just the start of it.
 
4:07 AM
@cᴏʟᴅsᴘᴇᴇᴅ He wanted to identify the starts of subsequences of consecutive numbers. So you find the subsequences and then print their starting numbers.
 
So, flying from the US to the UK via Australia...
You burn a bit more gas but you still get there ;D
No complaints though, it's good enough for me.
 
:) The groupby(enumerate trick is in the itertools docs, so it can considered a standard idiom, IMHO. And so when you want to find subsequences of consecutive items, it's a good starting point.
 
Oh, the lack of closing ) around enumerate was deliberate?
:p
 
4:23 AM
@DSM if you're there, you gave me some hints the other day, I just wanted to say thanks for deciphering my question and giving me something to read around, rather than giving me code as an answer or dismissing me. Much appreciated.
7
 
@Bonstark I cannot stress on how much an attitude like yours is appreciated by the community.
Way too many find it easier to ask "gimme teh codez" questions, because they don't have the desire to learn and understand. For them, code is just a means to an end.
And even more guilty are those willing to oblige for points. Admittedly I've been guilty of the same, but I'm a lot more conscious of my actions harming the site than before.
 
I'm amazed people give their time to answer questions without reward. I don't know if the points provide anything beyond a redditesque karma, but it's certainly appreciated.
 
4:42 AM
@cᴏʟᴅsᴘᴇᴇᴅ Speaking of which... stackoverflow.com/a/48219081/4014959
@Bonstark Well, the more points you have, the more power you have to do stuff on the site. And of course, high rep is an indicator that you know what you're talking about. :) It's not infallible, but it's generally a pretty good guide. OTOH, some people have accrued a lot of rep by answering vast amounts of poor questions with sub-standard answers.
 
@PM2Ring Oh, wow. Where do I even begin with that.
The user is implying that I should be reported for voting.
 
@cᴏʟᴅsᴘᴇᴇᴅ I almost invited Jacob here to continue the discussion, but he's stopped responding, and such a discussion would be better when the room's busier. But I guess I could link him to relevant Meta posts.
 
4:58 AM
Hmm, he replied when I shot him a comment.
Lost more rep through downvoting today than I have in the last week. Huh.
 
@cᴏʟᴅsᴘᴇᴇᴅ "your reaction is tasteless" is a bit tasteless, especially when you direct it at the wrong person. ;) On a related note, I wish you wouldn't accuse people of downvoting you. You can't prove who downvotes, even if you have a fairly good idea, and making such accusations just spreads bad vibes, IMHO.
 
:/ Point made, I've deleted those comments.
 
Thanks
 
cabbage
is this link a stack overflow "hijack": stackoverflow.com/cv/…
 
 
2 hours later…
7:34 AM
@ReblochonMasque that certainly looks very nonSO
kindda suspicious
 
7:55 AM
Yeah, that looks like straight up spam
 
8:12 AM
cbg
 
That's what I thought to - where to report it?
cbg
 

SO Close Vote Reviewers

This room is for support and discussion about reviewing and co...
 
Good idea @AndyK, thank you
 
@ReblochonMasque otherwise if the room is unreactive, you can raise that to one of the employee of SO like Shog9
 
Thanks @AndyK, I dropped a message in the room - there are 4 active members at the moment.
How to contact a member directly?
 
8:38 AM
@ReblochonMasque you mean someone from the staff?
 
@ReblochonMasque we are already well aware.
There is a spam network that creates only Stack Exchange profiles, with spam material.
(and @AndyK)
 
@MartijnPieters thanks Martjin
 
9:35 AM
@jjj cheers for the library github.com/thu-ml/zhusuan
 
Can I get an apps root url from within the app in views and templates
Without assigning a namespace
In Django
I'm not sure if I want a namespace cos I want users of app to be able to assign any namespace if they want.
Then they would have to modify all the namespaces in the templates {% url 'namespace:route'%}
 
Interesting. Is it for a sort of user defined 'sections' type approach?
Might be worth looking at how Wagtail implements it, as they have something similar - I can go in through the CMS and add sections, subsections, that manifest as myaddress.com/blog/mysection/mysubsection
That the sort of thing you mean? @Kotlinboy
 
9:51 AM
I don't understand what you're saying .

Others using the app can have any url for the app like 127.0.0.1/djeddit for the app in projects urls.py.

I need to the app's root url ie. `djeddit/`
When the user sets this `url(r'^djeddit/', include(djeddit.urls))
A alpha open source project I'm contributing to has a major bug due to hard coding of base url in JS
The apps JS calls 127.0.0.1/edit_post instead of 127.0.0.1/djeddit/edit_post
I mean devs using the apps not CMS kinda users
 
@Kotlinboy If you are worried about JS urls only (hence the requirement of getting app root url), then you are better off using coreapi
 
@AndrasDeak :))
 
 
2 hours later…
11:38 AM
@AndyK *Martijn
cbg
 
@AndrasDeak yikes Indeed Martijn ! Thanks @AndrasDeak
 
M-J
Hi
 
hello
 
M-J
Someone said: "Try to understand the codebase", what is codebase? How is it different from the source code of the program?
 
In software development, a codebase (or code base) refers to a whole collection of source code that is used to build a particular software system, application, or software component. Typically, a codebase includes only human-written source code files; thus, a codebase usually does not include source code files generated by tools (generated files) or binary library files (object files), as they can be built from the human-written source code. However, it generally does include configuration and property files, as they are the data necessary for the build. A codebase is typically stored in a source...
 
M-J
11:46 AM
I've seen that but it's a little vague, so codebase is only the part of source code that is written by human?
 
That’s what it says, no?
 
M-J
Thank you.
 
12:18 PM
Huh, wind is blowing from the East. Now I understand what the meteorologists meant when they said that an anti-cyclone will dominate our weather
 
re-cabbage
Thanks @MartijnPieters & @JonClements, I saw your earlier posts, in the other room too.
 
12:41 PM
Cabbage
Did anyone had also this error when using Django? Setting an url like "^whatever/(?P<var>[0-9]+)$" don't work, but appending a final slash to it ("^whatever/(?P<var>[0-9]+)/$") does work
Great, it didn't formatted it and it's late to edit. Anyway, the first one results in a blank space added at the start of the url, whereas the second not. An I'm missing something? (Django 1.11.3
And I do not have extra code I'm case you're thinking, just including the URLs of an app
 
1:46 PM
So, like, the url in the browser's address bar has a space in front of it when you navigate to the page? I didn't know that was possible.
 
Spaces before the protocol? Not possible. Spaces in the path? Possible.
 
Maybe he has a variable named url which doesn't necessarily always reflect exactly what's in the address bar, and sometimes that variable starts with a space.
If so, I suggest str.lstrip()
 
@RompePC what's your APPEND_SLASH setting?
 
"Kevin, you're missing important context to the question that would be plainly evident if you were moderately versed in Django, and since you're not you're only adding noise to the conversation", thinks the hypothetical reader. I think I'll go look at funny cat pictures for a while.
 
@RompePC I don't think that's possible, will have to look at the relevant code
@Kevin :-p
 
1:51 PM
@Kevin well it's not like we got even a single line of working code
 
Yeah I suspect the problem is inextricable from the guts of Django. Like some default url-matching routine is where things are invisibly going wrong. I'm charitably assuming that if OP could have provided an MCVE that didn't involve taking an entire web framework along for the ride, they would have
 
Worthy to be shared
If you have imposter syndrome you already belong and fit in far more than you know.
 
@AndyK I learned that a few years ago, and it made me feel infinitely better about myself. I pretty much felt like a fraud the moment I left elementary school.
 
If you read this tweet and don't immediately think "he's talking about a superior class of impostors that flail about for a while but eventually satisfactorily complete their tasks, a class I don't belong to, god I'm an impostor among impostors" then you're an impostor impostor impostor
5
 
@Kevin =D
 
2:00 PM
@Kevin impostorception
 
@Kevin #lmaaaoooo
@Kevin super Impostor
 
 
Cabbage!
 
General question, if you had to write a strict type checking in python and are given a dataclass DClass that comes with type-hinted attributes, would you use DClass.__annotations__ or DClass().__dataclass_fields__ to infer the appropriate types?
cbg Simon =)
 
@Kevin +1
 
2:08 PM
I use stars to strengthen those layers, like the countless iridescent layers that make up a pearl
At the core of my very being: a single grain of sand.
 
@Kevin agos.co this?
 
That's a weird page design.
 
XD What are you a member for then?
 
I've got a zillion pixel monitor, looking at a four inch square containing a five inch square of content, which naturally requires scroll bars
Maybe it looks better in chrome.
 
\o cbg
 
2:14 PM
@Kevin What are you using now?
 
Firefox
This is how it looks in FF. It does, in fact, look better in Chrome.
 
It's design is as good as it looks then.
 
I feel like I run into this paradox fairly frequently, where the browser decides that it needs horizontal and vertical scrollbars in order to display the ten pixels worth of data that are obscured because of the horizontal and vertical scrollbars that are in the way
 
Web-devs not doing their job.
Last time I went in the JS room there was an intense discussion on cleaning rubber car carpets :\
 
Our off topic conversations are much more interesting.
 
2:23 PM
Sometimes, I guess
 
Cabbage

In pandas, `df.plot()` why does setting `label=` only affect the legend when x or y data is specified?
I ran into this on this question https://stackoverflow.com/questions/48225744/matplotlib-pyplot-how-to-include-custom-legends-when-plotting-dataframes/48226016#48226016 but not sure if this is intended or a bug?
 
I'll be back later.
rbrb
 
I wrote a script that PYTHON intersperses topical INDENT words and phrases into 3>2 my chat. This DJANGO always keeps me on topic.
 
I watched at least one anime in the last year that showed Python code on screen for at least five cumulative seconds so I think I'm in the clear to discuss my DBZ power level rankings
 
2:32 PM
I think I know that anime. They also showed it a few other times too :D. Also the same studio made a REALLY good anime this season too.
 
@DavidG It is because when you plot a dataframe, it uses the column names as labels. When you plot with y = 'Value' it is then plotting a series and will respect the label argument. You should rename the columns then plot.
df3 = pd.concat([df.Value.rename('Test'), df2], axis=1)
df3.plot()
 
@piRSquared Ah I see, thanks.
 
lol
lemon
 
those are good yoga pants
 
I am not
 
2:44 PM
Not yoga pants?
 
I'm cycling shorts
 
@piRSquared Would it be appropriate to update my answer (with proper attribution to yourself) as OP asked why this was the case?
 
@DavidG that is nice of you to think of that. However, I don't care about attribution from something you learned in chat. Update yes, attribute no.
 
Tempted to write a bot to get to the end of Permanent Redirect but that seems a bit like poisoning the well
I attempted to navigate manually but ironically got a 500 error about ten clicks in
 
My main take away is that I really like the squiggly underline on hover
 
2:57 PM
@Kevin my boss did just that
 
3:07 PM
How cunning to choose the name Permanent Redirect, which stymies my ability to circumvent the entire exercise by googling "permanent redirect screenshot". That just gives me a whole lot of irrelevant results
 
3:39 PM
It was a mistake to click on that Python 2.6 question.
 
Hi
I have this date given by linux machine (Debian 9)
Wed Nov 22 16:11:25.0000000000 2017
I wanna convert it to "conventional" datetime -> datetime.datetime.strptime(linuxdate, '%a %b %d %H:%M:%S.%f %Y').strftime('%Y-%m-%d %H:%M:%S')
but it fails.
ValueError: time data 'Wed Nov 22 16:11:25.0000000000 2017' does not match format '%a %b %d %X.%f %Y'
ValueError: time data 'Wed Nov 22 16:11:25.0000000000 2017' does not match format '%a %b %d %H:%M:%S.%f %Y' *****
So, how can I do it?
Where am I wrong?
 
I don't think %f can parse that many zeroes.
>>> datetime.datetime.strptime("Wed Nov 22 16:11:25.0000000000", '%a %b %d %H:%M:%S.%f')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Programming\Python 3.6\lib\_strptime.py", line 565, in _strptime_datetime
    tt, fraction = _strptime(data_string, format)
  File "C:\Programming\Python 3.6\lib\_strptime.py", line 365, in _strptime
    data_string[found.end():])
ValueError: unconverted data remains: 0000
>>> datetime.datetime.strptime("Wed Nov 22 16:11:25.000000 2017", '%a %b %d %H:%M:%S.%f %Y')
datetime.datetime(2017, 11, 22, 16, 11, 25)
I guess you could use a pattern string like datetime.datetime.strptime("Wed Nov 22 16:11:25.0000000000 2017", '%a %b %d %H:%M:%S.%f0000 %Y') but that will work if and only if the fractional second part of the input string ends with four zeroes
 
> microseconds Between 0 and 999999 inclusive
Or you can strip the trailing mircoseconds off if you don't need it before you convert to datetime.
 
11
Q: Format Nanoseconds in Python

user1332148I have some log files with times in the format HH:MM::SS.nano_seconds (e.g. 01:02:03.123456789). I would like to create a datetime in python so I can neatly do math on the time (e.g. take time differences). strptime works well for microseconds using %f. Do the Python datetime and time modules rea...

TLDR: manually slice out the extra digits
 
oh god. a fly just flew into my eye... what do I do.... this office doesn't have an eye cleaning station
rbrb
 
3:52 PM
@MooingRawr Well if he needs them he's out of luck because datetime can't store that information anyway
 
Thank you all
:)
 
very true Kevin.
 
I'm worried about your fly situation.
 
it might have been my eye lash im not sure. went to the kitchen and stuck my head under the water faucet, so I think I will live
 
I don't know if I would be more worried about the amoebas in the water or not.
 
4:00 PM
well it was that or constant feeling that something was in my eye. Hence "I think I will live", if I don't well rip.
 
I couldn't find information one way or another about the actual risks of contact with fruit flies. Google gave me a page named "do fruit flies carry disease?" and was very informative right until the paywall popped up halfway through the paragraph explaining what bacteria is
 
this stupid office has an issue with fruit flies, because we are right above the cafe for the building :\
 
Based on folk wisdom, I'm going to rank them as worse than amoebas
 
I would agree, because how many people wash their face in the morning and still live vs number of people with fruit flies in their eyes, is still in favor of the washing the face.
 
Waiting for the XY Problem to drop in stackoverflow.com/q/48229447/953482 when OP reveals "actually can you all just tell me how to convert a number to hexadecimal?"
 
4:07 PM
then we hammer it with a dup target ?
 
Well I'm going to smugly pat myself on the back. You can do as you please.
 
<smug intensify>
 
[smugs internally]
 
Question, how would a snake wear (human?) pants ?
I would imagine it's one of these options, and please excuse my lack of drawing skill:
 
I think snakes would wear "a" pant as apposed to pants, as they have only one limb...
 
DSM
4:18 PM
Morning cabbage for all!
 
cbg DSM
 
Your drawing skills rival Kevin's!
 
I'm leaning towards #1. #2 wouldn't stay on and I think that hairpin curve in #3 would be uncomfortable
 
I was thinking that too... but I'm not a snake so I don't know how uncomfortable hairpin curves are to snakes.
 
I'm no herpetologist but I imagine they must have a minimum turning radius
Otherwise they'd kink up like a garden hose
 
4:22 PM
well if cartoons from my childhood has taught me anything, snakes do not like being kinked up / knotted up... So I guess your point is valid
 
DSM
We'll have a vote on room style for snek-pant-wearing at the next GM.
I'm not going to permastar the announcement on the board yet, but it'll probably be on 5 February.
 
Counterevidence: Garter snake mating ball. Exactly what it sounds like.
 
Oh please let me know of the outcome (for DSM). (but Kevin's comment is too funny :D )
 
A new generation of garter snakes, I expect
 
DSM
@MooingRawr: you're invited, so you can find out yourself. :-)
 
4:25 PM
@Kevin #1 also wouldn’t stay on. Snakes move differently than pants-wearing creatures.
 
I giggled at that Kevin :P
@poke counter argument to that, snakes S moves right, so the little bit that touches the floor, can S move.
 
Yeah, I know. They go in like an S motion. But it remains to be seen whether the pants would follow the crest of the wave, and fall off in only a few undulations, or stay in relatively the same position with respect to the head
 
@DSM I look forward to seeing the time
 
Becoming unfashionably bunched up in the process, but still better than being naked
 
hmm would it be better if they had a belt that ties off the top similar to what humans do ?
now I'm imaging a snake as a belt for the pants of another snake....
 
4:28 PM
I would actually expect the pants to stay exactly where they are when the snake moves, so the snake just moves “out of it” while leaving the pants behind
 
I give better than even odds on that given that snakes have a reputation for being smooth
Physically, not emotionally. But maybe they're also smooth operators idk
 
@poke I think if the snakes wants to keep the pants on they can manage moving without slipping out of the pants.
 
We're definitely putting these pants on them against their will
 
4:56 PM
@poke we have experimental evidence for sweaters reddit.com/r/aww/comments/7m44jt/…
have you googled matplotlib annotations?
and there is sooo much needless whitespace there
 
Please use dpaste.com for large blocks of code
 
@AndrasDeak That’s only a stationary snake
 
there are videos if you google "spaghetti sweater" ;)
but yeah, I don't think Spaghetti can move around in a sweater of length 0.9*len(Spaghetti)
 
@AndrasDeak Yeah, I found something on stackoverflow, but it seemed complicated (creating another axis and lowering it etc).
@davidism Sorry about that.
 
that's weird, if I google matplotlib annotations I find pyplot.annotate
 
5:06 PM
Design question: I'm writing a REST library. I'm gonna have a RestClient class which has methods for sending REST requests and stuff. I also want to build support for different authentication methods into the library, like OAuth2 or username+password. I designed these as Mixins, because they override some of the Client's methods (for example, the OAuth2 mixin automatically adds the auth_token to the request headers).
Now the problem arises if a RestClient implements multiple authentication methods: Only one of them can be active at a time. Is there a design pattern that allows to basically "turn off" a mixin or parent class?
 
@AndrasDeak Those examples seem to point only inside the chart? I need more of a title I guess for the vertical line.
 
@Rawing One solution is to provide multiple RestClient classes for each authentication method. For example, OAuthRestclient
 
@AndrasDeak Actually this may be not to bad:
https://stackoverflow.com/questions/16992038/inline-labels-in-matplotlib
 
@Moondra oh my. So you want to annotate something outside the axes. Google "matplotlib annotations outside axes"?
because that seems to be trivially possible stackoverflow.com/questions/18537879/…
 
@Code-Apprentice So that's basically the same thing as making it illegal to inherit from more than one mixin. I'm not really happy with that. I'll consider it though, thanks.
 
5:13 PM
@Rawing Do any of the mixins implement/override the same method? If so, how will a user know which of those methods to call?
 
The user isn't supposed to notice the mixins at all. They just override some internal methods; for example the OAuth2 mixin overrides the send_request method so it can inject the authentication token into the headers.
Basically the mixins don't change the RestClient's interface at all, only its behavior
So yes, many of them will actually override the same methods
 
If I understand correctly, you want to do something like this: repl.it/@codeguru/OpaqueBlackandwhiteArctichare
@Rawing how does the user of your library specify which authentication protocol to use?
 
I was thinking of implementing different login methods. So client.oauth2_login(auth_token) would enable OAuth, or client.password_login(username, password) would enable the username+password mixin
That's just an idea though. I wouldn't mind doing something like client.set_auth_method(OAuth2Mixin) or similar either
If your Everything allowed me to choose whether foobar.foo() calls MixinA.foo or MixinB.foo, then it'd be exactly what I want
 
5:31 PM
@Rawing Maybe something like this repl.it/@codeguru/OpaqueBlackandwhiteArctichare? I don't think this is exactly right. I am almost certainly using super() incorrectly. I am not well versed in python's inheritence implementation.
I don't really see the difference between having client.oauth2_login() and client.password_login() vs having OAuthClient and PasswordClient.
You could quite easily implement client.set_auth_method() and pass the mixin class. This basically uses composition rather than inheritance.
One difficulty you will encounter is that different authentication methods require different parameters.
 
@AndrasDeak Thanks. However, it doesn't seem to be trivial with subplots - especially since my annotations seems to be based on a variable. Transform is doing some crazy things to my plot.
 
@MooingRawr way to be on topic (-: I'm assuming the snake is a python
 
I don' have neither had used that var (didn't even know its existance lol). The strings that forms the regex are exactly those two, nothing more, nothing less. I'm on mobile now due to inbox notification, so cannot type too much here. Also I don't know how to multiquote here in mobile, so Kevin, no, I don't have an url var or something.
 
@Code-Apprentice I guess I'll go with that. You're right, there isn't much difference. It'd be a little easier to implement a working RestClient though: dpaste.com/0XE73S4
 
I hope I can do a working example ASAP to reproduce it.
 
5:39 PM
Hmm, I see.
Unfortunately I have run out of cat pictures so I'll have to start giving my unhelpful advice again to pass the time
 
how about other cute animal pictures?
 
Did you see the world smallest felyne?
Also, have to go now, will come back with news about it.
 
 
d'awww :D
 
@Moondra why is transform doing anything to your plot?
based on your code I think you're doing it wrong
 
5:43 PM
@AndrasDeak Yeah, I deleted one of the subplots by mistake lol.
I was commenting out code, and I commented out the subplots.
 
anyone know how this person gave an answer 1 minute ago yet the "put on hold" was in effect 6 minutes ago ?
https://stackoverflow.com/questions/48231330/python-3-list-comprehension-filtering-squares
 
I have a hazy recollection that there is a short grace period for such things
 
@AndrasDeak I got it temporarily working with this line:
plt.text(threshold + 5, np.max(counts) + 3, str(threshold), fontsize = 12)

It's still inside the chart, but I think it will do for now. I will check out transform later on to make it more aesthetically pleasing.
Thank you for your help =)
 
did you read the post of tacaswell I linked? The one which disables axes clipping?
oh, sorry, those were annotations which you ignore entirely
 
@Yeah, but with that it seems to be using the entire canvas as the coords system (from my brief at temp at it)? So I will have difficult coordinating it with the second subplot (due to the red line being based on a number). I will play around with some more later today though. Thank you.
 
5:52 PM
good luck
 
I'm getting a promotion and raise starting next month!
Just had a monthly performance review and it was mostly good news
 
@Code-Apprentice Pineapples
 
DSM
Pineapples for the (maybe no longer as much of an) apprentice!
 
apprentice on SO, guru everywhere else :)
 
I will always be an apprentice
 
00:00 - 18:0018:00 - 00:00

« first day (2645 days earlier)      last day (2303 days later) »