« first day (3628 days earlier)      last day (1303 days later) » 

1:09 AM
@MisterMiyagi Thanks I was just trying to remember something about dataframes and matplotlib that is not too compatible and it is advised to convert to a numpy array. I also heard something that seaborn is more optimized for dataframes
 
 
4 hours later…
4:44 AM
Oh, that sweet sweet feeling when you delete code... removed a rough implementation of itertools.product in littletable - it was there for pre-2.6 compatibility! (How old is this?!) 20 lines of useless code -> the Rotating Knives!
 
5:01 AM
And another 20 lines for simplejson and ordereddict backport of OrderedDict. My test coverage is going up without writing any tests!
 
 
2 hours later…
7:05 AM
@roganjosh Hm, good point. Picked flask-mail up with some framework to get up and running quickly before the spec grew a little. You wouldn't just happen to know an alternative?
 
Sep 2 at 17:45, by holdenweb
@PaulMcG The easiest code to maintain is code that's been deleted.
 
@dabeaz was just recently tweeting in this same vein
 
 
1 hour later…
8:25 AM
@PaulMcG I have a lot of time for @dabeaz. BTW your message was numbered 50505000, an insignificant fact which I thought I'd report.
Async does not find universal acceptance in Python: twitter.com/KevinHoffman/status/1307706664804642819
[Apologies for the total non sequitur]
 
8:43 AM
Not surprised. async still is a pain to use. Judging by the various open proposals, the deterministic nature of async has raised a lot of questions which no-one is sure if they even should be answered, let alone asked.
 
non-deterministic?
 
IMO the biggest problem is that, as in the tweet, async is nice as an implementation details but not when bleeding out into the entire program.
@holdenweb Deterministic in comparison to, say, arbitrarily scheduled/suspended threads.
 
That was the essence of my reply on Twitter - that async programming will continue to suck as long as programmers have to explicitly control it.
 
Yeah. It's great to manage how to handle the same resource concurrently. It's a nightmare when you suddenly have to manage totally unrelated resources because they act concurrently.
 
@MisterMiyagi Fair enough. I believe the standard distinction is between "pre-emptive" (i.e. OS scheduler-determined) and "cooperative" (i.e. explicitly controlled by the programmer) multitasking.
 
8:51 AM
Yes, sorry, I admit to alluding to a problem I cannot properly express. :/
 
The real problem is that analysing possible performance paths becomes factorially (?) harder as the number of asynchronous paths increases, and we aren't good at that kid of parallelism in our own thinking (or at least I'm not).
Pre-emptive scheduling forces you to abandon any thought of control other than at explicit interfaces such as system calls, network reads, &c.
@MisterMiyagi I didn't explain it to reprimand you, but to enlighten you - there really was no need to apologise unless there's some rule that we all have to know everything - in which case I must leave :-)
 
IMO the proper approach would be to have "Bundles" of concurrency for related resources. Actions on inside a bundle should be cooperatively concurrent, but pre-emptive compared to the rest.
@holdenweb No worries. I did some async experimentations when building a simulation framework (an async simpy) so there are some random, half-formed ideas and issues still floating around in my head. It helps to be reminded that there is an established wording for the big picture.
 
 
1 hour later…
10:12 AM
Hmm I wonder, what is a virtual environment actually? I've used it as a tool to differentiate local from global python installs. But does it do more than just python stuff? Does a virtual environment also manage other things? - It seems to integrate with the shell/os?
 
10:26 AM
a venv is just a bunch of folders and environment variables.
It integrates with the shell only in so far as that it ships with a script that explicitly integrates with the shell, by setting the prompt. Everything else would work the same in other programs too.
You might want to take a look at the venv/bin/activate script to get a look behind the scenes.
 
10:49 AM
@MisterMiyagi I still think the @dabeaz talk at PyCon Montreal was a great introduction to the issues.
 
I want to say "I concur(rent)", but I don't know anything about the subject, alas
 
agreed, the @dabeaz talks/slides are my number 1 recommendation for getting into the async world.
 
