« first day (2866 days earlier)      last day (2082 days later) » 

12:00 AM
@AndrasDeak...it's a long time
 
I guess
 
Do you know some libs supported microservices architecture in python?
 
nope
 
I'm trying to find which module is faster to do parallel work?
Does someone think this (https://pastebin.com/up06xPNR) is a good way to check which parallel module is faster in python?: The test is between multithreading, multiprocessing.Process+Queue, multiprocessing.Process+Manager.Queue, multiprocessing.Process+Pipe, multiprocessing.Pool map, multiprocessing.Pool map asyinc
 
"multithreading" == threading, yes?
@EnderLook that is riddled with bugs and NameErrors
 
12:14 AM
@AndrasDeak Yes... sorry
@AndrasDeak In my pc it works
 
we must have a different version of python because mine doesn't have ranage installed ;)
 
@AndrasDeak XD! My pc doesn't raise the error! Maybe because the error is under a thread/process?
 
@EnderLook if you want people to try your code, you need to make sure it will run. Paste the code you posted a link to in an interpreter and try to run it.
 
Perhaps timeit suppresses it... I didn't read all that very thoroughly to be honest
 
@AaronHall I've run the code but it doesn't raise the error....
 
12:19 AM
go a function at a time and call the function.
also, I don't think timeit can work like that
You need to pass it something to call or a string that calls the function.
It won't call the eval'd string
 
that probably explains the lack of errors
 
I prefer to pass a no-argument callable.
The docs should mention that usage but they don't.
@EnderLook when it comes to parallel Python, you should go for the simplest implementation that matches your use-case.
(I should probably stop tapping on my keyboard...)
 
@AaronHall I would prefer to look for the faster implementation because my code will do some stressful work that takes time. Anyway, my family has just call me to have dinner so I must go, bye!
 
Enjoy your dinner!
 
1:10 AM
cabbage
 
cbg
 
I'd appreciate any feedback for my first numpy answer:
https://stackoverflow.com/questions/51940264/propagate-calculation-result/51940321#51940321. Is my assessment accurate? Am I missing anything from my very noobish point of view?
 
In fact, that may be a dupe of the question I linked
my 2 cents
 
@Code-Apprentice unless unrolling the recursion lets one vectorize
Turning it into the cumsum of 0.1**np.arange(...)*a[...] or something
But definitely an adequate response
 
1:29 AM
There's now an answer with that
 
@AndrasDeak thanks for taking a look
 
No worries
 
1:48 AM
cbg
 
2:42 AM
cbg
 
3:03 AM
cbg
 
cbg
not really sure what this guys point was stackoverflow.com/q/51932428/2336654
I feel like he wanted to explore some efficient methodologies but in several of the approaches he introduces unnecessary overhead.
anyway... On to more important topics: I'm trying to set up an asynch/await process for running many (200 ish) queries to a remote database. I'm referencing this link medium.freecodecamp.org/…. Anyone know of a clearer reference for me to be reading.
 
3:24 AM
@piRSquared are you still using AWS?
 
@piRSquared The OP's original premise or his benchmarks answer? Anyway even though the OP's premise was mistaken, the question is useful and the huge variation in performances is eye-opening.
 
3:56 AM
@user3483203 nah, not right now. I might pick it up again. This is a work project dealing with in house a database.
 
4:10 AM
Ah, was going to say AWS has some great builtin tools for handling asynchronous data between apps :)
 
 
2 hours later…
6:20 AM
Cabbage
 
cbg
 
7:07 AM
hi, a problem. I'd want to generate a "request id" that would be as short as possible (sorry no guid) and as uniqueishis as possible. Problem: several computers and it could be unique among all, but clashes could be allowed; however, it should be forever unique on the single machine.
ideas :?
 
@AnttiHaapala I think I have a viable solution. How short is short? Why no GUID? Do you mean that each machine needs to be able to generate an ID that's definitely unique on that machine but which might possibly collide with an ID generated on another machine?
 
sth like that
@PM2Ring I need to put this and other info into postgresql setting application_name which is 63 chars max
 
chars -> ascii?
 
