« first day (3236 days earlier)      last day (1727 days later) » 
03:00 - 16:0016:00 - 23:00

3:11 AM
@AaronHall Laurel
cbg
 
@U10-Forward I don't do "salad", but what's up?
 
@me hello what's up
Ya told me to do so :P
 
yes - if you want to talk, been doing anything interesting with Python lately?
 
3:27 AM
Not really :P
 
@U10-Forward I caught some Python talks earlier today.
 
Cool.
 
One was talking about running things with wasm in browsers and mentioned Pyodide github.com/iodide-project/pyodide
 
Wow that seems like a cool little module
 
cbg patch
so im seeing some weird things as imtrying out the pytorch tuts
AttributeError: 'Tensor' object has no attribute 'randn_like'
even though the tut (which seems to match my version) uses that function im not seeing
 
3:39 AM
@Skyler flakey tuts are nothing new.
If you're trying one and it's not working out, consider moving on to a new one, don't block on it.
 
cbg
what is the name of the color codes used by tkinter? it is a string that starts with # followed by 3-6-9 chars expressing RGB in hex
 
I think it's called hex
hexcolor
@ReblochonMasque I think it's called Hex triplet
 
3:56 AM
yes, thanks - I think that is it: en.wikipedia.org/wiki/Web_colors
 
@ReblochonMasque Eek same link from where i got that :P
 
 
1 hour later…
5:07 AM
How I can iterate over a container in reverse order using in?
 
Like a in reversed(b)?
 
yes
 
6:09 AM
@ReblochonMasque thanks :)
 
7:01 AM
cbg
 
7:24 AM
Q: "How do I write `subprocess.Popen('if [ foo ] then bar; fi', shell=True)` without `shell=True`?"
A: "Use `subprocess.Popen(['bash', '-c', 'if [ foo ] then bar; fi')`"
Me: *facedesk*
 
Well it's without shell=True....
 
8:00 AM
Hello, any tips on how can I test if a HTTP is being done?
 
a HTTP request?
 
Either send the request to your own server or use a packet sniffer I guess
 
After a function is executed it will need to do some HTTP requests to external services. I'd like to create tests for this.
 
ah
 
8:04 AM
Yeah, I meant creating tests
 
In that case, mock the relevant network code
Not going into details because I have no first-hand experience with that kind of stuff
 
That's what I thought, thanks for the tip
 
Hi, any number of times I re-run this code, the number of process ids printed are completely ordered(e.g 455,456,457,458,etc...). Is there something I don't understand correctly about this?
from multiprocessing import Process
import os

def func_to_distribute(num1,num2):
    print(os.getpid())
    print(f"{num1} times {num2} is:", num1*num2)

if __name__ == "__main__":
    for a in range(10):
        for b in range(10):
            p = Process(target=func_to_distribute,args=(a,b))
            p.start()
 
Since you're starting the processes one after another, it shouldn't be a big surprise if they print their output in order
Starting a process takes time; I imagine the first process is already finished by the time the 2nd one starts up...
 
The overhead of starting all those processes most likely also dwarfs the time taken for the task
 
8:17 AM
So if I'm understanding you correctly, if the function did something heavier then they might have printed unordered?
 
yes
 
thank you both
 
When I started Python, I couldn't get my head around why people weren't using multiprocessing all the time. I've since found that it's only useful in a handful of cases and I can't remember the last time I directly used it
 
@roganjosh Do you mean you use multithreading or you use neither? I just read an answer on the SO that explained why multiprocessing is usually faster than multithreading specifically in Python.
 
Neither. For CPU-bound tasks, threading will be no help
 
8:24 AM
i have a dict whose values are list
example
{'a':['a123-10','a456-10,'a789-10'], 'b':['b456-10','b123-10,'b789-10']
}
I need to sort it like
{'a':['a123-10','a456-10,'a789-10'], 'b':['b123-10','b456-10,'b789-10']}
 
multiprocessing will be faster for large CPU-bound tasks that can be sensibly divided up
 
@anky_91 why delete it? It was correct I think
 
yes it looked correct
 