@paul23 There's the virtual environment (a local Python installation with its own site-packages) which exists until you delete it. When you activate it, that Python effectively becomes command-line python in your shell, and other executables in its /bin directory also become available at the command line.
 
@AndrasDeak "I think I can safely say that nobody understands async mechanics."
 
@holdenweb yes but does it do different things than just that? Or is it a python specific idea?
 
10:55 AM
very python-specific
If you look in the activate script as Miyagi suggested you'll see
 
@paul23 that's pretty much all it does. Venvs not only have a python but also a pip, which installs into the venv rather than the system python, and so does not need sudo and friends.
 
hmm "weird" that shell then inserts an indication in front of the lines - special coding for a single use?
 
most of the code is about changing your shell prompt and undoing that with deactivate
@paul23 what I just wrote ^
you can do PS1='oh no potato ' in a shell and see what happens
at least in bash
there are separate activate scripts for fish and csh
 
Take a look in a venv's ./bin directory as well. Then (e.g.) pip install grip (a Python markdown formatter) and observe that a new item has appeared in /bin. These are so-called "command line entry points," which are installed as part of certain packages.
 
Weird, I would've sworn that my ipython script doesn't match my virtualenv.
now that I look the script is indeed there and which ipython gives the right version... hmm...
 
11:01 AM
Hey I'm trying to setup a workflow on github to publish a module to PyPi. I'm using the template given by GitHub and setup PyPi login secrets. But it keeps complaining can't find setup.py.
The run section includes `python -m pip install --upgrade pip
pip install setuptools wheel twine`
 
@Oliver what exactly complains about a missing setup.py?
I won't be able to help but it seems to me that others who can will also need more information
 
Not my module, the deploy code
 
Does your module include a setup.py?
 
Here is the deploy workflow yml pastebin.com/8jHyw8Yq
The yml workflow installs setuptools wheel and twine
I also included wheel and setup tools in my module requirements.txt just in case
 
11:09 AM
Very good. Now please answer the question ... ?
 
trade secret :P
 
as in a custom setup.py?
 
There is no such thing as a standard setup.py. Line 30 tells github to execute setup.py - you have to provide it as part of your package.
 
Right. Didn't realise I needed my own one. The github guide did not mention...
 
Perhaps you should first hammer out a manual workflow pushing to pypi or test.pypi, and then automate it?
 
11:12 AM
Well either. I thought this would be easier
 
A minimal setup.py isn't hard: see docs.python.org/3/distutils/setupscript.html
You can embellish it as you advance.
 
I've never actually packaged my python code, so I'm trying to dig through it
 
setuptools.readthedocs.io/en/latest/setuptools.html would be a worthwhile read to give you more idea of what you are doing, then :-)
 
Do you need to manually change the version string in setup.py each time you do a release?
 
Yup. Most people have a standard release procedure that includes setting the version.
 
11:15 AM
The github workflow can't automagic it for you?
 
the less magic the better
 
the less manual labor the better.
 
Where do you want github to automagic a version for your release from?
 
Perhaps, I'm not that knowledgable about setuptools, as i have started to use poetry` (which doesn't appear to need a setup.py, but has its own complexities).
 
github lets you tag releases from the website directly, and automatically kick off a publish package workflow. I'd assume it could grab version info from the release creation
anyway, as suggested I'll get it working manually first
 
11:17 AM
in that case you'd probably want to google "github pypi release version automatically"
 
cbg , guys
 
cbg
 
NYC
cbg
 
Hey guys just a quick one
When saving a sequel SELECT result into a variable what does it save as?
[{'cash': 10000}] Currently saved this into a variable called price. Tried accessing it via price['cash'] trying to figure why it aint working
 
depends on your database module and the sql query, probably
 
11:33 AM
@Kwsswart what you have there looks like a list with a dict inside. price[0]['cash']?
otherwise look at type(obj)
 
@AndrasDeak Well using sql that is exactly the answer thanks wasn't sure how it was being stored
 
when in doubt, print(type(obj), repr(obj))
 
