« first day (3008 days earlier)      last day (1937 days later) » 

7:20 AM
Hey, I have a problem with cleaning up some filenames. I have two problems, one with the used encoding on filenames ISO 8859-1, so os.path don´t show all letters right and I still havent figured out how to clean filenames on names like these {uselesswords}correct.pdf I would need to clean whole {} stuff out of filenames. Thanks!
 
7:39 AM
are the {} actually part of the name, or is there some other consistent separator you can split on?
 
7:54 AM
@MisterMiyagi Yeah the {} are part of the name, so it should be easy to just find those.
I only need correct.pdf but every file have that nonsense {something} before correct name..
 
you should be able to do filename.partition("}")[2] if there is only ever one pair of braces
that will split on the closing brace and just give you everything after it
 
rpartition for multiple braces
 
Ah that did work perfectly thanks! And got rid of that encoding error by just not splitting the filename.. Thanks!
 
The encoding thing sounds weird by the way, but I guess that is irrelevant now
 
8:21 AM
recbg
 
cbg
 
cbg
 
While it shouldn't really be that noticeable yet, just knowing that the days get longer again has lifted some of the winter mood for me
or maybe vacations make me depressed, who knows
 
Winter mood is best mood! Snow, lack of scorching heat, yaay
I heard you guys have plenty of snow
 
In the south i think. Up here in westphalia there hasn't been any snow at all as of yet
 
8:32 AM
Ah, I thought it was more widespread. Guess it's mostly in the Alps then.
 
9:14 AM
we've got nice frost here...
I'll shoot a pic when I get out
 
That reminds me: robins have started visiting our bird feeder on the balcony. They are a rare sight :)
We've always had great tits. And sparrows.
 
i like tits :P
@AndrasDeak which sparrows do you have
 
Yeah, tits are great. But they are quite commonplace.
@AnttiHaapala Passer domesticus, I believe
oh, and Passer montanus
Hmm, the latter seems more familiar. But I'm not sure I can distinguish the two.
 
asking bc pasmon used to be really rare here... and pasdom the one that was everywhere, but they've changed all of sudden...
colour of head cap is easiest.
 
I'm pretty sure I usually see montanus
that's what looks like a "sparrow" to me
 
9:26 AM
montanus is the only sparrow species that I've eaten though ;)
 
ewww
winters get harsh up there in Finland
 
that was in VN
 
I'm surprised :P
 
i'm having trouble updating anaconda. if i reinstall it will i lose my environments and packages?
 
9:45 AM
@user14492 post the error
here
 
10:11 AM
looks like anaconda don't want none :p
 
:D
 
is there any introverts here??
 
10:27 AM
maybe, I'm not sure anymore
 
you scared them away!
 
cbg
 
can't be googled
 
10:53 AM
@AkhilAlexander no, just us cabbages
 
11:18 AM
and puppies
 
 
2 hours later…
1:34 PM
cbg
 
cbg
 
Have anyone used reed.co.uk job search api?
 
cabbage
 
1:47 PM
Python devs, please add a NumberWithExactlyTwoDigitsAfterTheDecimalPoint class to the stdlibs
decimal.Decimal comes close but it falls short when you're working with precentage-based discounts. You can't do "15% off of $9.95" perfectly seamlessly.
 
I'm experimenting with mypy in PyCharm but so far it hasn't helped much :/
 
"Just store your value as an integer number of cents" offends me on an aesthetic level, so that's out
 
damn, that's what I just wanted to propose :P
 
pip install money
 
Not that 995 * 0.85 gives an integer result anyway
 
1:51 PM
are you sure you don't want a NumberWithExactlyNDigitsAfterTheDecimalPointFactory?
well, you usually do not want to accumulate rounding errors
 
Unless... Python devs, please implement "truncated multiplication" to go with //
** is already taken but you'll figure something out I'm sure
 
so it's usually something like int * float * float * float * float and then convert to int
 
@Kevin I read "Not" as "Note" lol
 
@Morwenn Is money an actual package or is that a joke? It would be nice to pip install money whenever I needed some :)
 
Interpreting messages under the assumption that they contain a typo even though they scan properly as written is the kind of Wine-In-Front-Of-Me overthinking that I can really get behind. It's practically my personal brand.
 
:(
 
@W.Dodge there are money packages here and there
 
money package maintainers, please implement a percentage class which is interoperable with money, since you're unwilling to allow money-on-float multiplication, and I'm unwilling to do explicit type conversion
 
postfix % operator x)
 
Although you can (in a round-about-way) pip install money. A. Hall shared a link talking about the combined value of many open source projects and the subsequent earnings resulting from those packages. So pip install money happens all the time.
To that point, I wonder what would be determined to be the most valuable package available on PyPi, probably Flask, Django or OpenCV, something like that I guess...
 