@pythonRcpp newdict = {key:sorted(val) for key,val in dict.items()}
 
i should have asked the try code first :)
 
8:32 AM
@anky_91 Oh...
 
never mind
 
actually i was tring this before sorted(d.values())
but it was not giving me sorted op
 
How did this question get 2 upvotes, im confused.. stackoverflow.com/questions/57654372/…
 
cbg guys o/
So we are generating some statistics report in HTML. The generated report size sometimes goes to more than 1GB(It's expected). What I want is to compress these HTML statistics data in order to avoid occupying too much memory. What is the recommended method in Python3 ?
@Erfan Closed now!
 
8:47 AM
Yes I see, thanks. I always try to help new users to understand what a good question requires, don;t want to scare them away @TheLittleNaruto
 
Why does a report have more than 1GB worth of data in it?
Wouldn't the HTML be a summary and you can serve the raw data another way, like a csv file to download or something?
 
Was expecting this question lol that's why I had mentioned : (It's expected) . But since you asked let me tell
The statistics has data of individual user, for each individual user we are generating one .js file which is easy to load on html. Of course our next target is to improve the approach. But for now we will keep it this way.
 
Ok. I'm not sure I follow why this is the set approach, but I'm not familiar with compression in this instance so I'd only be guessing sorry
 
honest reply! No problem thanks
 
9:07 AM
@Erfan Now it's -1
 
It was upvoted for the freehand numbers, surely
I know they've brightened my morning at least :)
One of the "fun" aspects of working at a factory - there's no concept of Bank Holidays. I've now had 4 phonecalls, starting from 7am :/
 
9:22 AM
Is there also a tag for reopen ?
Just like cv-pls
 
It should work in the same way. [tag:reopen-pls]
 
He actually put effort into reading the links we provided and improved his question stackoverflow.com/questions/57654372/…
Thanks @roganjosh
 
It's open now.
 
Thanks
 
9:44 AM
@AndrasDeak many moons ago, I remember you telling me to use the cv-pls tag correctly because some people were doing some kind of automation to follow that tag. Do you happen to know what that is, or whether it still happens?
You also invited me into a chat room bombarded with bots throwing in questions, with a queen bee bot. I'm guessing it was that?
 
@roganjosh it usually happens in SOCVR. But people get conditioned to look at cv-pls requests, it's easier for them to stand out in chat. And yes, there's SOBotics where Queen can ping you with dupes if you want. But cv-plses go in language-related rooms or SOCVR
 
Ah, makes sense, thanks. I wondered whether there are stats being produced that might be incorporated into the 3-cv analysis
 
That would be an official, internal effort, SO will not rely on any kind of community-gathered data.
 
True, but the flip side is interesting; does the community have any data on this experiment that might be on-hand to counter any claims if the SO analysis goes south?
 
How could an analysis go south?
 
9:52 AM
"It made people more unwelcoming"
 
There's nothing to do about that if it happens. If SO wants to change or not change something based on their own assessments no amount of community feedback will sway them.
 
Also, if you were questioning the expression (were you?), maybe it's a local phrase kinda like "goes down hill"
 
yeah, I understood, thanks
 
10:20 AM
Do you guys have any advice on how to go from a good programmer to a great one. I fell like I've hit a wall - do you know any online resources?
 
Do you have a project that you're working on?
 
How about StackOverflow :)
 
If you don't have an active project I think you'll come unstuck by just reading tutorials
 
I'm working on a program for my dad using tkinter, but it's gotten to a point now where I just need to do the graphics
 
Anything you want to build outside of that then? I can't tell you what will make you a great programmer because I'm not sure I'm close to that mark, but I do know that my projects are what keep driving my learning
 
10:25 AM
yeah. I have a few ideas, but they mostly require languages like C# and html. I'm just scared about learning a new language before I've mastered python - I've been waiting to master python before starting a new language up until now, and I think it's really holding me back
 
You'll find concepts from languages carry over without issues honestly. And you'll also find that "mastering" a language becomes an increasingly vague and deep rabbit hole, with no real end.
So frankly, don't fuss too much about it. Do things you like.
 
