« first day (3608 days earlier)      last day (1323 days later) » 

12:08 AM
@Aran-Fey codecs.open also didnt help. gives the same error as before. I also tried io.open, but no luck
 
Oh, it doesn't support keyword arguments. Omit the encoding= and it'll work
 
@Aran-Fey with codecs.open("xxxx.csv", 'w', 'utf-8') as csv_file: like this?
 
yeah
 
@Aran-Fey no luck. just so you are aware, the api response is already coming in as json format from postman, again we are using data = requests.get(url).json() . is this causing any issue? just wondering.
 
I'm not sure what you think the problem would be. The server sends JSON and we interpret it as JSON. No problemo.
What exception does that throw?
 
12:14 AM
:50352887 Traceback (most recent call last):
  File "so_test.py", line 15, in <module>
    writer.writerow(row)
  File "/usr/lib64/python2.7/csv.py", line 148, in writerow
    return self.writer.writerow(self._dict_to_list(rowdict))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 8: ordinal not in range(128)
 
ohhh, in python 2 you're supposed to open csv files in binary mode
You know what? It's too late for me to be dealing with python 2 rubbish. I'm going to bed
 
@Aran-Fey :) cool. Thanks for the help
 
12:59 AM
@inspectorG4dget Both of these say "Could not find the requested event." when I click on them? I should be good for both of them though, imminent births etc notwithstanding.
 
 
1 hour later…
2:19 AM
@toonarmycaptain My apologies. It seems that gCal has some rather unintuitive eccentricities
Here's the calendar invite for the Sep 19 hangout. 9am in Seattle, 12pm in Toronto/NYC, 21.30 in India, 17.00 in London
Here's the calendar invite for the Oct 3 hangout. 9am in Seattle, 12pm in Toronto/NYC, 21.30 in India, 17.00 in London
 
2:47 AM
@inspectorG4dget Cheers :)
 
3:31 AM
cbg, I want to list some content based on a value in a select field in my flask app, is there a flask function that shows contents without refreshing the page? I have managed to do this after pressing the submit button but it refreshes the page eg: selecting fruits must display apple, orange .... in a div, vegetables must display carrot, tomato...
something like flash but shows up when you change the dropdown
stackoverflow.com/questions/40949746/… this is what I came across but it suggest using javascript which I am not yet familiar with, is this the only way even now?
 
4:23 AM
yes, that's generally the easiest way - flask can only produce new, complete pages (or templated css/js) but that must require a full reload of the resource from the endpoint.
 
4:38 AM
I guess I have to understand some basic javascript then, thanks for the help
 
5:24 AM
I tried to use AF_XDP socket in python socket module,But I got an attribute error ....AF_XDP sockets are built in linux kernel ?
 
 
2 hours later…
7:05 AM
@Janith It looks like the socket module does not expose AF_XDP (yet). If you know that your kernel supports it, you may want to manually look up and supply the respective bitflag.
FWIW, I'd be interested to know if that works.
 
 
2 hours later…
8:54 AM
Anyone has ideas for Final Year Project for a realistic use-case using Machine Learning?
 
Does anyone else get a Segfault from this question code for large numbers (e.g. 100000)?
 
@MisterMiyagi yep
 
Anyone, please?
 
9:15 AM
@ZahidSaeed What do you mean by "Final Year Project"? My dictionary has a translation, but if that is correct then a professor/supervisor should tell you the answer.
 
@MisterMiyagi I'm in the last year of my graduation. So to complete the degree, we have to deliver a final project which is based on a realistic use case and will help others.
The field of study depends on us
My personal interest is in the Machine Learning / Deep learning
I'm totally a beginner so I just wanted to get some experience
so it will be R&D for me
 
ML as in classification/recognition? Automation?
 
It could be anything
It should have a solid use case
 
So are you supposed to come up with a new realistic use-case and solve that, or pick an existing realistic use-case and make a demonstrator for it?
 
It could be a new use case OR we can pick an existing one, add some new features to it (intuition) and propose it
I had given a proposal for "Automatic email reply"
Usually, companies hire many people for replying the queries that they receive from the website
So what if we build a model which can generate an auto-reply based on the customer's query?
@MisterMiyagi The university teachers are rejecting it by saying that it is just a chat-bot
 