@AndrasDeak Great advice thanks man
 
TIL: super can be unbound, and super(__class__, self) is equivalent to super(__class__).__get__(self).
Another magic mystery tale has been stripped of all its magic. :/
 
The new mystery is: What is that good for?
 
11:50 AM
I'm calling shotgun on academic curiosity.
For some poor souls that are more comfortable with descriptors than multiple inheritance, there might be an ounce of clarity from understanding the magic behind it. Or eternal suffering, who knows.
 
 
1 hour later…
user13415013
1:19 PM
came to my baby room :)
 
@nerd What?
 
user13415013
:D, I am on different room trying to ask seniors question. Other than that Python is my homeland.
 
I don't get it, but you should stop focussing on age
 
user13415013
no I mean not that what you are thinking. Senior doesnt means age, its means how talented persons are :)
 
OK, since you're confusing and said things like "senior" and "baby" and earlier your remark about "old dudes" it wasn't very clear
 
1:24 PM
@nerd expert question would be more fitting
 
user13415013
:D , senior to those who expert to python, baby to Python chatroom, that 'old dudes' word, I was really sorry for that I didnt think if it will hurt people, but I will control my words not to hurt peoples :)
 
I don't think people are hurt, it's just a bit odd
 
Yeah, the real risk is looking like a fool
 
user13415013
yes, and i will never say in future like that. every body are old, thats reality of life.
 
(but in general ageism is harmful and dumb)
 
1:29 PM
Incidentally, I'm currently in the baby room of distributed computing. Separating by seniority has some merit for sure.
 
user13415013
hehe, hail python
 
@MisterMiyagi round peg in the circular hole
 
user13415013
guys, I am in c++ room asking for some recommendation on learning robotics.
 
Weird place to ask about that
 
@AndrasDeak That was slide 5 or so. They're at slide 10 right now.
 
user13415013
1:33 PM
@AndrasDeak, where should i ask ? I am currently in far place on earth where every people dont know about that, so i had to research by myself to get over it.
 
user13415013
and found chat stackoverflow :D to ask
 
Probably not in language-specific chatrooms on chat.stackoverflow.com. If there's a robotics SE site, you might find something relevant at chat.stackexchange.com. Otherwise you have to find other media.
As a layman, "robotics" also sounds like a really broad term. You'll have to be more specific in your questions, specifying whether you want to build stuff or just take existing stuff and program them etc.
 
user13415013
Thanks :)
 
2:02 PM
Lol somebody asked about c++ syntax problems. Funny enough the first two offenders also are a haiku of the feeling I have towards the c++ syntax " ; { " xD
 
: \t
 
2:21 PM
morning cabbages, folks
 
user13415013
cbg
 
user13415013
@Hakaishin you are there too :), c++ friends are pretty cool
 
