« first day (3836 days earlier)      last day (1095 days later) » 

1:34 AM
hello
 
 
5 hours later…
raf
6:17 AM
I had python 3.8.3 installed. Now, using this (codegrepper.com/code-examples/python/…), I tried to upgrade the python version:
conda update --all
By this, it got updated to python=3.8.8
If I like to upgrade to the latest version (3.9), what would be best way to do?
Which method should I prefer? stackoverflow.com/a/41536068/7673979
 
raf
6:32 AM
No, I haven't. Should I try this one: conda create -n py39 python=3.9?
or should I put more specific python=3.9.4 ?
In this way, python=3.8.8 will remain installed too, right?
 
raf
6:46 AM
should I keep both? or what should I do if I wanna keep only latest version?
 
7:27 AM
The best way would be to make a virtual environment
@KokHyvv hello. Apologies you didn't get a response; it's generally quite quiet on a Friday night
 
7:49 AM
@AndrasDeak I remember this working theory. My grandad explained it to me and it seemed a bit bonkers even as a kid. Do you know the current replacement theory that apparently catalysed life? I took my eye off the ball on this one
Back when I first joined the room, we had narwhals shooting lightning from the sky. One does have to wonder how the narwhals came to be. But that'll be answered in time, I guess
 
 
1 hour later…
9:21 AM
hello
 
9:38 AM
Hello :)
 
I am getting this error
Access to XMLHttpRequest at 'http://localhost:5003/socket.io/?EIO=3&transport=polling&t=NZVDHlB' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Calling flask-socketio from react end
I have handled cors error
but still gettting this error
how can I solve this ?
 
So you're trying to call another service listening on a different port?
 
yes on the same server
 
I don't think I've seen this error for that circumstance tbh. Is this deployed with https?
 
no http
I am running this application now in my laptop
async_mode = None
app = Flask(__name__)
app.debug = True
app.config['SECRET_KEY'] = 'nuttertools'
app.config['CORS_HEADERS'] = 'application/json'
Session(app)
CORS(app)


# socketio = SocketIO(app, manage_session=False, async_mode=async_mode)
socketio = SocketIO(app, manage_session=False, async_mode=async_mode, cors_allowed_origins='*')
This is my server side code to avoid cors error
 
9:49 AM
Ok, so "No 'Access-Control-Allow-Origin' header is present on the requested resource." is starting to make more sent to me. You didn't do that with the header
 
how can I do that ?
I have allowed all cors_allowed_origins
 
Maybe this?
 
I have tried the two solutions but still error exists
I think there may be firewall problem
Initially, widndow 10 shows a pop up window whether I want to allow the app to public network
I have not marked that option
Thats why, may be I am seeing this error
But I have stopped firewall
 
 
3 hours later…
12:42 PM
Hello
 
hi
 
@ChrisP please review our rules each time before you ask here, seems you're having trouble remembering them
 
how are you @AndrasDeak
 
@KokHyvv fine, thanks
 
good .. i just want ask where i can post my django problem or who can help me with that
 
12:51 PM
You can post it here. It's subject to the rules that Andras linked to, though
 
yes thanks . i just want some info about confirm stackoverflow.com/questions/67067501/…
 
What did you try on that?
You basically need the backend validation step, then a change, and then update the frontend. It's a job for AJAX
 
1:08 PM
okay that's good info thanks .. just last q where i can find exampile for vaildation with ajax
 
1:41 PM
@roganjosh can i use 3rd party app for this job ?
 
1:53 PM
You could, but why?
 
2:07 PM
@roganjosh because i don't know js or ajax so i can't write any line .. so if there 3rd party app it will be easy to me .. or if you can help me with ajax i will be thankful to you
i want confirm new email via link .. like fb or twiiter . when user change email he should active new email to save it in his profile
i have option that allow user to change email but without active or confirm new email i just want active new email
 
I'm not at home so I can't code but this sentiment feels off. How do you code in python? There was a time you didn't know that either
 
2:33 PM
cbg folks
 
 
2 hours later…
4:39 PM
Hello. I believe that I am the only person here!
 