9:26 AM
Seems like the main challenge is guessing what your supervisor considers significant.
 
@MisterMiyagi Is my idea bad? or is it just a chat-bot?
Also, do you have any suggestions?
 
At least from a functional standpoint, it seems very close to a chat-bot. Just using emails instead of chat as the medium.
 
Hmm then why big companies are hiring staff for a reply?
and not use a model?
 
I don't think the economic viability is related to the academic significance, truth be told.
You may want to check if your supervisors have hinted at what they consider proper topics.
 
@MisterMiyagi 1 idea was generating text to image
 
9:38 AM
@ZahidSaeed That would depend on how much variety in auto-replies you propose you would generate, for what scenarios, how much knowledge of the customer it would have, whether there's any creativity involved etc. But yeah that seriously doesn't sound like ML. (Give some specific examples if you disagree.)
 
@smci What if an email has attachments?
 
@ZahidSaeed You tell me what if an email has attachments? The incoming customer email? The auto-reply email? Either? Both? What type of attachments? Is there any parsing, OCR or understanding involved? Can you please give specific examples of what you're proposing? (e.g. "If the customer mails in a contractor timesheet (XLS/PDF), we estimate their monthly/annual income then recommend appropriate investment products" - which is still not really proper ML - we can't read your mind)
 
Okay
 
Well what are all your classmates doing?
 
Some are doing game development, some are making a simple android app
1 advisor suggested doing drowsiness detection using facial expressions through a camera
 
9:45 AM
@ZahidSaeed Ok well brainstorm some specifics, then propose them. What is a recent issue you or someone you know had where (say) image classification could have helped?
 
and then notify the driver by:
1. Vibrating their seat (requires hardware)
2. Shout a beep
 
@ZahidSaeed So what's your question? Whether we can suggest a more interesting project?
 
yes, please
 
@ZahidSaeed Like I just said above: brainstorm some specifics, then propose something. What is a recent issue you or someone you know had where (say) image classification could have helped?
 
I need a suggestion for more interesting project
 
9:50 AM
@ZahidSaeed Yes we already got that. Can you try to answer my question...? do something with a bill? train ticket? financial document? pharmaceutical prescription? eyeglass prescription? etc.
Maybe go read some other final projects, or startup use-cases...
 
I'll search
I'm thinking actually
@smci okay
 
cbg
@ZahidSaeed I have got about 5 multimillion $ project ideas. #showerthoughts
 
@khajvah Share some then :)
 
@ZahidSaeed they are multimillion $ ideas, you can't just go sharing these :D
 
10:07 AM
these days, I think, implementation is more important than the idea
which is why I am writing JS for a project I don't care about :D
 
@khajvah that's why :D, maybe xD would have conveyed the sarcasm better :D
 
oh yea, even without :D, I would get the sarcasm. Silly me, went all serious and stuff
 
10:26 AM
ulids sounds cool
 
10:38 AM
offtopic / asking for offsite resource stackoverflow.com/questions/63685668/…
 
@MisterMiyagi closed
 
11:25 AM
@python_learner I have an answer that touches on that and other things, that you should be able to copy/paste and run. I also keep a reference file for these kind of things - here's the relevant part
 
11:55 AM
Can anyone here tell me how to force subprocess.call to error when the subprocess fails rather than just carrying on?
 
Use check_call instead of call?
 
you can also use subprocess.run(..., check=True), if you prefer to not remember a method for each special case.
 
@Aran-Fey This seems to work. Thanks Aran
@MisterMiyagi Is there a benefit to doing it this was as opposed to Aran's? e.g. would the return a proper error without doing a try, except subprocess.CalledProcessError as e?
 
what do you mean by "return a proper error"?
Exceptions should never be returned, only raised. That's their point.
Otherwise, a bare subprocess.call returning a non-zero returncode is already what you need, no?
 
@MisterMiyagi "returned non-zero exit status 1" is what it rerurns right now rather than the error of the actual subprocess. I've tried both ways now and they both result in this same error so next I'm thinking of trying to do the try, check call method
 