Pet peeve of the day: Having to write f'{str(path)!r}' to get a nice quoted repr of a pathlib.Path
>>> print(f'{path}')
foo bar.txt
>>> print(f'{path!r}')
WindowsPath('foo bar.txt')
>>> print(f'{str(path)!r}')
'foo bar.txt'
:(
 
2:38 PM
Do you often need a nice quoted repr for a pathlib.Path?
 
Yeah, for error messages
"path {...} doesn't exist", etc
 
f'{str(path)!r}' takes the path's str and then gives you the repr of it. Wouldn't f'"{path}"' be just as good?
 
not if the path contains double quotes
 
I would argue that in that kind of message that hardly matters, but each to their own.
 
2:56 PM
does the log message support markdown? I'd do "path actual/path does not exist". Or is that the effective equivalent of nuking a well-ablaze tire fire?
 
Oh I'm not logging, I'm just passing the message into the Exception constructor
 
hmmm... too bad exception handlers don't do markdown :(
so hang on a sec! while unicode was once considered to be a frontier of code (py3 has native unicode support, Go touted its "code in unicode" ability), is markdown the next frontier?
 
I doubt it. Being able to display text is much more crucial than being able to display nicely formatted text :P
 
the original markdown "spec" is a Perl script. Go figure.
 
fml!
I'd like to be able to say "fml!" in salad,l but I fear that people may misunderstand and think I'm talking about a file format
 
3:32 PM
@MisterMiyagi I'm afraid I don't. flask-session was in a similar state for a while and then there was a breaking change. I ended up just ripping out the relevant parts for my own module going forwards so I don't get broken dependencies. But it seems flask-mail is the defacto library
 
4:00 PM
@roganjosh Thanks for the insights. I had a feeling the state of the project wasn't that well looked after, but it's really not my comfort zone.
 
@MisterMiyagi I remember when you needed Perl to build the Python documentation!
 
re: nice looking paths, valid NTFS pathnames can't contain quotes. But I guess there's no guarantee that the path the user supplied is valid, even if you know you're in an NTFS system.
 
I think NTFS paths can contain double quotes on linux
 
Linux filenames can have any byte except null and '/'
 
Maybe I'm misreading the docs, and it's just Windows that adheres to the rule. ¯\_(ツ)_/¯
 
4:09 PM
Windows docs are slow to acknowledge the existence of non-Windows OSes
 
Tricked by Google's overzealous oneboxing once again
 
does anyone have an authoritative source that mentions how RBG passed? I need to slam dunk an argument with a moron
 
I have to write tests for our NFS file-storage system, some using randomized bytes for file names. The test logs are... unpleasant.
 
If only there was an easy way of getting a nice quoted repr of paths.
 
@PaulMcG password managers (like 1Password, which I use) generate random characters for passwords. They allow for the usage of real words, word-like, pronouncable, etc. Would borrowing that logic work for you at all?
 
4:14 PM
@inspectorG4dget Wikipedia uses nytimes.com/2020/09/18/us/ruth-bader-ginsburg-dead.html as one of its sources
 
@Kevin much thanks
 
@inspectorG4dget I would take issue with the word "need" in taht context. Why not just save your time and stop replying?
 
someone is wrong on the internet dot png
 
Thanks, @inspectorG4dget. The trick is not the generating, the trick is when you log to your terminal session and you get escape sequences and control characters that scramble the display. Not really an issue any more, I'm able to scrub the log output before sending to the screen.
Usually enough just to read from /dev/urandom
 
Speaking of control characters, does anyone know one that could cause a terminal window to stop producing output? I was making a backup the other day and halfway through the terminal basically froze
 
4:19 PM
@holdenweb unfortunately, the moron happens to be misinformed family member who has very little scientific background. While they are "good people", it is sometimes necessary to steer them away from conspiracy theories (COVID-19, in this case) or even just assert "you're wrong. <this> is the right answer" and let them ask questions later or just take my authority on it. Each of these has happened in the past, so it's really just a "wait and see what happens" thing
 
@Aran-Fey I've only encountered terminal freezing with ctrl+s. Will resume on ctrl+q.
 
You may be able to avoid/workaround/recover this if you run the backup inside a screen session.
 
Hmm, I don't think I've pressed ctrl+s, but who knows
 
@holdenweb I find comfort in knowing these dark ages are over.
 
When {distant family member} starts talking about politics at Thanksgiving I simply dissociate until the topic changes
 
4:22 PM
ctrl+z will also suspend the foreground process I think, giving you the shell. That doesn't cover "freezing" exactly.
 
@PaulMcG Nice idea, I might try that. Although I don't think it's likely to happen again, because the backup program only processes files that changed since the last time
 
well, ctrl-z + kill -9 <pid from ctrl-z> might fit the bill
 
there definitely was no ctrl+z involved
 
Just to be clear there was no SSH involved, right?
 
correct
I'd be surprised, but it might be related to my shell... I use fish
 
4:31 PM
was a very large file being copied? that might cause an appearance of a frozen terminal, when in fact "it's just thinking real hard"
 
sounds fishy
 
if you change your shell, you might stop floundering on this issue
apologies for my pun. Feel free to ignore my carping
in other news, Spotify just started playing "I'm All About That Bass". I think my music is now throwing puns at my friends
 
@inspectorG4dget Multiple large files were involved, but I'm certain that wasn't the cause. I forget what exactly happened; I'm 50/50 on whether that terminal ever unfroze or if I had to close it completely
 
what was level of CPU/RAM/swap usage during all this?
 
No clue, but I was using my PC while that was happening and it behaved normally. The problem really was just that one terminal window
The program usually displays a progress thingy where it repeatedly overwrites the text in the current line. So the cursor is usually at the end of the line. But then it was suddenly somewhere in the middle and never moved from there
99% sure it was in the middle of a file path
 
4:38 PM
oh?! sounds like a stdout.flush issue at best
more likely, something welp'd and got disappeared in a catch-all exception handler. Assuming this is unexpected behavior, I'm going to guess this is a "weird state" issue and can be solved with "have you tried turning it off and back on again?"
 
The command did eventually finish successfully though
 
5:26 PM
were you backing up files off-site? was it a network issue?
 
he said no SSH
 
I was uploading to my NAS, but it wasn't a network issue. I checked with nethogs and it was uploading just fine
 
how about files off the local gDrive, which itself is a network stream depending on whether you're using gDriveFileStream
 
Note that he said the backup finished fine, it seems to have been a terminal display issue. So I'm not sure the locations are relevant.
 
@MisterMiyagi FWIW, flask-session did sprint back into life (eventually) but it was too dependent on one person accepting PRs, so it was a bit frustrating. For a long time before that, there wasn't really any need for PRs. It could be that flask-mail is just stable
 
user12867493
5:48 PM
I have some issues with the pickle library. I'm using a .pickle file to store some dictionaries, they are dumped in the format: {'Item 1': '', 'Item 2': '', 'Item 3': '', 'Item 4': ''}. I then load the information using someVariableName = pickle.load(file). However, when I print this variable, the dictionaries end up stored at the following indexes in a list: [0][0], [1], [2], [3], [4] etc. .
 
user12867493
As you can see, the first dictionary index doesn't follow the same format/position as the other dictonary indexes, so I have to store the first dictionary in a tempVariable, del [0] and append the tempVariable. However, as I am frequently dumping/reading data, this becomes annoying and wastes a lot of time. Is there any reason why pickle loads the first dictionary in this specific index? Is there a way to fix it?
 
That said, I'm not sure it's a Flask problem? Wouldn't it be set up on the mailserver, and you just pass those details to the mail library @MisterMiyagi?
 
@Xnero we'll need an MCVE
 
user12867493
@AndrasDeak I gave you a sample of how I stored, dumped and read the data.
 
I don't trust folk tales, only blocks of code I can run python on.
 
5:51 PM
@roganjosh Admittedly, I am a bit confused by what of flask-* is actually convenience, functionality, or just ignorance.
It seems to integrate with flask insofar as that it properly uses the config.
 
@MisterMiyagi flask-* specifically (as a name) is just a convention for a supporting library. Unlike django, where things like session management, or database connectors, etc. are bundled into the main library, Flask itself is a tiny centralised library that gives interfaces for custom extensions
 
@Xnero Can you clarify? The original data has no indices, so I'm not sure what to make of "the first dictionary index doesn't follow the same format/position as the other dictonary indexes".
 
So, it relies on the community to create their own projects that leverage this interface
 
@MisterMiyagi the MCVE should clarify that
 
@roganjosh I might just be bad at that entire "trust the community" thingy. :/
 
5:54 PM
Oh sure, I don't blame you for that
 
FWIW, that above statement also apply to all of the * packages. :P
 
There was a concept of approved extensions but it's gone now
 
user12867493
@MisterMiyagi The first dictionary is at [0][0] of the list, the second is at [1]. Why is the first one at [0][0] while the others are at [1], [2] etc. ?
 
@Xnero There is no list in your example.
 
@MisterMiyagi that's why I just ask for an MCVE
going into folklore will only make things more confusing
 
user12867493
5:58 PM
For example, this is the loaded data: [[[{'1': '1', '2': 2', '3': '3', '4': '4'}], {'1': '1', '2': 2', '3': '3', '4': '4'}], {'1': '1', '2': '2', '3': '3', '4': '4'}]
 
Plus the story needs more dragons :)
 
@AndrasDeak Sorry, I'm stuck on "wise master mode". Trying to shut it off in 3... 2... 1...
 
user12867493
@Xnero In this case, the indexes are [0][0], [1][1], [2] weirdly.
 
user12867493
@AndrasDeak Well the code is 200 lines long...
 
@AndrasDeak If SO were a medieval map, there be dragons all around us :P
@Xnero That is why we are asking for a minimal, complete, verifiable example.
 
6:00 PM
@Xnero 1 line for dict definition, two lines for pickle dump (complete with with statement), two lines for pickle load
 
@Xnero The indices are 0/0/0, 1/1, 2, which indicates your code is mishandling extending the list.
It looks as if the code adds elements to a new list instead of appending.
I.e. instead of a + [b], the code does [a, b]
And by recursion/induction [[a, b], c]
 
user12867493
customerInformation = {}
customerInformation["Name"] = customerName
customerInformation["Postcode"] = customerPostcode
customerInformation["Delivery distance"] = customerDeliveryDistance
customerInformation["Size of set meal"] = customerSizeOfSetMeal
customerInformationDictionaries = []
    with open('customerInformationPickle.pickle', 'rb') as handle:
        try:
            customerInformationDictionaries.append(pickle.load(handle))
        except EOFError:
            None
    customerInformationDictionaries.append(customerInformation)
 
That code appears not to pickle.dump anything.
 
user12867493
I think I see the issue, basically, I need a list which isn't a list. i.e. I append what's in the pickle file to an existing list which maps it at [0][0], [1][1] etc. .
 
@MisterMiyagi It does. It will inject some CONFIG_NAMES into the application's config object. If you're interested in why it does that, I can give you some links but I don't want to bog you down with that if it's not relevant. Re: SSL I suspect that it isn't a flask problem; you would launch the application with gunicorn and pass the certificates to the gunicorn server
That would then encrypt any outgoing communication from your application to the mail server
 
6:07 PM
The TLS part is working fine. It's the signing of the message that we are still struggling (a little now).
 
@MisterMiyagi arguably waiting for an answerable question would only make you wiser ;)
 