Well, HTML is just a google-fest "is it none, false or off I have to use here?". At least that's my experience of it. So the HTML side you'll get through without too much knowledge building
 
awesome, thanks
 
Just try to focus that different things can be idiomatic or an anti-pattern depending on the language. Try to write each language well and not just correctly.
 
@jack.py FWIW I used to follow sentdex's tutorials when I was starting out. His code actually isn't that great once you have a footing to be able to evaluate it, but his projects are still pretty cool and span a huge range of things. It might give you some inspiration.
 
10:40 AM
Awesome, I'm aware of sentdex, but I haven't ever really watched him. I'll check him out
 
meh sentdex
 
You gotta give it to him, though. Big YouTube channel, a vast array of projects that you can actually follow to completion and a side business for investment
Doing better than me, whatever I think of the code quality :P
 
11:01 AM
@jack.py it is highly unlikely that you will ever "master" Python - more likely than C++, but there is a lot under the hood and the ecosystem grows quickly
just start experimenting with other languages
it is much more important to learn the non-language skills - design patterns, coding best practices like TTD, language paradigms such as functional, etc.
if you want to learn another language fast, I recommend building your own LISP: norvig.com/lispy.html
 
cbg, all, bugrit
@ParitoshSingh True, that. Been a Python user nearly 25 years now, and I'm still learning.
Of course, that could just mean I'm a bit slow.
And yes, having an end goal in mind will usually motivate your learning rather better than a vague, though creditable, desire to "improve."
Ultimately the measure of success is "Can I do what I want in this language?" Without anything you want to do, what's your metric?
Just my probably simplistic take.
 
11:25 AM
@holdenweb or maybe that's just the sign of a great programmer. Being on the right side of the Dunning-Kruger spectrum and realising that true understanding is basically impossible :)
 
Suffering imposter syndrome as I do, how would I know :P ?
 
:P
 
@holdenweb That's pretty funny I was thinking that very thing the other day. And thought I was maybe slipping into the latter :(
 
Hi, I have a json file that contains some characters such as 'Å‚' which in the file is represented by \u0142.
When read the file into a dictionary the string containing the \u0142 is of type string and when I am trying to write it to another file I get the error: 'charmap' codec can't encode character '\u0142' in position 71: character maps to <undefined>. Anyone got any idea what I might need to do to fix this
 
Please can you give us a MCVE?
 
11:31 AM
I think you need to specify an encoding the supports that symbol, when opening the file. Something like open(path, 'w', encoding='utf-8'), however I can't reproduce your error to check if this is right.
 
@Peilonrayz I'll try that now, if not I'll send an MCVE
@Peilonrayz Perfect! That fixed it thank you :)
 
No problem :)
 
stackoverflow.com/a/12271569/146073 would suggest that the data are valid, so @Peilonrayz would seem to be spot on.
 
Hungry cbg
 
*Hungary
 
That too: I'm having paprikás csirke ("chicken paprikash" in the West) for lunch
 
nice, sounds delicious
you guys really like paprika, right?
 
12:13 PM
traditionally yes
Gulyás and pörkölt and paprikás csirke are pretty fundamental and they all need paprika
 
I am aware of the existence of paprika but I don't think I could tell you a single thing about it. Other than "it appears on the children's show Blues Clues as the offspring of the Salt and Pepper characters"
If mandelian mendelian genetics applies to talking spice containers, I would expect paprika to be gray. Is it gray?
 
There's not much to it. "Paprika" really means "pepper as in bell pepper", and paprika the spice is just ground dried red paprika (of a given kind)
 
I guess paprika can be red if Salt and Pepper both have recessive red genes
 
@Kevin Mendelian ;)
 
Names are hard. I mispronounced "Euler" for like fifteen years.
 
12:23 PM
You-ler?
 
Yeah.
 
Yup, I thought that for ages.
 
I was stunned when I first heard that :D Strong German roots here.
 
By extension I must assume that Euclid is pronounced "OY-clid"
 
12:25 PM
No, but he'd have called Euler "yooler" too, putting us in good company.
 
Still nothing compared to Huygens
 
@Kevin if in doubt - just use "Bob"? Keeps things simple... :p
 
