« first day (2439 days earlier)      last day (2523 days later) » 
01:00 - 17:0017:00 - 00:00

5:00 PM
Is anyone here a lobste.rs user? I'd like to get an invite if possible.
 
5:24 PM
So apparently nationalsecurityagency.github.io is a thing
 
lol
"Fork us. We dare you."
 
5:42 PM
Jun 6 at 19:13, by Kevin
Reminds me of that one screenshot of that text conversation that went:
A: Love you barb
A: *babe
[B is typing...]
A: Oh boy, here we go
B: WHO THE %^&* IS BARB??? I'M COMING OVER
Found it:
 
hi there
whoi has 1min to help me on something I really couldn't understand?
 
@Suisse lol that stock-photo guy
 
haha its me
 
Go on please. Maybe I can help you...
 
I am Harold
 
5:50 PM
@Suisse you've been in and out of here enough that you should know our room rules, if you don't here's the link: sopython.com/chatroom But just ask your question.
 
yes thats the problem.. its not a concrete question
but I will ask
I try to implement (its rather use a lib or api) face recognition
The problem is: I couldn't find a way to use that lib for train it on existing data ( I got 18k persons with 4-5 images of each)
I got that API from the authors article here:

https://medium.com/@ageitgey/machine-learning-is-fun-part-4-modern-face-recognition-with-deep-learning-c3cffc121d78
he describes another API, where (when you scroll down) you can use it to train on existing data
*scroll down to Step 2

Make a subfolder for each person you want to recognize. For example:
results = face_recognition.compare_faces([my_face_encoding], unknown_face_encoding)

if results[0] == True:
    print("It's a picture of me!")
else:
    print("It's not a picture of me!")
the first argument is an array - is it possible to use 18k elements in that array??
 
Sure, why wouldn't it be?
 
6:05 PM
cool
ok, than I dont have to "train" the model?
I should save the face_encodings() of 5images*18k user in the database
and when a unknown image arrives => compare that foto with all 90k images?
@davidism doesn't make sens? :(
 
I know nothing about that library or face recognition, but "is it possible to use 18k elements" has only one answer: "yes, unless you tried it and it wasn't possible".
 
Seconding "try it and see if it works"
 
true.
you know I used just now javascript (node) to rename all those images in my directory... and the programm crashed - I thought its because an object in javascript cant have 90k elements
 
> I used just now javascript (node) to rename all those images in my directory.
and now you have two problems
 
recbg
@davidism cognitive dissonance
 
6:19 PM
Still not a huge fan?:D Perhaps just campaign season ;)
 
:D
that could just be the reason :D
 
I don't get it.
 
Jun 6 at 12:33, by Antti Haapala
PSF directors election... and I know just 1 name... which is a name that I couldn't vote for...
 
the vote was on 12th, and I forgot...
 
I voted. Should have posted in the room.
 
6:21 PM
aww :(
 
and KR is in
 
Yeah, why is that bad?
 
Me, reading the list of people involved with PSF: "Ah yes, Guido Van Rossum, I think I've heard that name before"
 
well, my vote belongs to people that want to increase the adoption of Python 3, not spread fud.
 
6:22 PM
@KevinMGranger same here, but I don't expect to recognize any names, so...
 
What/when/where was he saying something wrong about Python 3?
 
um lol wat
this was used to break ties :D
 
Oh cabbage, don't bring up the break ties thing again. There was an endless discussion about it on the PSF-vote list.
 
well, I find it funny, because in Finland the law very clearly says that the tie must be broken at random. Not PRNG :D
 
2 mins ago, by davidism
What/when/where was he saying something wrong about Python 3?
 
6:26 PM
if that's his revised stance from Nov 2016... :/
 
I only just got around to revising the Flask docs to not wave a big red Flag about Python 3 around then too.
 
Idk, this seems fairly pro-3 to me.
 
If that's your reason, you've got to realize we have some many projects it's hard to keep track of. He seemed completely on board with the change.
 
"If you are writing a new open source Python library, it’s best to write it for both Python 2 and 3 simultaneously" I don't necessarily agree with that but it seems otherwise fine to me
 
@KevinMGranger FWIW if I read that, it doesn't seem to be that
 
if I were a noob (which I actually am from many standpoints), I'd gather "2.7 is useful and used everywhere, guess I should learn both so I'll learn 2.7, that's a safe bet"
 
w.r.t. libraries: "Supporting 3 only is a political statment and will alienate many of your users."
 
I generally agree. There's no reason not to support 2 as a library. It's pretty easy. Obviously if you're developing something that assumes Python 3 features that's not the same.
Despite 2020, it still has a large install base and people can start using your library before they fully switch to Py 3.
 
Frankly, I'll be surprised if ubuntu switches to python 3 in 2020. I'll google if there's any info about that
 
I guess I'm biased since the project I'm working on would be a pain in 2
 
6:32 PM
Should they use Py 2? No. Should it be supported if you want good adoption before the switch? Yes.
 
Reminds me of the article by Joel Spolsky that suggested that Microsoft was able to kill Lotus Notes only by being deeply intercompatible with it
 
Yeah p. much
 
just had a coworker ask how I learned so much about Python. coming here to be reminded how little I really know... ;)
 
