« first day (2733 days earlier)      last day (2440 days later) » 
00:00 - 18:0018:00 - 23:00

00:01
Yeah, I think this was brought up recently (in this room). And I'm not that well aware of it at the moment. For now, for me, or feels like a first world problem (compared to the python 2.7 unicode handling). (And don't worry about the pings, I'm on mobile right now, so it doesn't even "ping")
Rbrb all
rbrb Simon
Note to self : never start (unintentionally or otherwise) OS upgrades at 1am.
Been 3 hours and still ongoing.
 
4 hours later…
03:41
@JonClements @poke I will be speaking at PyCon! :')
6
04:23
@BadgerCat Nice, pineapples! What are you going to be speaking on?
04:59
Top of the morning cbg
 
2 hours later…
06:54
Hey guys. I'm trying to webscrape using python but I ran into trouble. Can anyone help me out? Here's the link to my question: stackoverflow.com/questions/49746928/…
Thanks!
In [130]: text = 'City Manchester,Region England,Country United Kingdom'

In [133]: re.search(r'(?P<Region>(?<=Region ).*?),', text)
Out[133]: <_sre.SRE_Match object; span=(23, 31), match='England,'>

In [138]: re.search(r'(?P<City>(?<=City ).*),(?P<Region>(?<=Region ).*?),', text)

In [139]:
What am I doing wrong?
Ah nevermind, figured out a workaround.
07:18
cbg
@cᴏʟᴅsᴘᴇᴇᴅ In case you're still interested
>>> re.search(r'(?P<City>(?<=City ).*?),(?:.*?)(?P<Region>(?<=Region ).*?),', text).group('City', 'Region')
('Manchester', 'England')
It's a bit dirty though
What went wrong is that you treated the lookahead of 'Region' as a muted match, when it isn't actually a match. So the expression failed, because it can't skip from Manchester to England without matching Region in some way.
Its probably easier to just apply the City and Region regexes consecutively
s/lookahead/lookbehind/
@cᴏʟᴅsᴘᴇᴇᴅ Do you need the look arounds?
m = re.search(r'City (?P<City>[^,]+),Region (?P<Region>[^,]+)', text)
m.groupdict()

{'City': 'Manchester', 'Region': 'England'}
sleepy rbrbs
07:45
rbrb, and pineapples for the new job =)
08:04
Good cbg all. :D
@BadgerCat Oh wow, congratulations! :D That must be quite exciting! :D :D
@Chae hi - welcome to the room! Please check out your new welcome pack, in which it states please don't link to questions less than a day old :)
08:25
cbg all
@RobertGrant sorry! did not see that.
@Arne Interesting, I didn't know that could happen. Thanks!
@piRSquared This was actually a solution I was trying to adapt to pandas for some classwork. I ended up changing my strategy completely. My initial idea was to use one big pattern with extract. Then, I decided to break it up into small patterns and use extractall. Worked like a charm.
08:42
a
08:53
How can i make Kmeans clustering online?
I know we can do this using Minibatch kmeans
but i can't find good reference code
can anyone help me?
Why do you want to do it online? @JayDangar
09:15
@MayurBhangale By online, I mean sequential K means clustering. As new data comes it can automatically update centroids, and make prediction better.
jjj
jjj
cabeige room 6
09:36
cabàge, j³
jjj
jjj
:)
with this accent I wanna read it like "cabaje"
09:57
cbg o/
10:10
cbg
Successful OS upgrade :D (Ubuntu 18.04 bionic beaver) But no default Python 3 :/
huh, really?
Installed a fresh Debian recently and there is a Python 3.5 default
jjj
jjj
I wonder why is that? (I mean with Ubuntu)
Python 3 comes pre-installed as a default python interpreter for Ubuntu 18.04 desktop and server.