@Xnero Take note that this does not match what you have shown here.
@AndrasDeak Afraid the path might be the goal challenge already.
 
pathlib.Path?
 
Touché.
 
6:20 PM
@MisterMiyagi that's the part I'm referring to. Are we talking about the development server for the time being?
For example, if you're just using flask.run() then that command takes an argument for the certificate. Then you need to add 'MAIL_USE_SSL' or MAIL_USE_TLS to your app config file
In which case, communication out of your app to the mail server will get signed by the certificate you passed to the server hosting your app
I'm happy to move this to another room for us if I'm not being clear how the pieces fit together btw. You've helped me enough in the past :)
 
it's refreshing to have some signal
 
I'm just not sure we're talking about the same thing. The MAIL_USE_* flags should be for signing the connection, no? We're looking for signing the message.
 
user12867493
@MisterMiyagi It does.
 
@Xnero Notwithstanding string quote errors, the first element is [0][0][0], not [0][0].
 
user12867493
@MisterMiyagi Not for me.
 
6:32 PM
Given a = [[[{'1': '1', '2': '2', '3': '3', '4': '4'}], {'1': '1', '2': '2', '3': '3', '4': '4'}], {'1': '1', '2': '2', '3': '3', '4': '4'}] (your example with fixed quotes), the expression a[0][0] is a list of a dict. It is not the first dict itself.
 