12:07 PM
What do you mean "error of the actual subprocess"? The only way to communicate failure for a process is the return code, there's nothing else
Are you trying to capture text printed to stderr?
 
If your process is a Python process and you want its traceback, you are looking for multiprocessing, not subprocess.
 
in this case the subprocess is a python process and I'm trying to get back the Python error
 
what even is a python process? you mean a process running a python program?
@MisterMiyagi this sounds like good advice
 
Isn't multiprocessing a type of threading? I'm not looking to run the processes concurently but to trigger the other process to run as if it were double clicked directly
 
Then you could import the module and call the function
module is a weird word
 
12:18 PM
@JamesMcIntyre Ugh. Why? What advantage do you have from a little window popping up and vanishing to oblivion later on? Taking all its information with it? You likely do not want it to behave as if double-clicked on.
What feature of "run as if it were double clicked" do you actually need?
 
blog.codinghorror.com/sorting-for-humans-natural-sort-order seriously natural sort should be part of Python in 2020
something like a.sort("natural") would be nice. But well I'm too lazy to add it so I can't complain I guess and just be happy that there is natsort
 
@MisterMiyagi I need to it take the dependencies which are in the same folder as it's self. I've now managed to get it working using the subprocess as this is what you recomended a previous time
 
@JamesMcIntyre There is so much to learn and even if I wanted it's impossible to just impart knowledge fast onto another person. Makes me really feel secure in my job :) So many paths and mistakes to make before things become clear. Happy learning. Please don't take offence, I'm just kinda marbeling at the wonders of learning and our human knowledge represantation. Also I think you misunderstood MisterMiyagi last time
 
@Hakaishin Yes, this is what I was prevously doing. I used a veriable import statment (import) but doing it that way reulted in qued proceses after it not picking up their dependencies for some reason.
 
@JamesMcIntyre Not sure what you mean, you are gonna need to use more precise language or show an mvce
 
12:32 PM
def Run(ImportName):
    try:
        import os #Currently not working (this bit of code is designed to bring working directory into running project)
        CL = os.getcwd()
        os.chdir(ImportName + "Source")
        import os.path
        import subprocess
        if os.path.exists(ImportName + ".exe"):
            subprocess.call([ImportName + ".exe"])
        else:
            try:
                subprocess.check_output(["C:\\Users\\" + os.getlogin() + r"\Documents\WPy64-3771\python-3.7.7.amd64\python.exe",ImportName + ".py"])
 
Also foo.remove("bar") Should not throw a ValueError. 99% of the time I want to remove something in a list I don't care if it's not there and the code looks so ugly with all these try excepts. If it is a queue or a stack I can see it throwing an error, but in a list. meh
 
I get that I'm not as good at Python as you guys.

I've tried to help a few people on Stack who are newer than me on Python. What specific recomendation are you making other than my code is "ugly"?
 
@JamesMcIntyre your missing the c in mvce
 
So essentially you want to run a python script, and it's not working because the CWD must be set to the directory where the script is located? If you wrote that script yourself, fix it
If you didn't write it yourself, bring out your pitchfork and poke the author with it
 
@Aran-Fey I did write the scripts myself. The code is for a run function and is designed to run qued processes and throw out errors when they happen
 
12:37 PM
@Aran-Fey I loooove doing that :D
Also I would love to pitchfork the tensorflow team and the nvidia team. TF keeps making braking changes between minor versions which is annoying and Nvidia has known bugs which I'm running into which they don't fix for months.
 
Running a python script should be as easy as importing it or calling subprocess.run([sys.executable, 'path/to/script.py']). If it's more complicated than that, the script is broken.
 
[cv-pls] asking for tutorial recommendations stackoverflow.com/questions/63676635/…
 
@Aran-Fey unfornatunly this still gets me "returned non-zero exit status 1." rather than the actual error
@Hakaishin what is foo.remove("bar") btw?
 
Either import it and call the relevant function(s) yourself, or if all else fails, you can resort to using runpy
 
@Aran-Fey Does runpy allow for a .py file to be run so that it detect dependencies in it's own folder (rathr than from the folder your running it from)?
 
12:47 PM
I have no idea what "detect dependencies" means exactly
What kind of dependencies? What is it doing with them?
 