bytes
>>> len(str(uuid.uuid4()))
36
so no :P
well, for now I will use systemrandom for randrange(0, 2**64), hexified.
or perhaps base32
>>> base64.b32encode(os.urandom(10))
b'PVULMKBPT2OZJEGK'
hmm that's not bad actaully :P
it is better than a 8 byte hex for shure
for same length
easy to copy paste as doubleclicking with mouse would work everywhere...
 
7:23 AM
@AnttiHaapala Ok. You can use what's known as format-preserving encryption. Basically, it gives you a way to index into a larger shuffled sequence without holding the sequence in memory. So each time you need a new ID you just increment a counter, use that as your index into the shuffled sequence.
I posted an answer that does this stuff a month ago: Iteratively generating a permutation of natural numbers
 
then would need a way to find good seed :P
ip|pid|whatever...
though I think 2**80 is enough for me even if randomized
 
True, but that shouldn't be a problem. Even changing a single bit of the seed in my code makes a big difference in the outcome. Seeds to random.seed can be very long integers, strings, or bytes, and Mersenne Twister can use lots of bits in its seed. For my code, I recommend at least 128 bits of entropy in your seeds.
BTW, that code is most efficient if the sequence length is a power of 4. If you can guarantee that, then it's possible to optimize the code a little.
Another option, if you could use 128 bit IDs is to simply run a salt + counter through AES. But that's not much good if 128 bits is too big.
 
8:26 AM
ahh :D
 
 
2 hours later…
10:05 AM
Hello Is there anyone who can help me with tensorfllow?
 
 
1 hour later…
11:14 AM
hmm
if I've got comma separated key-value pairs like app=foo,client=bar
like app=foo,client=bar
what would I use as a separator in the app
got multiple words in there
 
@AnttiHaapala Maybe use one of the more obscure control chars that's unlikely to clash with a char in your value string, eg vertical tab \v.
 
11:40 AM
:D
 
something easy to notice, like a rtl mark
 
12:24 PM
Also use commas, but percent-encode them. </half serious>
 
last resort: use %SEPERATOR%
damn, s/SEPERATOR/SEPARATOR/
I mean, the typo just makes it more resistant against accidental matches. It was all planned
 
like, I could use an underscore or... sth else...
hmm @IljaEverilä is at 19904 rep :P
 
12:42 PM
now now, no serial voting :P
 
store data as a 2d array, then serialize it with the csv module
 
12:53 PM
Hmm, my Spline.reticulate() code assumes that Spline.payload is always a string, but I've got one here whose payload is a list of Splines. Am I going to have to solve some graph problems today?
 
just call str() on whatever comes in :+1:
 