2:09 PM
opencv isn't really python
 
true, but you can currently pip install OpenCV
 
What metric are we using to decide whether a module is really python or not
 
Anything that was written in python or in order to be used in python. I guess anything that doesn't work without the python bits can work.
point being, opencv was written in C++ to be used in C++ and it only has a thin wrapper in python
 
I see. Thanks to its wrapper, it can interoperate with Python, but since it has wrappers for many such languages, it evidently does not swear fealty to House Python
 
OpenCV is OpenlyCyltherin?
 
2:18 PM
it also doesn't follow the glorious documentation customs of House Python
 
Trying to decide whether Python's house words should be Easier to Ask Forgiveness, or something from the Zen
 
@AndrasDeak Yes it is bad, on the other hand, have you read any scikit-learn documentation? That stuff is beautiful.
 
nope
 
The former works very well in a medieval setting where nobility has a tendency to burn villages to the ground and then apologize half-heartedly later
 
@Kevin "Your Mother was a Hamster, and your Father smelt of Elderberries!"
 
2:26 PM
The house words committee won't ratify it unless it's short enough to fit on an ISO-standard tapestry
 
^^ we can also just do it then ask for forgiveness
 
Is that a cobra?
 
The official GOT tapestry generator has a very limited selection of snake species.
 
Put a wrapper on it and we're good :)
 
Does Westeros even have any hot and wet regions? They might not have pythons at all.
 
2:29 PM
the boglands
that's not what they're called, but you know
The bit with the swamps. Moat Cailin?
 
Home of the Rats of Unusual Size... Hang on, wrong universe
 
The Neck maybe
 
Wikipedia indicates that north Westeros is basically Fantasy Scotland. A bit too cold for pythons, I reckon
I guess putting a permanently hot region on the continent would somewhat undermine the whole "winter is coming and most likely we'll all die" plot point
"Winter is coming and most likely we'll all move to Fantasy Florida and grumble about the subsequent real estate bubble"
 
cbg \o
 
cbg
 
3:08 PM
While looking through the Python specification for rules about what behaviors are allowed to be optimized away, I found this message: "If you would like to see a more formal definition of the language, maybe you could volunteer your time — or invent a cloning machine :-)."
 
what if two BDsFL disagree?
 
The defense of "don't like this open-source project? Feel free to improve it for us" is ubiquitous, but you don't often see it in paragraph one of the specification
@AndrasDeak That's why you need an odd number.
 
smart!
 
@Kevin I believe that's the first I heard of that fantasy ending
That'd make a ruckus on reddit
 
3:30 PM
As much as I like the mental image of all the would-be kings quarreling over the breakfast buffet at the Boca Raton Golden Corral, in all likelihood they wouldn't get that far. A dozen opposing armies marching south to Fantasy Florida could only end in a battle that's violent and chaotic even by the standards of ASOIAF
Can't have a housing bubble if you see your neighbors driven before you and hear the lamentation of their women
 
such cold. very valid. amaze disbubbling
 
@Kevin True, but with a triumvirate things can get cut-throat, since if they don't agree then it's 2 against 1. With 5 leaders, the dynamics are a little more subtle.
Speaking of GoT / ASOIAF, did you see this recent thread? scifi.stackexchange.com/questions/203053/…
 
Double annoyed by the contents of that question and the fact that the scifi SE has ditched its dark starry background theme
 
Does Fantasy Florida have a fountain of youth?
 
Yes, but considering only one person has ever died of old age on the show, it doesn't change your life expectancy that much
 
3:45 PM
Lots of people were sad to learn that many SE sites lost their custom themes. But the devs said it was necessary...
 
I guess it's an Anglo thing that violence is a normal part of storytelling, and therefore ok for family viewing, as long as it's not too graphic, but sex & nudity will corrupt the minds of the innocent.
 
That's pretty much the sentiment in the US, yeah. (among people that have a tendency to call up standards boards and complain, which may not necessarily be representative of the population as a whole)
 
is anyone here familiar with tensorflow or pytorch?
 
I suppose my previous comment was a bit Western-centric, comparing Anglo culture to mainland European cultures, especially Mediterranean & Scandinavian. I expect you don't get much nudity on telly in Muslim countries. :)
@erotavlas Not right now. A few room visitors are into ML, but not many.
 
4:01 PM
ok
 
The upstairs neighbour is sneezing, and our dog is freaking out...
 
Maybe there's an ultrasonic component in the sneeze.
 
From what I know, dogs can hear in the sonic range as well.
 