@Aran-Fey use dependencies?
 
Like what, modules?
 
@Aran-Fey I think so... like Selenium and cx-Oracle
 
Why are those in your script directory to begin with?
If you properly install modules with pip you can import them from anywhere
 
12:58 PM
@Hakaishin I'm afraid I'm dyselxic and those types of documents are a challenge for me. This is why I mainly utilise Stack questions/answers and YouTube. But thank you for finding that for me, I really do appreicate all of your help
 
1:15 PM
Wow dyslexia is quite fascinating. The wiki article suggests that there might be also some benefits to it, that it's not strictly a worse larning mode but a different one with benefits and disadvantages. Have you found some benefits compared to other people by having the condition?
 
Thanks for your help guys. I think I'm gonna stick with the subprocess.run(..., check=True) that @MisterMiyagi helpfullly suggested earlier and that that will do for this version. Even though it doesn't give what the error is it is still a great help :)
 
2:08 PM
Is it common for multiprocessing using a pool to give more priority to a couple processes over others? In that processes with the same tasks, some will do a lot more iterations than others.
 
@roganjosh thanks for the paste and the answer, I will try this out and let you know
 
@SB18 Are some of these tasks faster?
 
Ah yeah heres where it gets tricky, theyre http requests
Should have mentioned that
Theyre fundamentally the same task still
Just an api call with a different object id to retrieve
 
But generally the same base service, or crawling through separate services?
Note by the way that threading is perfectly adequate for doing I/O bound tasks such as network requests.
 
Same exact service
Going through a list of installation id's to get information for each installation
 
2:28 PM
So, multiprocessing.Pool basically is a single unprioritized task queue plus workers doing while true: queue.get(). There is no purposeful prioritisation going on.
 
Hmmm, Im gonna guess some requests get like hung up or something
 
However, a Pool is basically pure scheduling entropy, meaning every imbalance in terms of payloads or processing will snowball.
E.g. whenever the Pool is not fully loaded, you get quantisation and fringe effects. This is most notable when starting a Pool with the first process getting many tasks, but may occur later on.
There are also follow-up effects, e.g. if tasks are not uniformly long (e.g. due to request throttling by the remote service) it is likely for one process to accumulate waiting tasks while another keeps processing the sucessful tasks.
 
Alright, thank you very much!
Some more insight there
 
2:46 PM
cbg, quick doubt regarding time conversion from string to datetime. What is wrong with this conversion
datetime.strptime('8/18/2020 11:08:54 PM', '%m/%d%Y %I:%M:%S %p' )
 
3:03 PM
You forgot a / before %Y
 
cbg, all
@JamesMcIntyre Re: ugly code, there's a program called black that will format your code to a standard. For simpler rules that aid comprehension, PEP8 is a good read. Good that you want to help people while you are learning,
@JamesMcIntyre I'm mildly dyslexic, and it took me a few seconds to realise you are dyslexic enough to mis-spell "dyslexic". You have my sympathies - it's easy to be misjudged.
 
3:20 PM
Hey @roganjosh: sorry to keep bothering you about this. It seems that the pinned gCal link is somewhat faulty. Could I ask you to please unpin/repin (I've posted a new calendar invite that is currently starred)
 
3:33 PM
I don't suppose that there's any way we could define the canonical invite, is there? Being a Bear of Very Little Brain I am now confused about the date, though relatively certain if the time ...
 
I have emerged from my chrysalis, having sensed a need for RO action
So we want to pin the invite from 13h ago, and unpin the invite from aug 29 at 15:25, right? I can do that
 
My little brain thanks you.
And may I say what a beautiful butterfly you make.
 
Aw, you're only saying that because I'm 100 feet tall and can shoot gamma rays from my antennae.
 
morning all, (vscode user here)-if i wanted to create a package for easy usability within my team, do I need to publish on pypi/create setup.py/get a license in order for a teammate to import the module on his/her terminal?
in the past any functions ( >100 lines) we just share with each other and def to use
 
Not necessarily. Once you create the package locally, you can copy the files over to their computer and they can install it locally. No pypi required.
 
3:47 PM
perfect. thanks kevin
 
@Kevin thank you very much. You did exactly what was necessary. Sorry, I was AFK - had to forage for sustenance
 
Such is the nature of asynchronous communication
I'm glad I did it right because I think you need a second RO to re-pin a message that the first RO unpinned
 
@holdenweb Thanks. I've found a video on Black and I'll look look into it further. Looks interesting, thank you.
 
@holdenweb There are two meetups: one on Sep 19, and one on Oct 3. The timings are identical in both. Much apologies for the confusion - (I think it was) toonarmycaptain brought it to my attention that even though I'd set the event to be public, it was didn't have world-read permissions, and the only way I was able to unyam this was to copy the event onto a public calendar, which unfortunately changed the cal link
@Kevin 're-pin' was perhaps incorrect word choice on my part. I meant "unpin the old invite and pin the new one in its place"
 
Spare me the details. I spent a long time organising community events of one kind or another. I feel your pain.
 
3:55 PM
@inspectorG4dget pro-tip: chat message links can resolve ambiguity :)
 