In related news, the internet is the best.
@JonClements Leo perhaps ;)
OK, time for pasta
 
Interesting that Atlassian (BitBucket) have bitten the bullet and decided to stop supporting Mercurial. IIRC they started out as Mercurial-only.
 
@holdenweb ooo... wasn't aware of that...
 
12:32 PM
Which, the dropping or the original choice?
 
the dropping
 
It was linked here earlier
 
A customer uses BitBucket and I was just reviewing some code, this pop-up told me.
 
Just another piece of evidence showing that any file you store online could be deleted against your wishes when the host decides to pivot to a different tech stack
 
bitbucket.org/blog/sunsetting-mercurial-support-in-bitbucket confirms they were Mercurial-only at the start.
@Kevin Well maybe, though Hg -> git is by no means the worst transition.
 
12:35 PM
@AndrasDeak pffft... you expect me to read stuff that goes on here...? :p
@holdenweb think I'd rather that than Microsoft Source Safe to CVS :)
 
cbg again guys o/
 
A firmer conclusion is that vendors will drop unprofitable services, making their customers pay conversion costs to save them the cost of support.
@JonClements Pretty sure I'd rather start from scratch than try and drag a history out of VSS.
 
I'm confident that any active user of the site can port over whatever they need. What I'm worried about are the abandonware repositories that are owned by DenverCoder9, who hasn't logged in since 2010.
 
Beware abandonware!
 
@holdenweb think I'd rather just copy files with a sequential extension that use VSS at all :p
 
12:38 PM
But who uses Mercurial ? Guess Noone
 
I believe Facebook does... (if I recall Martijn even did a presentation on why FB chose it over git and the reasons why...) - although, I might be mis-remembering
 
DenverCoder9 uses it. Or he would, if he hadn't given up on programming and moved into the woods.
 
Maybe he did so to protect the world from what he saw for sharing it would cause the rise of cthulhu
 
On the topic of controversial tech news and/or unleashing cosmic horrors that can't be put back into their box, how about that popular javascript lib that injects advertisements into your terminal session?
Nothing is sacred anymore. Ads will ultimately
[BUY PEPSI. CONSUME PEPSI. YOU LOVE PEPSI.]
worm their way into every channel of communication.
 
Umm... going by the image on villains.fandom.com/wiki/Cthulhu_(Lovecraft) - I was suddenly reminded of the Ood in Dr Who (tardis.fandom.com/wiki/Ood) - I wonder if there was some inspiration there (head/tentacle mouth thing)...
 
12:48 PM
Dr. Who is a sausage machine whose input is the entire corpus of horror and science fiction. It's not noteworthy that there are elements of Lovecraft, but it is noteworthy that it got through the grinder without being rendered into a fine paste.
 
@JonClements yeah, I think so. I read somewhere that they get their own hg version that makes handling their massive monorepo possible
 
There's only so many kinds of eavesdropping one can maintain with vanilla hg
 
@Kevin Stay ahead by changing channels regularly, I guess. I would't dream of looking to comp.lang.python for advice any more, but at one time it was the cream of the crop. Then Google threw the Usenet archives away ...
 
@holdenweb umm... sure you can still find archived stuff on google groups?
 
Mm hmm, all communities eventually devolve into noise, so you've always got to be on the lookout for the next enclave that hasn't been discovered by fools and corporate interests
 
1:03 PM
Umm... yeah... found a post from '96 of mine on usenet via google groups...
 
morning Cabbages, everyone!
heya @JonClements! long time
 
I've heard good things about Discord communities, but the fact that I've heard about it mean that they're already on the downward slope
 
@inspectorG4dget hey again :)
 
what's new and exciting in the world?
 
can we start with an easier question maybe? :p
 
1:12 PM
easier question: how was everyone's weekend? Also, is anyone here from around NYC? I've moved to Manhattan and need new/local friends
 
Umm... it's a long weekend in the UK (it's a bank holiday Monday today) - and it's a bloomin' warm one at that... not been doing too much - a little bit of working and some watching netflix...
 
recbg
 