("But Kevin, I thought all of your work problems were actually thinly-disguised C#. How could you possibly have an attribute that's two different types?" This just happens to be the 0.01% of the codebase that's actually in Python.)
@AndrasDeak I mean... I could. The payload is only used for diagnostic purposes. (for now)
 
UnTypeC#, the esoteric counterpart of TypeScript
By the way, either your Spline class is ill-defined or your standard analogy is starting to break down
 
Would someone edit the python and flask tags onto this question: stackoverflow.com/questions/51937268/…. Need to close as duplicate.
 
done
 
12:59 PM
thanks
 
Well? :D
 
Ok, in this case I can reveal the actual business logic. By "Spline" I mean email.message.Message. The code that calls get_payload assumed that the return value is always a string, but it didn't account for multipart emails, where the return value is a list of Messages.
 
(no response whatsoever in 17 hours so there's no rush, really)
 
Yes, I know that the behavior is described right there in the documentation. Zero points for pointing that out to me.
 
Of course now I can't find the dupe target I was sure existed. I think it was a GitHub issue instead of a SO question.
 
1:03 PM
:(
then again now that it's tagged perhaps it'll get more eyes on it
@Kevin I take it it's a bit more complicated than ''.join(messages) ;)
@davidism but then you should answer it
 
Only a little more complicated. It's not a hard problem now that I know what the old approach was lacking.
 
if concatenation is feasible then it doesn't sound all that bad
 
brief cbg
 
[Six stack traces later...] ok, not a hard problem in theory.
I never could get the hang of Tuesdays...
Ok, seventh time's the charm. Now I can actually work on the bug that this bug was hiding.
 
\o meeting cbg
 
1:18 PM
@MooingRawr o\
 
1:37 PM
cbg all
 
My-laptop-charger-said-pop recbg
 
Generally speaking what's the convention with keyword only arguments?
 
how do you mean?
 
there is a pep on keyword only arguments: I think 570
 
To avoid XY problem potential, I'm modifying a function that trains a TensorFlow model. On the completion of each training loop I want to provide the ability for a callback function to be called to report progress. In this situation I'm thinking that I want that callback to be keyword arg only
The function looks like this:

def train(self, early_stopping_steps: int = 10, min_epochs: int = 30,
max_valid_ler: float = 1.0, max_train_ler: float = 0.3,
max_epochs: int = 100, restore_model_path: Optional[str]=None) -> None
I don't want to have any ability for confusion with the optional parameter
But I'm wondering if that's a situation that would make more sense to just be keyword only?
 
1:45 PM
Hello all. Can someone recommend free video course, short and to the point? Thank you!
 
I was wrong it was PEP 3102
 
Welcome Anna, video course of what? General Python or something more specific ?
 
General python, for beginner.
 
@JonClements Hopefully this helps explain, I'm having trouble thinking of words to explain what's bothering me here unfortunately
@JGreenwell I was reading this just before python.org/dev/peps/pep-3102
 
@shuttle87 how optional are those options and how much do you expect them to be changed in a call?
 
1:52 PM
Hopefully only the one with the type annotation of Optional is optional
 
then why default them?
 
Not sure why the original author did this, I'm trying to clean this up now
But if they are optional then they have to be supplied in order right now which seems, not right?
 
sorry Anna, but I don't know of such videos, we do however have some recommended tutorials that you could read
 
@shuttle87 there's nothing stopping someone explicitly passing max_epochs=whatever in the call
it's whether you want them to have to do so...
 
Just looked through the docs and all of them are supposed to be optional, so I guess the type annotations threw me off here.
 
1:57 PM
seems you've been struggling lately with this library...this wouldn't be your first question related to it :)
 
yeah, hadn't really used mypy before and it for some reason mypy seems to confuse me frequently
but I'm good to go again here!
Thanks for helping
 
MooingRawr
Thank you, I will look into them.
 
^^^ /me almost has his paws being able to play that again...
doesn't help that 1.5 mins in I start getting a little bit of cramp... guess that's just unfamiliar exercise for the paws these days...
 
that's some serious piano skills if you are able to play that
 
played piano for 20-ish years... just haven't in the last 10 or so... so... getting back is a little tricky when out of practice...
 
2:11 PM
Just like riding a bike with 96 pedals
 
heh :)
fingers just are too use to typing on keys on a keyboard than pressing keys for a joanna :p
 
mornin'
 
@idjaw o\
 
~@TaluyBaatar Are you getting an error when you type in python --version in your prompt? ~
 
2:26 PM
@idjaw darn it cap'n - you're either hiding 'em well or not stocking my favourite cookies any more :*(
 
@JonClements so what you are saying is that if we hook the piano keys to the standard computer keyboard you would be on fire :D ?
 
@JonClements Blame Costco. They changed the brand.
 
@MooingRawr nope... I'd be on fire when the cap'n finally realises I'm nicking his coffee and he throws petrol over me and lights a match :p
 
No. Messing with my coffee doesn't let you off the hook that easy.
 
sips his tea
 
2:31 PM
Hey...Hey!! Tea guy. I see you.
whispers which tea are you sipping?
 
Did Kevin finish the tea cannon while we were out?
 
@davidism the LOTC is still pending AFAIK... along with the colonisation of Mars etc...
just doesn't have his priorities right that guy :p
 
Too blinded by the stars to look at low orbit.
 
Are you still allowed to participate in the GM if you have a splitting hangover?
 
2:38 PM
@davidism I'm letting him off as it's very difficult to get a few grams of anti-matter for the fuel cells...
 
@idjaw Twillings English Breakfast (drop of milk)
 
@coldspeed just turn the brightness down on your monitor and you should be fine :)
 
@JGreenwell sage tea is my power animal
this is the closest thing I can find -> yasalamcooking.com/bedouin-sage-tea
But I usually go much simpler most of the time and just have the black tea and sage with a little bit of sugar
so tasty
 
Speaking of Twinings: here's the Earl Grey Tea Song by Enda Kenny.
 
I can't figure out the pleasure that some derive from sitting down and sipping a cup of scalding coloured water
 
2:49 PM
because it is not just coloured water
 