@AndrasDeak understood. Thanks
 
@inspectorG4dget That was my interpretation at the time, so it all worked out 👍
Action first, fun arguments about semantics and double meanings second
 
hahaha
 
4:08 PM
I was finally able to retrieve my rubber duck from the office building I haven't been in since The Before Times, and in an apparent karmic boon, today's phone conference was canceled.
Must have been a burst of accumulated Good Programming Energy that had been building up for six months
 
4:28 PM
woohoo! It's possibly not the duck you needed right now, but for sure the duck you deserve :-)
 
 
1 hour later…
5:28 PM
cbg
someone used gspread before? am trying to find a way where i can predefined numbers of cols and rows within existing spreedsheet. the docs is only shown the way for newly created one
 
@αԋɱҽԃαмєяιcαη Yup, you can do that by specifying a cell range
The only thing to watch for is that the default page size is 1000 rows (I forget how many columns). If you need a range bigger than that, you'll need to extend the number of rows before creating the range (unless they've since changed it; I'm going back like 4 years)
 
@roganjosh Oh, Hi rogan, hopefully you are doing well. long time not talking.
yes it's 1k actually
 
@αԋɱҽԃαмєяιcαη I'm good thanks, and you? I can try dig out an old answer of mine about doing just this, but I think the code is probably pretty poop these days. Maybe one day I'll revisit it
 
am trying to write the data to the sheet according to len(cols) and len(rows) so that's will safe me from getting empty cols and empty rows
 
thanks for mentioning this. I'm reading up, and might suggest that we use this internally at work
 
5:37 PM
@roganjosh not so good this days, especially my mom passed away recent month
 
@αԋɱҽԃαмєяιcαη oh, I'm really sorry to hear that :( Take care of yourself mate
 
@αԋɱҽԃαмєяιcαη very sorry to hear that. The flag flies at half mast
 
@inspectorG4dget I wasn't online. From a quick scan, I think Kevin has since got it all back in line for you?
 
@inspectorG4dget that's the life yea
 
5:38 PM
@roganjosh yup. All quiet on the <direction> front
 
@inspectorG4dget is this in re: gspread or are you replying to an older convo?
 
@roganjosh that's gspread
@αԋɱҽԃαмєяιcαη yup. Circle of life and all that. For what it's worth, this room was a huge comfort for me when tragedy struck my mom some years ago (she's doing better now). So if you need to chat...
 
Ah, in which case, it's a really neat little tool. Back when I barely knew how to code, I had a shared sheet and people could copy/paste a product code into a particular cell in the sheet and I could poll the sheet remotely every 2 secs to see if there was a new code, then return all data entries
Oddly, every 2 secs, 24hrs a day didn't even get me close to the Google API limits
 
@inspectorG4dget that's what am doing now is trying to busy myself so i can improve my mood
 
whoa! that's pretty impressive
 
5:43 PM
Although, there is also a limit to the number of rows that you can write per batch. <picks brain> IIRC, I used to return up to 3K results but each write had to batched into 50 rows, so it takes a min to complete the process
 