@JonClements ...And I thought everyone moved to Git. In my last company they were using Perforce; but they moved to Git as well last year.
@U10-Forward recbg
BTW do you guys use multi-threading often ? If yes in what all cases ?
 
not me... very rare anything I does has a use for it...
 
Often enough.
 
1:21 PM
Oh
Could you give me an example where we will/should use multi-threading w.r.t. Python ?
 
Example use case: you have a GUI application. If any of your functions take more than 1/60th of a second to execute, the window will lock up and annoy the user. You have a button that needs to execute the function reticulate_splines, which takes thirty seconds to run.
 
"if you ever have to apply one function to a giant collection of inputs" <- that's the classical example of the need for multiprocessing. I use it in the fitness evalution in evolutionary algorithms when the fitness of an individual does not depend on the fitness of other individuals
 
Although... a decent GUI framework will just abstract that stuff away into event loops anyway (be it greenlets/threads/whatever...) so generally you wouldn't have to worry
 
Rather than calling reticulate_splines directly, you create a new thread that runs it. The main thread checks the child thread every tenth of a second or so to see if the splines are done reticulating.
 
@Kevin Ah sorry I forgot to mention. It's backend development for which I am using Python.
 
1:26 PM
@JonClements I dunno whether the issue is retention or access. There was a specific period when the Usenet archive was in Google's charge, and stuff got lost.
 
@JonClements Please check my above message ^
 
Ok, backend use case: you have a web server. If any page takes more than one second to load, the browser will spin its loading icon and annoy the user. You need yoursite.com/reticulate_splines to call the function reticulate_splines, which takes thirty seconds to run.
 
kevin'd
web servers need to run asynchronously
 
Although... A decent web framework can abstract that stuff away
 
So basically we don't need multi threading in case of backend development. Can I conclude that ?
 
1:28 PM
need to apply the same analysis to a billion logfiles? multiproc
need to update a milion config files with some new IP address? multiproc
 
Note: I am not talking about web interface
 
@TheLittleNaruto why would you conclude that?
 
@TheLittleNaruto the server architecture is part of the backend
 
What is the X in your XY problem you're asking?
"should I learn about multithreading?"?
 
Ok lemme explain;
 
1:29 PM
Anecdote: backend work is one of my job duties and I've used threading twice for that purpose in the last five years.
 
@inspectorG4dget Not from NYC but have spent time there, and used to know Gloria Willedsen (PyGotham and many other things organiser) quite well. Happy to ping her if the email address still works.
 
My workplace is far from typical in many ways so I don't know how much value this information has
 
So we have written some REST APIs and feed to Flask. The APIs takes request and check for relevant data in MongoDB and returns the result.
In above case for which part I'll be using multi-threading ?
 
accepting requests
 
But isn't Flask would take care of handling multiple request ?
 
1:33 PM
no, flask doesn't do that
 
Ahrgh!
 
@TheLittleNaruto How do you imagine it does that without waiting for one serve to finish before starting the next?
 
the server which runs the flask might do that (gunicorn has a threads or cores parameter, I think)
.. and if you say you're running flask, you don't mean the dev server, right..?
 
If I add __init__.py to the tests folder of my project, then it would be found as a package too?
 
Do you want to increase the speed of the computation rather than sending a holding reply until the result is ready?
 
1:34 PM
@aadibajpai Yes
 
I don't want to but for some reason that's the solution to stackoverflow.com/questions/53679790/…
@TheLittleNaruto that's a bad idea, right?
 
@aadibajpai If its directory is on sys.path, yes.
 
@holdenweb Not sure! I didn't even think about and preassumed(Sorry)
@Arne We are using NGNix
 
It's all fine and good to be forward-thinking about what kinds of techniques you'll need to implement a design, but I think there's a limit... If you fret about things for too long, you'll never get around to actually writing code.
 
No worries.
 
1:35 PM
@holdenweb Are you replying to me :)
 
@holdenweb many thanks. I'd appreciate the contact. My email is ashwin.panchapakesan@gmail.com
 
If I were in your position, I'd just jump in and implement what I can, and revisit the issue of threading once the design solidifies enough that I actually have a concrete problem description
 