4:59 PM
Yes, tied with a dozen other people
 
 
1 hour later…
6:27 PM
Hey guys
I'm converting Python 2.7 code to Python 3 and I'm stuck somewhere
 
take a look at our guide to formatting, linked in pins on the side
 
:52010333 keep looking at the guide sopython.com/wiki/… and practice in the sandbox
 
Ah thanks, I'll
with open(path_processed_data + 'dic_mincut0.txt', 'wb') as f:
    for key in tkn2idx.keys():
        f.write(key+'\n')
I know it's opening file in write byte mode, and Python 3 is throwing me this : TypeError: a bytes-like object is required, not 'str'
 
@Deep if you really want bytes mode, you have to encode key to have a byte to write
What kind of object is key?
Nevermind, it's a string
Since you're ending up with a .txt file I'm pretty sure you should be opening the file in text mode, 'w'
 
ahh the joys of python 2.7 silently converting bytes and strings for you
 
6:33 PM
Yes, it's a string.
 
@ParitoshSingh no, bytes are strings in 2.7
 
Yes, I remember reading something like that.
 
ahh the joys of python 2.7 silently mixing bytes and strings as the same! better? :D
 
Yes, thanks @AndrasDeak..that's what I wanted to know.
 
@ParitoshSingh much :P
@Deep on python3 you could also do print(key, file=f) and then you don't have to add the linefeed
 
6:35 PM
Our TA suddenly gave us a dataset and told us to fire it on our project, preprocessing of which is handled by code which we borrowed (with full academic integrity) from github
oh, never knew that @AndrasDeak..thanks for the info.
 
that's good, a whole class of people who can now submit PRs to port the library to python 3 :P
 
dear all, is there a good alternative of vpython with its own window (i.e. not in browser?)
I am just trying my hand in 3d objects. I like vpython...as its easy. But always open in browser
 
@AndrasDeak haha..just us though since it's a group project with group of 4 (& I'm that person that does 90% of work lol :P)
 
@Deep my condolences
 
I'm trying to decide whether I knew vpython was even a thing
I think I've settled on "no". Maybe pygame is the replacement for something that isn't in-browser?
 
6:44 PM
Umm...I've stumbled across another problem.
 
What else do we have in our toolkit for 3D rendering? I'm quite surprised that I've not heard of vpython
 
with open(path_raw_data + 'dic_mincutN.pkl', 'w') as f:
    pickle.dump(dic_voca, f)
Getting : TypeError: write() argument must be str, not bytes
dic_voca is a dictionary mapping string (I think?) to integers, having read this : docs.python.org/3/library/pickle.html , I don't know why it's not working.
 
@roganjosh there's a 3d game engine called panda3d that seems to be getting some steam behind it
 
Do I need to open file in 'wb' mode while using it to write to .pkl files?
 
@ParitoshSingh nice! I didn't know about that either - thanks
 
6:48 PM
@roganjosh you have. I think glowscript uses it.
@ParitoshSingh bit javascripty name choice...
@Deep look at the docs of pickle.dump
 
Okay, I solved it. It has to be 'wb'
Yes, @AndrasDeak found it!
 
Great
 
Javascripty or Javay? Are you referring to the SDK?
 
@roganjosh to the name of javascript, the new java spinoff
Which, you know, had nothing to do with java
 
Sure. It became awful in its own special way too.
Actually, that's a lie. I actually have a relative amount of love for both languages until they blow up on me
JS > Java though. Just sayin'
 
6:53 PM
When I was a kid, I had heard of Java and mistakenly learnt JS, I was 15
thinking that I'm learning Java lol
 
@roganjosh not really my point
 
Well, that's better than most 15-year-old mistakes :P
@AndrasDeak I'm not sure I was answering to a point?
I just ambled off the track and started waffling about languages
 
@roganjosh altho I never really learned either :P
 
Oh well. At least it didn't involve things on fire (I guess?) :)
 
> Powerful, mature open-source cross-platform game engine for Python and C++, developed by Disney and CMU
So it's disney and probably not python first and foremost. That might explain the name.
 