However, on other minimal Ubuntu 18.04 installations, eg. docker, python is missing and needs to be installed manually.
@IljaEverilä rest of the day cbg
jjj
jjj
thks poke
10:15
I felt that as well. Mostly because of my custom upgrade from 16.04 and pre-existing dependencies (including docker) it didn't bother touching Python2.7
Maybe it’s due to the upgrade process that it wasn’t updated?
I actuall have no idea how one updates major Linux versions. I always start with a fresh installation ^^"
But I’m also always only using server versions
I can esily imagine that upgrading interferes
Desktop version here, and I do try to do fresh installations, but didn't bother formatting this time. That is quite an effort (reinstallations)
@AndrasDeak that turned out to be more complicated meta.stackoverflow.com/a/365799/2301450
Python 2 is no longer installed by default. Python 3 has been updated to 3.6.
10:25
And I was happy with the explanation that the flags were validated because the question was deleted :-/
Since I had python2, it didn't bother changing anything. I wonder if that'd break things though.
@AshishNitinPatil please stop spreading FUD
it is =~ never going to be the "default"
on fresh 16.04+ ubuntu installs you just don't have /usr/bin/python at all.
@vaultah thanks, the plot thickens
@AnttiHaapala completely unintentional, sorry for my wrong assumptions then
And thanks for the info
@AshishNitinPatil :D
now you can go around and preach the gospel: "Python 3 is the default Python on Ubuntu 18.04" :D
10:34
ashish@Proness-Aura-2:~$ python3
Python 3.6.5 (default, Apr 1 2018, 05:46:30)
[GCC 7.3.0] on linux
April fools'
At least I don't need to separately install python 3.6 now :D
also: alias python=python3 in your .bashrc, .zshrc....
should be good enough
10:35
or maybe it won't be that harmful in those rare cases
worth a try
If there's no python nothing relies on it. You have python so I'd be careful
Though system things should use specific python
yeah, don't feel any harm in having the alias. At least I'll punish the ones who are expecting to use 2.7
And I don't know if bashrc can interfere with that
10:38
your computer
it is just an alias as written on command line
@AnttiHaapala nah, that won't work for #!/usr/bin/env python scripts
the worst best thing that can happen is that...
yeah, totally forgot bashrc changes won't matter much to system
fffuuu
... you copy-paste some command line example from somewhere that expects that python is python2; it doesn't work with python3; and therefore you uncover a bug and can complain about the quality of that excerpt...
I'll probably do a fresh install after the official release, better that way.
10:41
or that you wanted to go to python 2 interactive session but ended up in python 3 by accident... then you can reconsider your life choices
I'd rather reconsider python's choice to have so much backwards incompatible changes, so much that it's almost a new language
unpopular opinion I guess
(yes, I'm bitter that I have to spend dozens of hours making sure all the strings are properly handled to be able to upgrade)
syntax changes are fine. Strings changes, on the other hand...
Shouldn't you only have to upgrade once? New code should only be downgraded
And they are only properly handled on 3 :P
10:45
yes, but upgrading 50k lines of python is not really nice
I can imagine
and despite unit testing, nobody has 100% code coverage
Is it commented/documented at least?
yes, and roughly 50% is unit tested in CI on every push
10:47
that's still far from confidence inspiring
How you found any latent string bugs yet?
well, just upgrading to py3, there's no syntax change at least.
string bugs... it just doesn't work out of the box, so, probably? :P
more seriously, it's more tons of runtime errors related to passing bytes/unicode around
I mean stuff that was broken but was hidden by python 2
like open("unicode string")
(especially with the libs, some want unicode strings, other want byte strings, and it's not necessarily coherent.)
@AndrasDeak yes, a couple of latent bugs were found, it's far from the majority though
am i glad i changed to py 3 early on :)
10:55
@Pizzalord the libs we were relying on weren't py3 ready back then, unfortunately
(the project was started 4 years ago, most big libs weren't py3 ready back then)
i started programming 4 years ago
and din't use libraries yet, so no dependency problems for me
heh
Generally speaking, my views align more with Linux views: don't break userspace
I can’t even remember when I started using Python 3.. but it was 3.0 that I first used. And already at that point, I never looked back to 2.x for projects.
 
2 hours later…
13:06
@AndrasDeak @AndrasDeak I did not get that link!
look here and my message afterward
13:19
cbg \o
nltk.corpus.webtext.words() takes only documents inside nltk/corpora/webtext can I change that?
@user5444075 does the documentation say anything about that?
I am not quite sure about it..
it sounds like it's time to take a trip to the docs :D
13:36
haha @AndrasDeak of course I DID use Learn Python the Hard Way.... haha
I'm afraid that explains a lot :) Sorry about your experience, try to start over :D
the good news is there are Easy Ways, and it's all much clearer than you might think right now
@AndrasDeak haha I will! Honestly I can figure out a lot of things in pthon. Like yesterday, I can make that stuff work by trial and error - but I don't get why it is working, and the tutorials I have read just tell you WHAT to do, not WHY you do it
@AndrasDeak I just downloaded that book, thank you :)
Good luck and have fun!
Just a heads up Alexander, you don't need to @ ping people when they are replying towards you and there's only one conversation going on.
I can't speak for AD whether he accepts it personally but I know I wouldn't like it, just a suggestion tho
haha fair enough
DSM
DSM
13:44
Tuesday waiting for Windows to update cabbage!
cbg \o DSM
all of these etiquette things I am learning
DSM
DSM
Sorry I couldn't respond yesterday, MR, super busy with new project
I figured as much, life takes priority. Anyways, I filled out my bracket :D
DSM
DSM
It's been 100% complete for ten minutes. :-\
13:50
cbg, DSM
if you have time, I would like to compare with yours ( I don't have my bracket on me since "professionalism" :D ) but I do have Preds vs Us for the finals, with us winning it all
@AlexanderBiel one notable exception is the use of directed replies for disambiguation
DSM
DSM
That would be awesome. I haven't done one yet, but I'll make some time. If this update goes on for much longer I might do it now..
Oh AD, I got to try Hungarian food for the first time. Friends dragged me out on Sunday. It was rather tasty, but I wasn't sure if it's true native food.
Had the WienerSchnitzel among other things but I think that was my favourite :D
Schnitzel for life, though that's probably not really "Hungarian"
I'm glad you liked it! Let me take a look at that...
it definitely looks legit :)
14:05
WienerSchnitzel is Austro-Hungarian at best ;)
I mean, schnitzel is very much part of Hungarian cuisine but we stole it from the Germans
Haha ^^ x post
coming out your way again in the summer Andras :)
hehe, let's hope you'll be let in, stinky foreigner
:D what would you recommend I should try next? I will go look for a restaurant that has it I guess.
schnitzel ;)
14:06
oh well then that's good enough for me :D
one of my favourites is chicken paprikás
dammit, beaten to it
Make sure it has dumplings.
something about a deep fried meat/fish with a lemon wedge and some potatos really makes me happy lol
^^ you should visit Scotland
We're all about the beige food
cabbage rolls can be great too, but that's more risky for a foreigner
14:07
I actually do like cabbage rolls....
The best hungarian food is goulash 👌
not too picky on my foods, I just don't bugs and the risky bits of cut meats such as brain and eyes. and oh joy the place I went to has Chicken paprikash
@MooingRawr ours is called "filled cabbage" and it has minced meat mixed with rice, like this
gulyás ("goulash") soup is also awesome, but I suspect that many places offer stuff called goulash that aren't exactly gulyás
oh sounds good.. question what are the dumplings filled with? potatos? pork? other thing s?
those are actually spätzle
14:10
@MooingRawr could I please get a link?
small dumplings made of flour and eggs and water en.wikipedia.org/wiki/Sp%C3%A4tzle#/media/…
@MooingRawr they likely meant the nltk docs...
my brain is on food mode, one sec user :D
guys I got some free time what should I learn?
14:12
@user5444075 did you try hard trying to find it? I'm not familiar with the quality/availability of NLTK docs
@corvid card tricks?
but... what programming thing? I was considering Rust or Go
Selecting a corpus is literally one of the first things in the nltk docs.
@corvid why not stick with Python some more. If you must I hear good things from go...
Go is quite fun.
I'm playing with this atm
(other online retailers are available)
14:17
@user5444075 sorry I don't know much about the docs for nltk.
@DSM Windows will never change...
I am not able to find them.
jjj
jjj
docs for nltk are quite good imho. Usually what you want is how to. But aslo have a look at the nltk book
first hit for "nltk docs" nltk.org
If feels like you've not done the nltk basics/tutorial
(the one that jjj linked)
this is covered there, very early.
jjj
jjj
14:23
This is the chapter on resources (so corpora for example)
ok let me have a look at it
@AndrasDeak is there anything inside those?
they seem small enough that it wouldn't be able to hold any meats or veggies
I was trying to avoid directly giving him it. :p
@Withnail hey man
@Withnail go is low level programming?
@OneRaynyDay nope
otherwise I'd have answered what they're filled with when Moo asked me the same thing :P
14:29
@AndrasDeak then dumpling:spaztle :: apples:oranges
Yes, I wouldn't actually call them dumplings. I'd call them nokedli or galuska but then nobody would understand
gnocchi would be a lie but it would be less misleading I guess
It's always good to learn about different foods :) I like gnocchis actually
Nah, doing that as well as go.
considering how little european food I eat, I would consider the amount of gnocchi's I've eaten in my life to be a fair amount
'european' food...?
:D
14:32
something that isn't served in a bun
:D
I'm pretty sure nokedli and gnocchi are cognates, but as far as I know gnocchi is usually made of potatoes
jjj
jjj
@Withnail oops, sorry :) I still have a lot to learn wrt socratic approach ;)
huh, nokedli sounds similar to knedle but they dont look very similar
i'm invisible
T_T
I replied to you! @AndyK
I've eaten zero gnocchi, that I know of. I saw it in the Godfather though, I think it was, and rather want to try it
I do like potatoes
'morning cabbage
Gnocchi & a bit of pesto, balsamic vinegar
Great quick meal in about five minutes.
14:42
@jjj no, they aren't. Knedle is something like steamed bread thingies, right? Very different
@poke Same. But I'm typically an early adopter, so there's that
@Withnail ah ok. Didn't know that it was for me
lolol
Heh. I was meaning I was doing the low level assembly stuff as well as Go.
@Withnail lol. I often cry
#DryLmao
While debugging a problem, I found an SO question with the same error message as me. The OP describes how he resolved it: "I found the solution.It was because of the variables." Ah yes I see, thanks OP
Second answer is more helpful: C#'s System.Web.Reticulator crashes if you pass it a class that has two properties whose name only differs by capitalization. Indeed, my class has both SpokeCount and spokeCount, much to my shame.
14:53
good guy C# working against confusing code
The class I'm passing is an ORM entity, with SpokeCount being the property that reflects the value in the database, and spokeCount being an abstraction over that property that sanitizes away some implementation details. e.g. SpokeCount is a Decimal*, and spokeCount is an integer.
(*Reader exercise: invent a reason why this could be necessary)
I could change my design so only actual database fields may be properties, and stick the sanitization code in a utility class somewhere. But that loss of encapsulation makes design more awkward in certain critical modules.
can't you just...rename it a bit?
Sure, I could make it sanitizedSpokeCount or whatever.
Although in my actual code the verb describing the relation between the two properties is not as simple as "sanitized"
More like "converted to an integer, then sent on a second trip to the database to retrieve a suite of information, some (but not all) of which is related to spoke count"
And I can't just put that down as the name, because identifiers can't have parens in them
Making a second trip to the database is the smelly code, here. I ought to be able to simply specify a foreign key relation, and then I could do Widget.SpokeProperties.Count, which would automatically select the count field from the spoke properties table where the row is associated with the current widget.
Normally this is possible and easy, but the SpokeProperties table has a different name and composition in different environments. Any entity I define in dev will break in production.
@Kevin S-poke-count?!
DSM
DSM
One! There is one poke! Ah ah ah ah ah!
15:07
S-poke count is currently zero, since Poke has not yet mastered the SuperPoke state.
in a supersymmetric universe every poke has a superpartner called spoke <3
wim
wim
Try It Online has a Python 1 interpreter (!)
jjj
jjj
@AndrasDeak yes, something like that afaik. Nokedli looks much tastier imho :) Even though we are not so far, there is not much hungarian food here unfortunately (well beside goulash and lecso which are quite popular at polish houses I think), so probably not easy to try those
15:23
if you can get your hands on paprika you can probably cook the bulk of our cuisine
As best I can tell, if you have to authenticate a program with a service (ie postgres) there's no true "secure" way to deal with user credentials, correct?
basically, store them in an encrypted format, decrypt them when you need them, use them and then immediately reencrypt them?
jjj
jjj
@AndrasDeak maybe I should try cooking it. Some day..
@jjj Luckily SO takes some measures to avoid this problem
15:27
@jjj if you ever decide to start, chicken paprikás ("paprikash") is a simple and safe bet
Not auto-locking old questions, not closing questions that are (ostensibly) worth keeping around, letting old questions receive new interest via bounty...
it also works with pasta as well as spätzle, we often eat it with fusilli
jjj
jjj
Kevin: true but the first answer you find seemed quite close to this situation. Andras: and something more vegetarian friendly? What do you recommend?
Room 6: kitchen corner
What's a vegetarian?
jjj
jjj
:D
I guess they keep it with python 2
15:32
I only eat vegetarians
jjj
jjj
runs
E.g. cows, chickens
Mostly sweet stuff, I'm afraid. Plum dumplings (legit dumplings, potato dough filled with plums with sugar and cinnamon, rolled in bread crumbs or poppy seed) or palacsinta (crepes)
Sometimes I'm a vegetarian
But most of the time my food is vegetarian, though.
jjj
jjj
well, dont worry Im not the type who tells people what they should eat
15:34
oh and we have a grade of food somewhere between a soup and a stew, made of various veggies
beans, peas, kohlrabi, lentils, potatoes
(of course most of these go best with some non-vegetarian side, like pork stew or fried eggs)
jjj
jjj
Kohlrabi is a biennial vegetable, and is a low, stout cultivar of cabbage.
ha!
it's been a while since we did the last "all of these plants are the same species:"
rb folks
@AndrasDeak rbrb
15:40
nope
I don't see any days
3 pages of quality answers
wim
wim
aye that's it
I always get confused whether it's that one or some other one with a thousand votes
15:45
unicodesnake.sopython.com continues to be actually useful.
Every time I need to test a Unicode character, right there.
unicode character as a service
It was in response to unicodepanda.com.
cue obligatory unicode xkcd
wim
wim
is it just me or do the IRIs for these not work anymore
15:48
IRI?
https://❤️❤️❤️.ws
wim
wim
thank you, Samoa.
Ah...
punycode in action
Ouch. Had to delete an 11 vote answer stackoverflow.com/a/44350821/2336654
16:02
is anyone going to watch the congressional hearing for zuck?
@piRSquared I do believe that your answer is still valuable with those example results..
I’m going to add more to it and undelete later
@wim I'd like to pick your brain about storing credentials again. Here is my concept: there is a SECRET_KEY envvar that django is using. I can use that SECRET_KEY to do a symmetric encryption of a service credential (ie, postgres user/pass) and then store that file in a access-protected location (available only to the program's user-group). When a user/pass is needed, a helper function decrypts it, uses the credential and then reencrypts it.
does that make sense, am I overcomplicating things, or leaving a big hole open?
It makes sense to a point.
If you're going to bother encrypting things, use something like SOPs
@Withnail Ok, so you are encrypting those values.. but how are you reading them in your application then?
And where is key stored that is able to decrypt it? This feels just like relaying the problem one step to the side.
16:15
In my specific 'today' use case, they're decrypted when we launch the container (.env file)
keys are stored in aws kms
16:48
It bothers me that there's no unique present or future tense for "wrought". I can look upon a horror of my own creation and cry "what has science wrought?", but I can't think about a horror that I plan to create tomorrow and cry "what will science... Wreak? Work?" Both are arguably correct but insufficiently dramatic.
Similarly, I can't describe to my friends the steps required to construct an iron-wrought fence. "First you take some regular iron, then you work it" is ambiguous in this context. Are you shaping the metal, or are you impressing everyone on the dance floor? There are many ways to work it.
wim
wim
the encryption step is over-complicating things
you may store db user/pass in plaintext file, provided you are controlling the permission modes of the file correctly.
@wim OK, it just always worries me storing any credential in plaintext, but I see your point
17:06
Dont you normally want to use a hash on passwords like that? Or is the file permission enough when your not overly worried about security?
@Kevin time to reverse-engineer "wrough"
You might need to store the entire password and not a hash of the password if you're passing it to something that needs a password and not a hash of a password
I know more about System/360 Assembly than I know about Python
I always (like once or twice) would store only the hashed password. Never the password itself. Then anytime the password is needed you can have the user type in the password which then gets hashed and then the hashed value is used to compare to the stored value in the DB/File
@JennaSloan uuuh...welcome back?
17:12
Honestly, I don't even know how to make a "Hello World" program with Python
print("Hello World")
@JennaSloan okay?
@ZackTarr But suppose you don't want to make the user type it every time.
Why is Python named after a snake anyways?
Do you have a purpose here?
17:15
GVR was a fan of the comedy troupe, presumably
I suppose that makes sense. But why even check for the password if you are not requiring them to know the password. Let me re read what they are doing. Just curious on it all.
@AndrasDeak To learn about Python?
I'm reading the use case as: "I have a program that needs to access a third party program, which is password-protected". So they themselves are not doing credential validation to ensure the user can use their program. They're just passing it along to postgres.
@JennaSloan in that case welcome :)
we have a few tutorial links here
And they can't check postgres' database to see if postgres' hash matches some hash on the local machine, because, well, they aren't the lord and masters of postgres
17:18
Makes sense when you put it like that. I was thinking one app, not an app that needs to log into another api or something along those lines.
wim
wim
try logging into your email account using your hashed password and let us know how that works out for you
@wim I dont, it hashes what I type then compares it to the DB. At least thats what I was getting at.
Storing hashed (& salted) passwords is a great idea if you're doing validation, but this is apples and oranges to that
wim
wim
it's the email provider's responsibility to store only the hash/salt of your password (so that if they have a data breach, the hackers don't gain secret information). YOU still need to know your password.
Yep I know you need to know our password. Thats what I was getting at. I though it was for user validation of something, but the way Kevin described the program made more sense. Where it is an app logging into an app.
17:21
I think we're all on the same page now :-)
wim
wim
yep. page 10 or something.
@AndrasDeak Finally a question in the room I can handle ;)
1+1=11
Page 10 is where the good stuff is, anyway. The first nine pages of a book are usually boring parts describing the protagonist's appearance and their idyllic small-town life. Page 10 is when the glowing meteor flattens their barn.
17:25
Obviously you haven't read Lord of the Rings
I couldn't get all the way through it. Too many ten page descriptions of "and then they went down the road some more"
I liked The Hobbit though. Possibly because it was designed for children, who have underdeveloped attention spans
@Kevin Your problem was trying to read it all, instead of skimming over the pages of dwarven poetry.
Unless you live in a mine, dwarven poetry is not very interesting
I think there is only a single block of dwarvish poetry, the one about Khazad-dum
I remember skipping at least one three page long poem
Most likely elvish
yup, those can get long
17:41
I like that song about the Misty Mountain from the movie, that was a banger
Greatest Showman Blu Ray cabbage
@davidism: Why so strongly against .pyi files? Public APIs don't change that often
And heh, just found this old issue about the same thing ;) github.com/pallets/flask/issues/2012
Yeah, I was "interested", then I went and checked later and it's mostly autogenerated stuff that doesn't have any real type information and hasn't been updated.
@ThiefMaster I don't like the idea of adding twice as many files just to have some type checking that's only used by external programs. At least with the comment annotations they're right next to the code they refer to.
I don't have any particular issue with annotations in Flask, although I don't really feel a need for them right now.
But that whole comment chain is a good demonstration that no one really seems to understand how it should all be implemented.
Yeah, I think it'll be more useful once 3.5+ are the only relevant versions
I'm -1 on adding non-comment annotations until we only support 3.7+, that's when they added the future that allows treating the annotations as strings until they're actually introspected.
17:49
What was the problem with having the annotations evaluated earlier? Just slower import times?
from __future__ import annotations python.org/dev/peps/pep-0563
Yeah, they incurred a bunch of overhead because they were evaluated at import and generated a huge number of dynamic classes that hung around in memory.
00:00 - 18:0018:00 - 23:00

« first day (2733 days earlier)      last day (2440 days later) »