nah, she's just a scaredy cat dog
and the tenants above us have changed recently, so she's not used to the noise patterns these new people make
 
Perhaps she's worried about germs. Atypical for a species so interested in butts, but there you go
 
4:14 PM
Doggo is looking out for you AD, the germs are coming.
 
when germs are coming through the concrete ceiling there will be more of the tenant to come along with it, and germs alone will be the least of my problems :P
 
If your domiciles share a common A/C system, time to seal up your vents
 
they already are :'(
 
Maybe smear a circle of purell around each opening while you're at it
 
A/C is an optimistic way of putting it...just a passive vent system that only works if you consider "channeling whatever stink you have in your flat to every other flat" a feature
 
4:19 PM
p2p, but for dogs
 
unfortunately* we don't get doggie butt smells down here, only garlic and "whatever that was you burnt it real bad"
 
The dog butt smells are there, but ultrasmellic, so you don't notice them
 
nah, she's the only dog on this side of the stairwell
perhaps her butt smells all the way to the roof
 
4:57 PM
Lately I've been half-heartedly researching how operating systems and/or C-like languages do dynamic memory allocation, and it seems to follow a principle of "fast, memory-efficient, easy to implement: choose one"
"How does the OS decide where on the hard drive a file gets stored?" is one of those questions that can be asked in three seconds and answered over the course of a semester
When I'm stranded on a desert island, I'll probably choose "memory-efficient" since I have to construct each byte of RAM out of coconuts and vines by hand
 
whose idea was it to add this features: Your post appears to contain code that is not properly formatted as code. Please indent all code by 4 spaces using the code toolbar button or the CTRL+K keyboard shortcut. For more editing help, click the [?] toolbar icon.
bcz they deserve a glitter bomb.
seriously how can one expect to know exactly which line is the culprit even though i have everything formatted correctly.
agh.
what's wrong with this formatting: pastebin.com/YB2zDDkz
 
@user14492 they are immensely useful for true positives
``` does not format multiline code on SO
the message literally tells you what to do instead
there's also a live preview but that might not work if you get that message (I wouldn't know; I never got that message)
 
5:13 PM
except it does format it with ```
and no it doesn't
 
oh you meant "no it doesn't" for the live preview
I'm going to need a reference with "it does format it with ```"
 
if you are gonna force user to "properly" format it. why not just add those spaces in the detected lines? it's not like it'll accept it otherwise. this will just force users to code format the whole questions except few things.
smh
 
Finding a syntax error is easy, figuring out what it was supposed to be is difficult.
 
i had no code. there was no syntax. it was all terminal output as you see.
 
Are you saying the SO engine should've realized that your broken code formatting wasn't supposed to format code?
Or are you saying that the trible backticks were literally printed into your terminal?
 
5:20 PM
i'm saying you should let users veto this requirement.
at least ones that have some rep.
 
They do. The way to veto it is to fix your formatting.
the thing you pasted does have broken formatting. Come back complaining with a false positive and I'll be bursting with empathy.
 
okay.
 
based on our earlier communication today in another room I would guess you're doing it wrong
 
SO is incentivized to have features that inconvenience question askers for the benefit of answerers, because happy answerers keep the site running. This might be the correct decision even if the feature annoys 100 askers in order to please only one answerer.
The ideal, of course, is to have features that annoy nobody. But if you have to choose...
 
@W.Dodge thanks. now i'm stuck on 1.8.7 :D
 
5:32 PM
"Live preview is disabled until you fix the formatting problem, which would probably be a lot easier to fix if live preview wasn't disabled" seems like an anti-feature, though. If that is indeed how it works.
 
This is the right link
 
nope. won't let me go over 1.9.2.
thanks anyways. let's see if my properly formatted question attracts some answers as intended.
 
Yeah I'm no help :) I just now realized that you care about updating the navigator thingy or whatever it is rather than the underlying conda stuff. Becuase the link you shared shows you as having conda version : 4.5.11 which, from what I can google, is the current one.
 
5:59 PM
Huh! @user14492 sorry, you were right, it seems that triple backticks work on main. I was sure that wouldn't work. I'm wondering if that's something newish.
Instead of using indentation, you can also create code blocks by using “code fences”, consisting of three or more backticks or tildes:

```
alert(false);
```