^^^ /gasp
 
yes, like I said, it's scalding coloured water
 
and you're wrong.
but you do you bro
 
I usually go for a french vanilla. I'm more of a coffee person
 
2:51 PM
@coldspeed meh, it's just because you'd prefer it cold. get up to speed, hot it's better.
 
and if you think tea is just coloured water then you are not having tea and doing tea wrong
straight up
 
I used to drink tea a lot more when I lived in a cold environment
granted, now I drink it when pollen counts are high
 
technically tea isn't supposed to be drunk with sugar anyway, so I suppose I'm not the only one doing it wrong :p
 
For myself it's cultural upgringing for the different teas that I have.
 
2:53 PM
heat is useful for both of those
 
@coldspeed Says who?
 
when you put it like that, it's probably also cultural upbringing that I prefer coffee.
 
I can't stand tea nor coffee. I tried to get into tea a while ago, couldn't get used to it.
cbg btw
 
the tea from my culture always called for sugar to taste depending on which tea
 
@user3483203 cbg
 
2:55 PM
specifically the sage tea I have you would add a little sugar to taste.
 
earl grey, lavender, etc are apparently supposed to be drunk without sugar, or so I've heard
 
I grew up on sassafras tea but now its apparently posionous
 
@coldspeed and apparently coffee purists donèt want milk and sugar, but it gets added in and those teas yeah sure...but people also put milk in it too.
 
Humans run on poison. Have you ever seen what oxygen does to metal? And we breathe that stuff.
 
But, for myself specifically, the teas I was brought up with weren't any of those
 
2:57 PM
okay, to set the record straight I love milk tea. It's the other stuff I don't like
the so-called "real teas"
 
ok
 
sugar (or honey), cream (or milk), and lemon are all acceptable but with tea I just like cream/milk
 
I skip tea and just drink milk directly
 
Hardcore
 
milk + honey is my extra indulgent sore throat treatment
 
3:03 PM
we are incapable of matching the Kevin efficiency
 
milk + honey + Scotch is mine :)
 
Eric Clapton, singing a nice rendition of the Robert Johnson song Malted Milk
 
Drinking milk straight from the carton is the penultimate efficient beverage, second only to guzzling water from the garden hose
Dishes to wash: 0. Things to recycle: one jug per ~10 drinks.
 
Imagine that, here, we drink the milk directly from the bag
 
@Kevin The efficiency of drinking out of the carton is negated by the ten minute lecture you get from the wife post-facto
 
3:08 PM
awww it didn't do the thing
 
@JGreenwell hey that... sounds much better than I'd assumed
 
hot toddy (toddie?)
 
hot toddy
and it's magical
@FélixGagnon-Grenier you can easily get one at any Irish-type pub here :)
I've ordered it a few times
 
nice
is it legal to have that in the morning, or is it frown-inducing?
(not that I relish inducing frowns, mind you)
 
that's a good question, but I think the main "reason" for that drink is when you're feeling under the weather
 
3:12 PM
sometimes I question why I go through the trouble. /sigh stackoverflow.com/a/51951239/2336654
 
... that moment when I'm super excited about finding the function in pyramid docs that would do all I need and more, but realize folks from whom we derive the project have a too old version requirement.
 
@piRSquared There is an unfinished sentence at the end of your answer
 
Thank you
 
@FélixGagnon-Grenier Time to give a passive aggressive "our <stuff> is too old" message
:P
 
@idjaw :) yes indeed! I mean, I think there's a solid call for it. In 1.8 they added the add_view_exception, arround the lack of which we do all manner of dorsal acrobatics to have a sane, testable api.
 
3:18 PM
If your argument sides with improving testing, stability and automation for better feedback and bug resolution...you should be able to have a winning argument here.
I hope.... :)
 
as the meeting draws closer, my hunger level rises :\
 
@piRSquared It is a little disheartening when that happens. The OP may not appreciate your explanation, but hopefully the future readers will. Sometimes I look at the OP's profile before I answer, to see what their past acceptance rate is like, and to gauge if they just want some code to cargo-cult, or whether they look like they actually want to learn.
 
morning cbg
 
rb folks
 
3:36 PM
peace
 
new-charger-and-battery recbg
 
3:59 PM
:D
 

« first day (2866 days earlier)      last day (2082 days later) »