@αԋɱҽԃαмєяιcαη I've found that channelling huge amounts of energy like that into an engineering project tends to lead to some pretty impressively large results. I remember building my first Hangman solver in this way
@roganjosh I see a fantastic opportunity of asymmetrically throttled read/write processes here
 
gspread is a great lib but they missing multiple things to be sorted out. if you created a newly spreedsheet so you can define number of rows and cells. but for existing one. you will need to play somehow to sort that out. even you know that each time you keep overwriting the data. the 1k rows keep extend empty rows
 
@αԋɱҽԃαмєяιcαη and indeed. Finding something to occupy your mind seems like a good idea to me
 
5:56 PM
that's what am having issue with it. as you can see the total number of data is 589 rows. and each time i overwrite the sheet. i keep see an extended number of empty rows. for example right now is 2361 and if i overwriting it again now so it's will keep be extended.
 
@αԋɱҽԃαмєяιcαη that's a limitation of the Sheets API I think. I'm relatively sure you don't have to extend by the full 1000
 
my data rows is approximately 600 to 700. so i don't need to have empty rows each time.
 
<sigh> I guess I can't just rely on my memory now. i'll have a poke through the docs in a sec
Ahh, ok, now I understand
 
I've seen your post but it's away from my issue
@roganjosh got it?
they have this option only for new created work sheet
 
Just outside for a min. I have a theory but I don't think you'll like it. Can you give me some idea what part the googlesheet plays in your process?
 
6:11 PM
C:\Users\Dell>pip install --python=C:\Python38\python.exe PyQt5 I m trying to do this. Does someone sees any error in this line?
 
i was trying to work within same sheet but looks like the only solution is to work on new sheet each time so the dimensions issue will be sorted out.
 
anyone know if I can set dicts as enum values?
it turns out I can!
 
sorry to butt in with a question: trying to create a package on vscode here. where do i add the necessary import modules when writing my package.py code?
 
i generally just use .py on jupyter notebook but recently shifted to an ide as its more robust
 
6:26 PM
I don't understand the question. When you want to use a module, you import it. Nothing about that changes just because you're writing your own module
 
@jamest Are you asking how to specify or install dependencies of your package?
 
@MisterMiyagi correct!
@Aran-Fey myb. misphrased. ive tried adding the necessary modules before and after my def ():
but vscode doesnt seem to be able to import these modules to run my code properly
 
Are the modules installed?
 
yup
ive installed the python extension in vscode, but otherwise the modules are in my environment
use it frequenlty in notebook
 
What do you mean by "the modules are in my environment"?
 
6:31 PM
Hmm, I'm not sure how vscode interacts with virtualenvs
 
Usually, IDEs use isolated Python runtimes.
 
-facepalm- my pythonic speak is horrible. pls bear with me
usually i write my code in jupyter notebook and save as a .py ; then im able to import the module into a new workbook
trying to do the exact same thing but using an ide instead but having diffuclites first importing the modules i need to run my code
 
So they're not installed at all, they just happen to be importable because all your notebooks/scripts are in the same place
 
You're probably using the global Anaconda environment you have in jupyter. It's a bit tough to understand how you've configured VSCode; have you actually created another environment for this project?
 
@Aran-Fey you're probably right...
@roganjosh nope i havent. probably will run into errors if i do, im guessing based on how ive installed everything
let me youtube first. see if i can educate myself a bit more first. thanks
 
7:10 PM
<grumble grumble> this can't not be a dupe? I can't seem to find it, though. I'll answer it if not but maybe my google-foo is failing
 
Is there a canonical for "I ran my benchmark only once, why is the JIT slower than regular code?"
 
@smci this is a totally unofficial hangout. There's absolutely no set agenda (nor is it mandatory). It's more of a "let's see other people's faces because it's COVID and we might like to informally chat with the people we spend so much time with". The linked gDoc has a list of talking points, should the room ever get quiet, but there's no mandate that every (or even any) topic on that document should be discussed
 
 
1 hour later…
8:38 PM
cbg
 
stackoverflow.com/q/63695130/4799172 typo. I'm beyond fed up with Mureinik too
Thanks
 
 
2 hours later…
10:22 PM
Hey @Dodge, joining PyTexas online this year?
 

« first day (3608 days earlier)      last day (1323 days later) »