@Kevin I have everything running fine; It's just I thought of improving my existing code if at all required.
multi-threading is one which came into my mind; thence asked
 
Right. Much depends on load. I had a client who was concerned that their job scheduling process might be too expensive. I pointed out that it was scheduling computations that took hundreds of thousand of times more resources, so cost of scaling was unlikely to be a factor. In practice nobody ever complained, so they could optimise slowly as the system matured.
 
1:40 PM
Also bear in mind that multi-threading is only a win for things that aren't computationally intensive, unless different threads can run on different processors in parallel. That isn't easy to achieve in Python, though definitely not impossible.
 
It sounds like what you wanted to ask was "Can I make my application more efficient by using threading?", but the question you actually asked sounded more like "is there any point where I have to use threading in my application?"
 
Sorry Yes that's what I wanted to ask.
 
there's a discoverability issue in coverage if the tests folder isn't a module it seems when using pytest, it was working normally with nose
I added the __init__.py but manually omitted the tests folder as a package from setup
 
@JonClements re our recent exchange: salon.com/control/2002/01/08/saving_usenet says you might be right.
 
In my estimation, threads are good for 1) enabling unusual kinds of flow control 2) parallelizing the computation of algorithms that don't depend on one another. For backend stuff I expect 2 will crop up more frequently than 1
If you need to query data from the tables USERS and WIDGETS and VEGETABLES before you can render a page, then maybe it makes sense to have a thread for each one.
 
1:46 PM
@holdenweb cool :)
 
Sadly archive.org/details/usenet-comp.lang has comp.lanf.python.announce but no comp.lang.python
 
As you may already know, the Global Interpreter Lock means that threading typically doesn't make code faster if your threads only execute native Python code. The upshot of this is that it makes it easier to identify what code can be made faster. If you're working with a library that isn't implemented purely in Python, then calls to those libraries are ripe for parallelization.
 
@JonClements mail.python.org/pipermail/python-list goes back to Feb 1999, though there were times when cross-posting between the list and the newsgroup weren't brilliant.
 
@holdenweb first post in the GG archive is: groups.google.com/forum/#!topic/comp.lang.python/FGzZwdTXzqc
 
2:03 PM
There you go, then. I first joined the Python list some time in 1995/6 IIRC. No trace of that I can find.
 
Curiously though, if you go the main list, filter with a custom date, Think I dd 1980-1995 or something... it does show...
But clicking on that takes you to a date of 2000
 
"foobar" is valid JSON. What about "foobär"? If so, why does json.dumps("foobär") return '"foob\\u00e4r"'?
 
watermelon _/\_ @Kevin
 
@TheLittleNaruto I never actually deployed with nginx, but I'm pretty sure it can handle scheduling of requests and multiprocessing of the application for you
 
My guess is "it's valid JSON, but many JSON parsers are dumb and can't parse unicode, so json.dumps plays it safe and escapes all non-ASCII data"
 
2:09 PM
@Arne Yeah just read about it.
 
Rhubarb guys o/
 
rbrb
 
@TheLittleNaruto rbrb!
@holdenweb earliest I can find as it's a bit of a faff is groups.google.com/forum/#!topic/comp.lang.python/yqqWvkgYWD8
 
@JonClements Good find! There is one post that purports to come from 1992, which is probably someone whose system tine was wrong, but otherwise it appears to start in 1995!
 
2:13 PM
What I'd really like is a giant chart of every language's json parser, with checkmarks and Xes indicating what features of JSON they implement or fail to implement
 
and extensions
 
@Kevin shame it's not something you can put on an Amazon Wish list :p
 
I'm not sure whether "parses certain kinds of string which aren't strictly valid json, but which are popularly used anyway" should be considered a good or bad thing
 
bad
 
true, but sometimes demjson comes in useful when in a hurry :)
 
2:15 PM
Plenty of users would be thrilled to have a library that parses []\n[]\n[] but I'd rather have a DecodeError. (Or the parser could return [] and leave the file pointer at index 2. See last week's conversation.)
 
there is always yaml if you want to load janky json
 