user12867493
@MisterMiyagi Ah yes, I do apologise about the quotes and looking at it again that's what it gives.
 
No need to apologise. Please just take the time to verify whether your assumptions about your data are true.
 
user12867493
Ok.
 
@MisterMiyagi I think you might be right. It might be more along the lines of this package but we're probably on a level playing field on this one
 
@inspectorG4dget I have no idea what a local gdrive is or what a gdrivefilestream is
 
user12867493
6:35 PM
@MisterMiyagi Any solution for it? I need to figure out a way to append to the list without making it a list if you know what I mean. e.g. list1 = [dictionary1, dictionary] but obviously I can't do that here.
 
hello all
 
@Xnero For that we would need to know the code (or equivalent) that is creating your wrong data.... ;)
As said before, I assume your code already does a = [a, b].
If the nested elements were in tail position, I'd expect erroneously using append instead of extend – but since that is not the order shown...
 
crystal ball: an append has to be an extend somewhere
 
Yeah, the more I look into it, this is way beyond flask-mail. My best-guess is python-smail and then just send the encrypted message like any other email (using flask-mail) if your TLS is running. But it's out of my comfort zone so I can't judge whether that's best-practice
 
6:51 PM
@roganjosh Ooooh, that looks good! Nice find!
 
user12867493
@AndrasDeak It works now, thanks.
 