Hmm, apparently ubuntu wants to/is in the process of only shipping with python 3. I wonder how this is compatible with their statement not to let /usr/bin/python point to python 3. But that I'm not going to read now
 
6:36 PM
cat /usr/bin/python
echo lolololololol
 
hmmmm
> There is no plan to make Python 3 the default /usr/bin/python. See for upstream policy on this.
link in upstream policy: PEP394, doesn't say anything about /usr/bin/python (?)
 
> Avoiding breakage of such third party scripts is the key reason this PEP recommends that python continue to refer to python2 for the time being. Until the conventions described in this PEP are more widely adopted, having python invoke python2 will remain the recommended option.
 
is this a subtlety concerning aliases?
but...what's the point of python not invoking python3 if there's no python2 on the system?
how does it break less?
am I missing something obvious? what obvious detail am I missing?
 
"no /usr/bin/python found" is a little more obvious than a random SyntaxError
 
> If the Python 2 interpreter becomes uncommon, scripts should nevertheless continue to use the python3 convention rather that just python. This will ease transition in the event that yet another major version of Python is released.
 
6:39 PM
And explicit is better than implicit
 
@KevinMGranger hmm, I guess...
@davidism thanks, I guess that makes sense too
 
They're talking about two different things. Scripts should be explicit about their version, python should be updated once 3 is actually the default.
 
I'll have to read that PEP in detail to disentangle the two
 
If you haven't read every single PEP, are you even a real python developer
 
joke's on you, I never said I was :P
 
@AndrasDeak wat?
actually /usr/bin/python: command not found
and there was this thing that if you install python2.7, it still doesn't even install the /usr/bin/python symlink...
 
I was just being pessimistic about ubuntu's progressiveness
btw my new kernel is no longer leaking memory, I'm not sure if I've noted that already
 
I am not sure if you have noted it already :D
 
6:57 PM
6 days and only 333 4k memallocations :D
 
now it's leaking 8k at a time
 
:|
(it's not :D)
 
Pyramid is nice
 
@khajvah when you realize that you can build reusable stuff on top of it it is nicer.
 
I wonder why people use Django
 
7:01 PM
the thing is, if all the flask and django stuff was built on pyramid instead, then it would be total awsum
 
@KevinMGranger (sadpanda) haha
 
I am learning Pyramid and SQLAlchemy in one go
 
the problem with django is that it gives so much out of the box - then in the end you will rewrite everything
 
With Django I felt I had no control
and flexibility
I glued together bunch of unknown packages
 
7:06 PM
@AnttiHaapala @khajvah exactly why I use django :)
 
Going through Django's tutorial I got the impression that many parts were configurable, but not necessarily all parts, and it wasn't clear to me which those parts were.
 
Of course, not for the rewrites :-p
 
no one plans for the rewrites ...
 
Yep, but it isn't that scary TBH (backing up with some exp. I have in that)
At least I am glad to live in 2017 when we do have such things, and HTML5, jQuery, bootstrap and etc. etc.
 
@AshishNitinPatil @khajvah ^ the first query ... "oh it's so advanced"
I am not using jQuery.
 
7:08 PM
Can't imagine the horrors of early 2000s...
 
I should learn another framework or two so I can get a better high-level view of the ecosystem. Which popular web framework is the most unlike Django?
 
IIRC someone good here recommended Pyramid
 