7:02 PM
i googled their name a bit and found that apparently it started out as an acronym.
> > Panda3D's name was once an acronym: "Platform Agnostic Networked Display Architecture."[4] However, since that phrase has largely lost its meaning, the word "Panda3D" is rarely thought of as an acronym any more.
 
"To successfully use Panda3D, you must be a skilled programmer. If you do not know what an “API” is, or if you don’t know what a “tree” is, you will probably find Panda3D overwhelming. This is no point-and-click game-maker: this is a tool for professionals" I'm now scared to use it in case I get stuck :D
 
Pandas live in trees, duh
 
I think I know what trees are, but do I really?
 
They started in 2002, pandas in 2008.
 
green stuff, occasionally seen away from cities
 
7:06 PM
Ah, greenlets
 
7:20 PM
Going through their docs I can't tell whether they're world-weary or just arrogant about "beginners"
Anyway, today was an auspicious day; I finally went to a pub. Two, in fact. That's been a much-needed relief from the continuous connection to work
 
Did you bathe yourself in beer? Someone doing that made our news. Such interesting times!
 
I didn't. I'll try harder tomorrow!
 
7:38 PM
My money's on "world weary"
I sense the psychic waves emanating from the quotes around "API" and "tree". The author really has been approached by querents that don't know what those are
I sense more... When the author told them "go learn what a tree and API are, and when you come back, I'll be happy to help you", they got all huffy and said "can't you just help me now? I've got from panda3d import * already, just fill in the rest for me"
 
It comes up a number of times. I can see the point, but also - left unchecked - they created the latest Star Wars and it's just not OK
 
Hurt people hurt people [sage nodding]
In a completely unrelated topic, today I want to get my feet wet with OpenCV, with virtually no prior experience in the computer vision field. I think I'll start by emailing the core developer...
 
Always a good start :P
 
"I don't actually know what your project is used for or what it's capable of, so... Impress me"
And be quick about it, my time is valuable
3
 
Hello,
 
7:49 PM
Welcome
 
Well, the burden is on them to prove the project. You're going to invest £0 (which I think is $0 in the current exchange rate) so they have to "wow" you
 
In Numpy dataset, if we use reshape of input as follows given that dataset originally has 10 rows and two columns. The first column is empty while the second has 10 values.
series = read_csv('data.csv', header=0, index_col=0)
data = series.values
train_x, train_y = data[:, :-1], data[:, -1]
train_x = train_x.reshape((train_x.shape[0], train_x.shape[1], 1))
What is the point here from reshaping input to (10,0,1)?
 
Hmm
 
@Abraheem have you set the correct delimiter?
@Abraheem in fact, please give a MCVE so we can actually run the code
 
Possibly silly question: what is the type of the series variable?
Not rhetorical, I just want to make sure I'm on the right page
 
8:00 PM
this is numpy
 
Great
 
Ok, useful information. But where is your MCVE, and what is the type of series?
 
i think your crystal ball is correct on this Kevin
but i won't spoil it
 
That it's not numpy?
 
I know I often like to whimsically lead querents to the answer via socratic dialogue, but this time I'm just trying to make sure I'm literally looking at the correct documentation page
 
8:03 PM
import pandas as np
9
 
If my questions also happen to perfectly match a socratic dialogue that someone more clueful than me would lead, then that's great, I love to look smarter than I really am.
 
where np stands for no problem. which is also an oxymoron here.
 
I do like to rely on the "I was just being facetious" fallback
 
I was only pretending to be dim!
 
Sorry, this is pandas
series is pandas
not numpy
I am trying to understand how MCVE works
 
8:06 PM
Yep, we worked that out. But if you gave us something runnable it would be really helpful
 
an mcve basically is code that i could copy paste on my machine, without any external files, and be able to just run it top to bottom.
 
Ok, we're getting closer to the facts :-) let me ask a more concrete question. What output does print(type(series)) produce?
 
@Abraheem also, this is closer to the truth but incomplete. what is the exact datatype of series?
Kevin'd
(Socrates intensifies)
 
Let's pincer attack the truth!
 
```
```

