« first day (4527 days earlier)      last day (644 days later) » 

03:45
@Jake Like this:
a = list(enumerate('abcde', 1))
print(a)
b = list(zip(*a))
print(b)
c = list(zip(*b))
print(c)
# output
[(1, 'a'), (2, 'b'), (3, 'c'), (4, 'd'), (5, 'e')]
[(1, 2, 3, 4, 5), ('a', 'b', 'c', 'd', 'e')]
[(1, 'a'), (2, 'b'), (3, 'c'), (4, 'd'), (5, 'e')]
 
3 hours later…
06:59
hi everyone, can someone please assist him with this issue here? - stackoverflow.com/questions/75648314/… - I can't wrap my head around this, and am stuck since the last two days. What is it that has gone wrong here?
07:11
@Ankit Please do not post images of text. See meta.stackoverflow.com/q/285551/4014959 Post the actual text so that it can be searched, and so that people can easily copy & paste it.
@PM2Ring will keep that in mind, meanwhile thanks for the prompt reply, Hope this works for me.
@Jake It says right at the top "This page is part of the SQLAlchemy 1.4 / 2.0 Tutorial."
It did also exist in 1.3 but it looks like the syntax is different
07:35
Still, I guess select has been around a bit longer than I expected and the API is really broad. Unifying the different methods seems like it's a good thing. I'll probably be starting again with the ORM soon so I best get reading
@Ankit my best guess is an anti-virus preventing the DLL from being loaded. Has anything been quarantined?
@roganjosh that's what I am currently thinking too, as things were going smooth beforehand. But then, none of my team mates are facing this. So it has to do with either my system or the environment(Python) I am working in
It mentions rust in the traceback and there's a lot of recent activity with people rewriting portions of their code from C to Rust for a whole host of reasons. Find out what version your colleagues are using and install that - it's possible that the DLL for the latest version hasn't yet been whitelisted by your antivirus
08:10
I realized when I installed tkinter using sudo apt-get install python3-tk it landed on my older python3.8 installation. Id like to use it with my pyhton3.10 installation. How to make tkinter work on my python3.10 installation?
I need to keep the pyhton3.8 installation for old shitty stuff that is dependent on it
08:21
python3.10 (or whatever command you are using to launch correct python) -m pip install ...
actually isn't tkinter built into python?
@matszwecja not on stuff like ubuntu
@Dwadelfri How did you install python3.10?
Usually, package managers that omit standard library parts have versioned libraries alongside versioned packages.
@matszwecja This works! sudo apt-get install python3.10-tk always nice with simple solutions
not what I had in mind, but glad you got it working
 
1 hour later…
09:45
should token generated in basic authroization should be same in postman and in code ?
@sahasrara62 I can't think of another way if you are going to verify whether a particular endpoint is working or not. Guys feel free to correct me if I am wrong here.
10:07
You mean the token that's generated by doing base64(username + ':' + password)? Yes, that should always give the same output
10:19
@Aran-Fey yes, in postman, in basic authorization i am giving username and password and with other param it is getting correct token but when i am doing this in python it is throwing me error, as for headers {'Auhtorization': 'Basic <token>'} , here not same token is getting generated, by code
Well, then show us that code
to get token

```
def gen_token(url, username, password):
grant_type='password'
_payload = {'username': username, 'password': password, 'grant_type': grant_type}
payload = urlencode(_payload, encoding='ascii')
headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'grant_type': grant_type,
}
return requests.post(url, headers=headers, data=payload, auth=(username, password))
```
...where's the base64(username + ':' + password) part?
Since this is just a reversible encoding, have you checked that the data is actually the same?
10:47
_string = f"{userName}:{password}".encode(encoding='ascii')
base64_byte = base64.b64encode(_string)
token = base64_byte.decode('ascii')
11:00
is above one is write ocnverision of equivalet java code base64.getencoder().encodetostring(string.to_bytes()) ?
11:24
my bad it is solved now, encoding is correct, issue was with params, thanks
@roganjosh My issue got resolved after connecting to the internal IT team, had to do with some security patching at their end. but glad that I found such a wonderful community here!
Glad to hear that you got it fixed and that you like room 6 :)
11:41
btw why we are room 6 not 3.11 :p
@sahasrara62 aren't you happy that we are a little 'fast' in that regard? :P
12:03
@PM2Ring I am sorry, but due to my company's internal guidelines, I am unable to access this link in my company laptop. But I will remember this point from the next time.
StackOverflow is allowed but Meta StackOverflow isn't? o.0
Long story short, don't post screenshots of code or errors or anything else that is actually text not image
@Ankit if using windows system then change the network setting, where take network from system adapter than the logging software install by your company, you need virtualization avaiable for that though
 
2 hours later…
14:01
@matszwecja The Majesty's Orders!
@sahasrara62 I will keep that in mind
@Ankit I'm assuming that the recent stars on posts are from you? Please note that we don't use stars in chat the same way that we use upvotes - they are generally reserved for things that are likely to be interesting to the rest of the room users
@roganjosh Got it!
Thanks :)
 
1 hour later…
15:41
When I'm loading a csv, its telling me there is something off in the file somewhere (weird character, etc.) I got it to load using this encoding='ISO 8859-1' but I want to know how to find where it is. The error message is : UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 15: invalid start byte
the only position 15 I know is by counting characters/spaces from start to that or if it is meaning column or row. I don't think that's what it is. I have been googling. Is there some debugging call I can use that will search for it and show me?
@CelesteWilson open in binary mode, read contents, slice first 20 bytes
It's the characters row by row, but with non-ascii values the bytes usually stop corresponding to characters
IIRC the position does mean the number of bytes from the start of the string. If the fifteenth byte of your file doesn't look all that unusual to you, perhaps the csv module is splitting the file into smaller segments before decoding each one. Then position 15 might be the 15th byte on some particular line.
@Kevin then the error would say so
It's probably a column header
Hmm, I should back up a second. Are you using the csv module to read the csv? Or are you just opening a file that happens to have the extension "csv", using open()?
15:56
its a file that has extension .csv
let me try the csv module
My initial expectation is that it will give a similar error, but encoding-related problems always defy my expectations
0x92 seems to be windows specific quote ( ' )
"U+2019 RIGHT SINGLE QUOTATION MARK" is not exclusive to Windows, although it seems Windows has some funny ideas about how to encode it
16:42
unicode would be a lot easier to deal with if the internet weren't swamped with so much confident misinformation
 
2 hours later…
18:12
Hello everyone, I have a two class. There are 100 images in each class. I need to classification. What model and techniques can I use ? I can't find any more images.
 
2 hours later…
20:36
Turns out this was a duplicate stackoverflow.com/questions/75689395/…

« first day (4527 days earlier)      last day (644 days later) »