Isn't yaml insecure?
 
yaml.load_safe is secure
 
yaml.load is practically pickle
 
2:21 PM
yeah... depends if you need the use of the !! stuff and what-not...
 
2:36 PM
yaml is rammel, IMHO. JSON for the win. But I understand there are people who find YAML easier to edit and read than JSON. Strange world we live in.
 
Depends on who is gonna interact with the software. YAML is by far easier to interact with in "generic text editor A"
 
Well, clearly a matter of opinion, so I can't disagree with yours - it just isn't the same as mine :-)
 
@holdenweb that's disagreeing :P But my own experience is that YAML is more accessible if the user comes from a non-programming background
 
How could I disagree now?
 
cbg
 
2:46 PM
cbg
@holdenweb any way you want; I have a strong feeling that I'm going to be schooled :P
 
Not at all. Like I said, I don't regard my opinion on such matters as of much relevance to anyone but me. I'm all for personal choice.
cbg
 
Moderately interesting optimization problem I came up with yesterday: you have a beautiful garden which is constantly under attack by aphids. The aphid population increases by one every day. Each morning, you may either spray the aphids with Aphid Sleepiness Juice, at a cost of P$ per aphid; or you may hire a professional aphid shooer to shoo all the aphids out of your garden for a flat fee of Q$. Choose a strategy that minimizes the money you spend per day.
 
I sure hope that toml will win the battle for human readable config format in the not-so-far future
 
@Kevin hire the shooer on day 1?
 
The simplest solution is to hire the shooer every day, which costs Q$ per day. But if P << Q, it might make sense to use the spray for, say, six days, and then hire the shooer, and repeat. Then the average daily cost is (P*(1+2+3+4+5+6) + Q) / 6
The math on this cocktail napkin says this is a superior strategy when P < Q * (5/21)
 
2:55 PM
@Arne Just curious: Have you done any work with rust?
 
no
do I sound rusty? :p
4
 
So hiring the shooer is mutually exclusive with spraying the plants?
 
> earned at least 200 reputation on 110 days
nice
 
@Arne They use cargo for creating projects which uses toml for managing packages and configurations. so you sound a little rusty. :P
 
I remember rust uses toml a lot, but I just like it because I had to fix our servers for a couple of days when pyyaml had its update breakdown last year
 
2:58 PM
@roganjosh Right. You can't spray and shoo on the same day. This is because the shooing technique involves having a constructive dialogue with the aphids and convincing them that the garden across the street is much nicer. You can't convince the aphids of anything if they're asleep.
 
Ok, so there's a possibility of having a constructive dialogue with aphids, so I might need to readjust my brain for that :P
 
Additional information: Aphids are pretty dumb and the shooer is an expert debater, so the technique always succeeds. Your neighbor across the street will never hire the shooer to send the aphids back to your garden, because he and the shooer are embroiled in a love triangle with the florist the next town over, which is accessible only by a train that departs from the station every X hours, and takes Y hours to reach its destination, carrying Z passengers each time.
 
@Kevin I worry about you sometimes... are you back on the energy drinks? :p
 
I can quit any time I want.
 
I wanna know about the love triangle now
 
3:06 PM
My cocktail napkin says that the strategy "spray for N days, then shoo" has a daily cost of (P/2) * (N+1) + (Q/N). I'm not sure if you can find the optimal N if you don't have concrete values of P and Q.
 
@Arne Me too. Just learning about src/directories - all worked very easily to relocate the code.
 
Or, hmm, I think I've got an off-by-one error there...
Yep, it's more like (P*N)/2 + Q/(N+1). The curve has the same basic shape, though
 
Interesting: Github appears to be having ops problems,
I'd upload a screen dump, but whenever I try my browser insists on looking for the file in c:\fakepath - some UI bug, or is it me?
 
Possible silly question, if I run a command with subprocess.run(['ls'], shell=False) how does python run the command if not through a shell? Can it call binaries directly?
 
3:24 PM
AFAICT when shell=False, the module makes a direct request to the OS to create a new process, and this can be done without involving an existing shell.
 