series = read_csv('data.csv', header=0, index_col=0)
data = series.values
train_x, train_y = data[:, :-1], data[:, -1]
train_x = train_x.reshape((train_x.shape[0], train_x.shape[1], 1))
```
 
8:07 PM
Closing in from both sides, the Scylla and Charybdis that smashes all problems
 
@Abraheem We have a formatting guide here and also, we can't access that file so we cannot run it on our own machines
 
series = read_csv('data.csv', header=0, index_col=0)
data = series.values
train_x, train_y = data[:, :-1], data[:, -1]
train_x = train_x.reshape((train_x.shape[0], train_x.shape[1], 1))
 
That code just gives me NameError: name 'read_csv' is not defined. Is that the error message you're getting?
 
from pandas import read_csv
series = read_csv('data.csv', header=0, index_col=0)
data = series.values
train_x, train_y = data[:, :-1], data[:, -1]
train_x = train_x.reshape((train_x.shape[0], train_x.shape[1], 1))
 
Now I'm getting FileNotFoundError: [Errno 2] No such file or directory: 'data.csv'
If that's the error you're getting, I suggest you create a file named "data.csv", and fill it with the data you want. That should solve the problem.
 
8:10 PM
Thanks
 
That can't be the error, surely?
 
I helped! With this karmic boost, I feel revved up to work on OpenCV again
 
Is the csv even relevant to the problem? The question is just "Is there ever a reason to do foo.reshape((*foo.shape, 1))?", isn't it?
 
alas, Socrates is dead after all. It was just a dream.
 
Hmm, the official OpenCV introductory tutorial says I should start with using namespace cv;, but I'm getting a SyntaxError. Maybe it's a 2.7 thing?
 
8:13 PM
I just realised i recognized Scylla and not Charybdis
@Kevin oh dear :D go for opencv python docs instead of just opencv
 
"I'm trapped! Between Scylla and... Calm open water, actually! I'll just go that way then."
 
@Kevin It's probably a syntax introduced by a brand new PEP
 
Is it weird that the only reason i recognized Scylla is because of a game i used to play a little (okay fine, a lot) as a kid?
 
Not at all. 95% of all the cultural icons I have knowledge of, I absorbed from children's entertainment
 
I have no idea what Scylla is, so I'm gonna go ahead and say "no"
 
8:15 PM
Games are excellent sources of information about greek mythology, ask any God Of War player
 
Greek mythology, sea monster similar to hydra
 
(Or is that Roman? You know what I mean)
"between Scylla and Charybdis" is a fancier way of saying "between a rock and a hard place"
 
ohh!
i think i now remember what Charybdis is. whirlpool?
 
Yeah.
 
or well..the greek variant of the whirlpool. with teeth....lots of them
 
8:17 PM
> Scylla and Charybdis were mythical sea monsters noted by Homer; [...] Scylla was rationalized as a rock shoal (described as a six-headed sea monster) on the Calabrian side of the strait and Charybdis was a whirlpool off the coast of Sicily. They were regarded as maritime hazards located close enough to each other that they posed an inescapable threat to passing sailors; avoiding Charybdis meant passing too close to Scylla and vice versa.
@Aran-Fey That may indeed be the root question, but because I am a simple man, I couldn't be sure until I had some clarifying details. If that is the question, I bet one valid answer is "yes, if you want to call a function that requires data in that particular shape"
Valid yet unhelpful, because it is true of literally any object
There's also a possibility that the real question is "reshaping in this way gives me an ndarray that doesn't seem very useful. What reshaping operations should I perform instead to produce a useful ndarray?"
Which would require an extra session of XY problem unpeeling in order to determine what counts as useful
Useful could mean "transposed", or "with some rows filtered out", or "in the correct shape for passing to contoso.frobnicate(ndarray)"... It's the wild frontier
 
8:32 PM
fun fact: neither transposition nor row filtering are reshapes
 
Sure they are, they change the shape!
 
8:52 PM
I haven't so much as breathed in the direction of the pandas tag in weeks and I should say it's been quite refreshing
 
9:35 PM
@roganjosh okay so you can help me with that please
 
:/
 

« first day (3836 days earlier)      last day (1095 days later) »