(Note: cgi doesn't count)
 
@AnttiHaapala Yeah I have seen this. ORM is terrible but what's more terrible is that you can't use anything other than it's own ORM. That's architecturally crap
@Kevin Express (Node.js)
yes, I am serious
 
well, it is most unlike :D starting from the choice of language...
but it still uses url patterns organization IIRC :P
 
7:12 PM
it's good to be familiar with async stuff
 
My past experiences with node were... Not joyful.
 
maybe Tornado?
 
I think there's a little bit of Tornado in r.a.b.b.i.t.
 
the t?
 
Or was it twisted... Something to do with rotating about an axis.
 
7:18 PM
but this async stuff is not mature enough in Python I think. I remember having trouble finding a working postgres client
 
what's with the influx of Excel file questions? What do they think, we Excel at programming?
 
@khajvah and when did you have like working postgres client for javascript? :D
 
@AnttiHaapala Postgres is for grandpas. I use webscale mongodb with JS
 
exactly
 
7:24 PM
Seeking a dupe target for Python defining function outputs only first dir. The old "Why doesn't for i in range(10): return i iterate more than once?" question
 
but no
we need another dupe that uses listcomp or so
 
anyone know if it's possible for postgres plpython to accept arbitrarily typed arguments? I can't seem to get it working using any or anyelement types
@khajvah asyncpg?
that's been around for what, a year now?
 
@WayneWerner hmmm
 
@AnttiHaapala suggested video:
> Should I Learn Flask or Django? Techy Help 29,753 views
 
I guess you mean: "plpython3u"
:D
 
7:32 PM
I'm sure it's a real informative 2-minute video
 
"Functions coded in procedural languages can use pseudo-types only as allowed by their implementation languages. At present most procedural languages forbid use of a pseudo-type as an argument type, and allow only void and record as a result type (plus trigger or event_trigger when the function is used as a trigger or event trigger). Some also support polymorphic functions using the types anyelement, anyarray, anynonarray, anyenum, and anyrange."
 
@WayneWerner Dunno. I tried something else but failed. Don't remember the exact one
 
<table cellpadding="0" cellspacing="0" border="0">
<tbody><tr>
<th class="searchResults" style="width:75px">View<br>Form</th>
<th class="searchResults" style="width:150px">Application<br>Type</th>
<th class="searchResults" style="width:120px">Confirmation<br>Number</th>
<th class="searchResults" style="width:75px">Reference<br>Number</th>
<th class="searchResults" style="width:95px">Filing<br>Date</th>
<th class="searchResults" style="width:60px">Exhibits</th>
</tr>
</tbody></table>
 
How would python not accept anyelement? /grumpy
 
What can I do to get the text out of it with xpath
 
7:35 PM
> ERROR: PL/Python functions cannot accept type anyelement
 
DSM
"the text" is a little non-specific.
 
@AnttiHaapala the "it's awesome for basic things but hard things are generally not possible to do" starts to give sense to your remarks about django. What if you're using it the easy way and it works nicely, and after a while you need to do something hard and can't? Then you're yammed.
 
Fo' real? Python don't care what type it is!
 
@DSM ['View Form', 'Application Type', ...]
 
@WayneWerner if it doesn't work, remember that you can also overload the name
 
7:38 PM
I don't want to do that for every type :P
I guess maybe I'll just make it take JSON
 
so what will happen then?
what are you attempting to do
 
I have some key/value pairs in a JSON column that I want to translate/update
 
json is json :D
though...
 
specifically we've got 'status': 'I' (or 'N', 'S', 'A')
I want to expand those
 
all that json will be mapped to strings
so perhaps easier just in plpgsql or sql
also remember to use jsonb :D
ah this needs 9.6
 
7:42 PM
yeah I'm on 9.4 :P
Newer versions I'm pretty sure have the bells and whistles I'd need to do what I want relatively easily
 
jsonb_set(target jsonb, path text[], new_value jsonb[, create_missing boolean])
you really should upgrade :D
like... really really...
 
yeah, the other PG guy doesn't like to upgrade until like the next patch version is out or something? I guess PG often has data corruption issues within like 6 months or so
for certain kinds of workloads
that look just like ours
 
so you could use something like update foo set bar = jsonb_set(bar, '{my, key}', '{"I": "inactive"}'->>(bar->>'my'->>'key'))
postgresql 10 is in beta
you should have upgraded to 9.5 already.
"often has corruption issues" -> there was one corruption issue in a decade...
 
Hm. He posted some article about one a few months back shrugs
 
@WayneWerner btw, if you use linux and LVM, use LVM thin partitions with pg_migrate...
you can practice the migrate as many times as you want...
we have a 100G cluster and it took like 30 seconds to upgrade :D
 
7:51 PM
if i asked you to name an herb/spice, what's the first thing that comes to mind?
 
thyme
 
KFC
 
thyme was first, but then thai basil
the 3rd is fresh dill on early-season potatoes...
 
melange
The Spice Must Flow
 
If we change the question to "what's the first herb/spice that comes to mind?", probably the eponymous ones from Parsley, Sage, Rosemary and Thyme in title order
 
8:02 PM
1
Q: Extract list from html with xpath, with linebreaks

HatshepsutHow can I extract ['First one', 'Second two', 'Third'] from this with xpath? s = """ <table cellpadding="0" cellspacing="0" border="0"> <tbody><tr> <th class="searchResults" style="width:75px">First<br>one</th> <th class="searchResults" style="width:150px">Second<br>two</th> <th class="sear...

@DSM thats what i mean
 
8:16 PM
which is the better bean image (to represent legumes in general) i.imgur.com/c04kY3m.png
 
Multicolored one.
 
DSM
@Hatshepsut: oddly enough I can't seem to get at the complete content the way I was expecting. You could do something like
In [121]: [' '.join(x.itertext()) for x in tree.xpath('.//th[@class="searchResults"]')]
Out[121]:
['View Form',
 'Application Type',
 'Confirmation Number',
 'Reference Number',
 'Filing Date',
 'Exhibits']
but that's not actually any better than manually hacking <br> yourself anyhow.
 
Please don't post recent questions in the room (or indirectly ask the same question).
 
DSM
Hopefully someone who works with lxml more frequently will have a slick answer.
@davidism: I think the Q here actually preceded the question on the main site, FWIW.
 
I played around with it for three minutes and I couldn't get any xpath expression to give me anything other than [] or Invalid expression. I think my thing is broken.
 
8:28 PM
what's a good open-ended technical interview question?
 
"Your coworker always chooses Hanzo regardless of the composition of the rest of the team. How do you deal with this problem?"
 
Here is a question: when inserting a new row to the db which is caused by a post request, I check if the request format is alright and handle errors easily. But how to handle database errors such as "DETAIL: Key (creator)=(2) is not present in table "users"."?
I don't want to make a query before inserting to check if foreign keys exist
 
DSM
Things that annoy me: documents which pretend to be xml but are, in fact, not.
 
wim
things that annoy me: *xml*
 
I'm annoyed that there isn't a builtin module that can parse the informal category of text snippets which look like html but aren't quite html because they don't start with an <html> tag because the author decided that wasn't necessary for the mcve
Alternatively, if such a module exists, I'm annoyed that it wasn't advertised to me sufficiently.
 
8:41 PM
@khajvah What's the question asking? Handling errors when inserting based on some potentially non-existent key, but without querying the schema info table (or something) to check if the key exists first?
 
@MarcusS The error message from the exception includes a lot of info but I don't want to send that back to the API callers. I want to inform the caller which field caused the error
 
@Kevin you pick Mei and freeze wall in front of said co worker.
 
from the exception, I just know it's IntegrityError.
 
is it just my imagination or does lxml only support a small subset of xpath queries
can't quite tell if I'm getting so many "invalid query" errors because lxml doesn't support them or because I've never used xpath before
 
8:56 PM
@MarcusS I'd stick to "naturalish" bean colours :D
 
they are natural bean colors, though -- at least, based on something like cookingbites.com/attachments/pulses-jpg.1145
 
the purple does look a bit odd :D
well, it is close to purple speckled kidney bean...
so yeah, maybe
 
What about a darker bean? i.imgur.com/NWU8ZmO.png
 
9:14 PM
@Kevin do you play overwatch, or have you merely absorbed the essence of its memes?
 
link b0rken
 
9:41 PM
@MarcusS oh oh oh we could totally use your app for salad-based steganography
 
i know each of those words, but not in conjunction @_@
 
then again you knew the words
 
 
2 hours later…
11:31 PM
Whenever I write an answer that touches upon a topic that's related to some sort of obscure python intricacy, there's always someone in the comments pointing out "hey, technically this part of your answer is wrong". As if someone who just asked how to move their class into a different file really needs to know about how metaclasses work and that classes are technically instances of type
 
01:00 - 17:0017:00 - 00:00

« first day (2439 days earlier)      last day (2523 days later) »