Using the exec system call and its many variants on UNIX.
After forking the process, most likely, to retain the existing process image!
 
TIL I don't understand shells and I probably should at some point learn more about the shells.
 
easiest way to learn about shells: go to the beach. You might just learn about C shells while you're there, too
 
@inspectorG4dget groans :p
 
@JonClements tip your servers well, I'm here all week
 
3:29 PM
not you'll be wanting to (h)ask the (sh)ells something
 
@Kevin cool, good to know. "Direct request to the os" sounds nice and powerful
 
I'm inclined to say that it comes down to your definition of "shell". If by shell you mean "a Windows process that identifies itself as 'cmd' or 'PowerShell', or one of the many Unix processes that consider themselves shells", then subprocess.run(x, shell=False) doesn't use a shell. If a shell is "any interface between a program and the OS", then subprocess has to use a shell, because there's no other way to talk to the OS.
 
primordial snake becons from elder gods: tell content of dir pls
I think the second variant is how i saw it, hence my confusion
 
wim
@TheLittleNaruto IIRC a big part of Martijn's job is making mercurial work to scale with facebooks monorepo
 
@wim was :)
 
wim
3:34 PM
they ditched mercurial too?
 
rip Martjin's magnum opus. :P
 
anyone here use tqdm?
 
wim
@Kevin ever played "plants vs zombies" ?
 
No, but I've heard good things.
 
@wim always leave a final row for a squash as your hidden ace
 
wim
3:39 PM
@Kevin the gameplay is remarkably similar to your optimization problem
 
My cocktail napkin says that "spray for N days, then shoo" is optimal when N = sqrt(2*Q/P) - 1. There are about ten places where I could have screwed up the math, though, so I'm skeptical
 
talking about games... haven't had the chance to play bridge in ages
 
oh we talking bideo games?
 
@JonClements that's a good sign, right? means there hasn't been much flooding near you recently
 
oh come on... surely people other than me like playing bridge - the card game! :)
 
wim
3:42 PM
@holdenweb this "C:\fakepath" is a clientside browser thing, nothing to do with github
IIRC it is a security feature of chrome (refusing to expose clientside filesystem)
 
think it's even in a spec somewhere @wim as to it's what browsers should do... in whatever way so as to not expose paths, just "a name"
 
Essentially, even if you "see" a fakepath, the browser actually has the correct path for all client side operations
oh, and recbg
I ran into this a couple weeks or so ago. Actually i feel like you contributed to that discussion as well @holdenweb
 
(basically just means a browser doesn't expose /home/jon/something/whatever/project_name/some_thing_else/some_thing_else/filename.whatever - it just does "I'm sending you filename.whatever")
 
cbg! How are ya
 
3:53 PM
pretty busy in brushing up algos and system designs to give interviews
 
Talking about games, I wonder if chess with gravity would actually be fun to play, or if it's only good for a fifteen second gif joke
 
gave a few, still some on the pipeline, so zero activity here or on the main site
 
@Kevin That looks like it could be either really good or really bad, and i can't tell which :P
 
Ah, here's an interactive link. pippinbarr.github.io/chesses
 
wonder what would have been the thought process for making such a thing
 
3:57 PM
I just moved my knight 1 tile by moving him 3 tiles.
I see potential for pure chaos in this.
 
wim
@Kevin The latter, I think.
 
how would I go about using str.format if I wanted to name a varibale as well as specify alignment? "{:<22desc}".format(desc='asdf') fails pretty spectacularly
 
wim
It would collapse a lot of the richness and complexity of the game
 
The github repo, in particular the process journal, gives some insight into the author's development process. Skimming through it, it doesn't tell us a whole lot about the inspiration, beyond "wouldn't these be wacky?"
 
wim
@inspectorG4dget nested!
 
3:59 PM
When Jira goes down, you start to quickly realize how much of a single point of failure it is in your delivery cycle.
 
wim
or maybe you meant simply "{desc:<22}".format(desc='asdf'), since asdf is not looking like a format spec to me
 
Have you guys heard of infinite chess?
 
03:00 - 16:0016:00 - 23:00

« first day (3236 days earlier)      last day (1727 days later) »