~~~
alert(true);
~~~
So @Kevin I posted the code from the paste into a new question and the live view works. I suspect the error pops up when trying to submit.
triple backticks weren't included in May 2017 web.archive.org/web/20170501065251/http://stackoverflow.com/…
104
A: Implement ```-style (fenced) Markdown code blocks

balphaCode fences work now. function DeepThought(task) { this.task = task; } DeepThought.prototype.answer = function () { switch (this.task) { case "life, universe, and everything": return 42; default: throw "not implemented"; } } (view source on this answer) As much as ...

Posted 2 days ago. Honest mistake on my part I guess.
 
When a 'carefully curated' programming challenge from a major website has a TabError in the immutable python test code, and everyone is upset yet there's no fix for months...
'We found some problems and didn't try them ourselves, have fun'
 
PSA: SO main now supports triple backticks for code blocks, see announcement and updated formatting help. Doesn't apply to chat.
9
 
I heard they're also working on support for triple backflips
Great video. They're still using Dijkstra's what a timeless algorithm
 
6:20 PM
Damn. And here I was about to quit my job.
@W.Dodge I’m trying to update conda. Or more importantly the packages I use. Trying to move from 1.9.2. If that was the navigator version I wouldn’t have a gui
 
That is impressive @wim
How did you find that
 
wim
6:36 PM
@AndrasDeak github style
 
yup
 
wim
I wonder if they were going off my meta (Mar 2017)
 
the original MSE request is from 2012 so I wouldn't bet on it
 
wim
@IMCoins I work in HFT
@AndrasDeak nice, I will begin using this immediately and ditch the annoying indent style (especially annoying for Python devs)
 
Seems much less error-prone. And a bunch of noobs were trying to use it despite all the FAQs telling them otherwise.
 
6:49 PM
@user14492 "I'm trying to update the GUI therefore I wouldn't have a GUI" is a thought I don't get. I only mentioned that because the Wikipedia link for the package manager itself shows a version of 5.3.1 while this link to info about the navigator shows a version number of 1.9.
 
wim
@AndrasDeak the main thing is ease of copy/pasting to/from REPL.
 
 
2 hours later…
8:54 PM
cbg
 
9:18 PM
Anyone know if it's possible to override a line level ignore in pylint? We had someone introduce a clever solution using eval but disable the pylint warning, and apparently it wasn't caught.
 
Monkeypatch?
 
hehe, "clever" and "eval", famous last words
 
Exactly
 
Or monkeypatch eval
 
There's a way to display a pylint message for every #pylint:disable, but I doubt there's an option with the granularity I'm guessing you want.
 
9:23 PM
eval = lambda *args, **kwargs: print("you shouldn't use eval()")
 
"Papa? Tell me the story of how our race began." "Well dear one, it all started when a primitive species call human naively put an eval statement into their python script. The humorous part was that they thought it was clever. Thus began the singularity"
5
 
Specifically, enabling I0020 (suppressed-message) will display a message when you suppress another message.
 
I hope it starts with "yo dawg"
 
IIRC, I learned about this when we accidentally turned it on at work.
 
wim
using eval to avoid a pylint warning is hilarious
 
9:30 PM
I think the two are unrelated
eval to cleverly solve something and disable a corresponding warning
 
wim
> Useless suppression of 'suppressed-message' (useless-suppression)
 
wim
10:11 PM
TIL git log -S is a horrible trap and git log -G is what you want!
 
10:37 PM
it's a trap? how so?
 
Speak for yourself, I only want a dog
 
wim
10:53 PM
@Code-Apprentice if you use it to Search for commits that add or delete lines which match the pattern "potato", it appears to work most of the time
but it will not include commits which add n lines matching the pattern, and simultaneously remove exactly n lines also matching the pattern. because it is actually searching for a change in the number of occurrences of the pattern in the diff.
 
Are you saying that it sometimes doesn't find commits that should match?
 
wim
no. it does exactly what it says it does in git log --help.
  -S<string>
       Look for differences that change the number of occurrences of the specified string (i.e. addition/deletion) in a file.
 
oic...so if you change a line with the word "potato" it won't show up in git log -S because there are the exact same number of additions and deletions (1 each in this case)
...that certainly explains a lot
 
wim
tampermonkey script request for @Aran-Fey or anyone ... hyperlinked terms in glossary docs.python.org/3/glossary.html
 
you mean anchors to each item?
 
wim
11:01 PM
url fragment
 
oh, I didn't realize those were there sans links
nice obfuscated keywords as well
 
wim
perhaps this should be a CPython PR directly.
easy first issue for someone that wants to contribute and get their name in the ACKS file :)
 
11:28 PM
@wim done
 
wim
hmm, a hardcoded list of them is not really what I had in mind
more like a patch of the DOM when browser is on the glossary page itself, so the terms themselves have a permalink you can click or right-click on
 
oh.
 
wim
e.g. for sending to colleagues etc not just for S.O.
(the @include would be on docs.python.org)
 
11:55 PM
does this do what you want?
 

« first day (3008 days earlier)      last day (1937 days later) »