The key point in finding it is to not be distracted by Flask. I think it's a red-herring in searches because I think it's beyond its remit. At least, that's how it seems to me. Otherwise you're just trudging though TLS stuff in the searches
 
@MisterMiyagi oh that's what you said too
 
7:35 PM
@Aran-Fey Google Drive came up with a program many years ago that allows you to sync your Google Drive account to a local folder. More recently, they came up with something called "File Stream" which sets up links on your local hard drive, to online documents which will then be downloaded on demand and invisibly to the user
 
I see. I don't have that set up
 
my single greatest fear with synchronised cloud storage is that I accidentally nuke something on the remote when I only want to delete it locally
 
that reminds me of the time someone did rm -rf * while they had the CERN storage mounted...
 
funny joke ;)
 
well, it takes a while to delete some PB. long enough to frantically kill the process.
 
7:42 PM
but without -v it's very hard to notice...
 
@AndrasDeak Mine was that I might start syncing my multi-GB files via my phone :P (sorry, I'm dining out on my new-found lack of paranoia about file sizes!)
 
and then you have to find what was deleted and what wasn't...
 
hello
 
hello
 
I'm new to Python
 
7:43 PM
that's why my backups are encrypted on Amazon Glacier. About every month, I ship an incremental backup of my backups to there
 
Hello :)
 
Hello new to Python, I am inpsectorG4dget
 
Nice to meet everyone
I have a couple of scripts written in python
that I would like to run
 
Still sounds like something awfully decoupled. 1. start deleting all the yam, 2. team member notices, 3. team member comprehends that yes, yam is actually getting deleted, what the yam, 4. alarm, alarm
@MisterMiyagi all's well that ends well I guess
 
7:46 PM
However, the first script I have to run is by this command from cmd,

python3 emails.py #slower

I got an error telling,

C:\Users\myusername\Desktop\master>python3 emails.py #slower
File "emails.py", line 1
<!DOCTYPE html>
^
SyntaxError: invalid syntax
 
Because it's not a python file, it's html
You can't run HTML through the python interpreter
(I should be more conservative here because I suspect someone will say you can and do something tricksy)
 
but the owner of these scripts from github
telling these instructions to be run in this way
 
@Hammad how did you download those scripts?
 
@roganjosh Why yes, that sounds like a job for import hooks! disclaimer: this is not a job for import hooks
 
if you just run wget on a github page it will download html. You need to download manually or wget from rawcontent.github.com or whatever
 
7:49 PM
@AndrasDeak from github as a hole zip file
 
@Hammad Just open emails.py and see if there's python or HTML inside, please
 
indeed, it starts with <!DOCTYPE html>
 
So you have to figure out where you misunderstood the instructions, or where you made a mistake.
 
Putting the current issue aside, what is this supposed to do? Give a loadable web page?
 
but there are some modules to be installed such as selenium,colorama
 
7:52 PM
It is also possible that the other person screwed up and put HTML into a .py file and pushed to GitHub. What is the repo?
 
requests, and proxyscrape
ok guys
this repo I don't know if it legal
because it generates protonvpn accounts
 
Ok, don't divulge something you are not clear on then.
 
But I see it legit, since this protonvpn gives a trial verion for each new account
please re-guide me where I mess
 
It certainly looks like Python in that file.
 
but it contains an html syntax
 
why it's not the same
 
but yes, using libraries for which the main purpose is spamming or other kinds of shady business looks bad
presumably you have a legitimate use case :P
 
The docs are broken anyway because it suggests python3 cleaned_emails.py plural and that doesn't exist
 
I pressed code (the green button) then Download Zip
 
7:58 PM
@Hammad You probably downloaded the html view instead of the raw content.
 
@Hammad sure. Doesn't that raise questions about the rest of the library?
If pandas documented read_csvs instead of read_csv, wouldn't you think there might be proble... nm :P
 
I just downloaded the ZIP and it looks like plain old Python. But given the protonvpn Terms of Service prohibit this kind of scripted access, I'm not sure how much more help we should provide here.
 
^^ (They actually didn't, btw, or not to my knowledge)
 
I might paste some external code without notice within this file email.py
@PaulMcG do you mean these scripts are prohibited by protonvpn?
 
Yes, that is what @AndrasDeak posted just a few minutes ago, in a link to their Terms of Service.
 
8:08 PM
I think this convo has run its course
 
I see.
 
Unrelated question; can anyone speculate on why a full refresh of SO main feed, to give the newest 50 questions, is way faster than clicking "30 questions with new activity"? It's been bugging me for a while on how that works
I assume the latter has to do some complex cross-checks but I can't think what they are tbh
 
I would speculate server-rendered vs client-rendered.
Javascript (which would display the new 30 questions) would be slower than an already laid out HTML DOM (hard refresh for latest 50 questions).
 
8:23 PM
So the backend is re-processing the response it will send on every new question, in the case you actually re-load the page (or happen to land on the feed)?
 
I find it hard to believe that spawning HTML elements with javascript can take a noticeable amount of time. Unless the elements are added in the wrong order (parents first, then children), forcing the browser to rearrange the website constantly
 
There might be some requests being made when the ajax thing is fired. The questions that were promised might be checked for being open, or undeleted, or upvoted, depending on the view they appear in (some views are filtered for quality and tags). This could mean that when you press the button you have to wait for multiple requests I bet you could see this in the browser's console, if this is the case.
 
That's a decent port of call. I'll just monitor the traffic to look for multiple requests to the backend. It's easily testable just by stacking up new questions in the "Newest" tab
(famous last saying - "easily testable")
 
8:42 PM
yeah, multiple requests looks more likely than slower JS. However slow, it shouldn't be as noticeable for a single task.
It loads the gravatars of the users for each question along with the new questions AJAX. But that should happen on a full refresh too. Maybe the gravatar is a blocking request for the half-refresh and non-blocking (obviously) in the full?
That should also be easy to verify, brb.
 
The refresh-to-be-faster would still have to load the gravatars, so if that were the case, they'd have to be accessing a bulk request, no?
 
the gravatar is non-async / render-blocking in the half-refresh, hence the delay (browser waits for gravatars or user image to load before rendering)
The full refresh would ideally have the user images to load async and low priority (DOM can be rendered without them), hence it might usually appear faster (ideally everything else would load from cache except the HTML)
@roganjosh it's not about bulk as such, but about being async. Browser can just display the main part and then continue rendering image and other low priority stuff (sometimes even CSS if specified) as it fetches and receives the content parallely.
rbrb and good night :)
 
9:17 PM
Rbrb shad0w and thanks for the hints to think about
 
 
2 hours later…
11:44 PM
Informal poll: What tool do you use for managing python environments (virtualenv, pipenv, etc.)?
 
99% none, 1% venv
also tox if that counts
 

« first day (3628 days earlier)      last day (1303 days later) »