« first day (2789 days earlier)      last day (2174 days later) » 
00:00 - 21:0021:00 - 23:00

9:02 PM
@Aran-Fey Thank you very much, works so good now and no more hasle of encoding/ decoding junk yet :)
 
no problem
 
wim
@SShah generally there will be a response header like Content-Type and/or Content-Encoding that tells you what to use.
 
@wim I guess you changed to a deque to avoid using a list, but deque.remove is pretty slow if the item's in the middle. Of course that won't matter for very small k, and as you say your algorithm itself is slow for large k. FWIW, I have seen that user before. I'm hazy on details, but I seem to remember their code being a bit cumbersome.
 
@wim I see, I seriously feel stupid, because I have been using requests now for over an year, and I have always had to deal with the encoding/decoding issues due to using r.content, and now I find out theres a simpler solution, damnnnnn xD
@wim Also its strange my response header shows content type is utf-8 but it fails to decode it
 
Maybe it's gzipped? Does requests automatically unzip the content?
 
9:10 PM
@SShah General rule: don't decode bytes as UTF-8 unless you know that they are, in fact, UTF-8 bytes. ;)
 
wim
@PM2Ring I found no measurable difference
>>> timeit k_largest_deque(nums)
261 µs ± 10.2 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
>>> timeit k_largest_list(nums)
261 µs ± 9.56 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
 
Turns out it does automatically unzip the content.
 
@PM2Ring haha I hate decoding/encoding anything coz I always find errors ;)
 
@wim Ok. Was that with k=3? How does it go for say k=30?
 
wim
you're right, list is slightly better with k=30
>>> timeit k_largest_list(nums)
445 µs ± 9.89 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
>>> timeit k_largest_deque(nums)
461 µs ± 9.68 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
 
9:12 PM
was recently trying to use microsoft graph api to retreive my profile photo (via javascript not python), and I was struggling sooo much to decode the returned binary data for the photo, that I just had to give up xD
 
Well... photos usually aren't text
 
anyways thanks alot all, I will go now and carry on with my project. Cheers :)
 
@SShah BTW, requests can also do automatic JSON decoding, in case you ever need that.
 
@Aran-Fey Nope there not, microsoft returns them as binary, and was struggling to try get it to render on the webpage.. tried all sorts of solutions, such as converting to base64, using blob urls etc.. but after a week of trying just gave up.
@PM2Ring Cheers, for the first time today i think I properly looked at the requests module guide online @ docs.python-requests.org/en/master, and I am learning alot of things I never new about it
 
@SShah Response encoding info isn't necessarily reliable. The HTML <meta> data may be more accurate, but it can also be science fiction, e.g. clawi
@SShah Response encoding info isn't necessarily reliable. The HTML <meta> data may be more accurate, but it can also be science fiction, e.g. claiming the file is iso latin1 when it's actually a Microsoft variant.
 
9:21 PM
@PM2Ring Yup I agree, thats why I say I always hate having to encode/ decode anything, because I often run into issues which can get annoying to fix. xD
 
Gotta love the web
 
yeah, who ordered this anyway
 
But then again trying to fix those issues often is what motivates me to continue working on the project xD
Ok thank you all for the help, I got to go now. Good night and enjoy the rest of your day :)
 
rhubarb
 
From en.m.wikipedia.org/wiki/ISO/IEC_8859-1 It is very common (on the Internet) to mislabel Windows-1252 text with the charset label ISO-8859-1. Most modern web browsers and e-mail clients treat the media type charset ISO-8859-1 as Windows-1252 to accommodate such mislabeling.
 
10:20 PM
Quick check: go to your "edit profile and settings" page and hang around for like 15 seconds. Does anything weird happen to the location field?
whoops, that link goes to my userid specifically
 
Yup, something weird happens
 
Interesting. That's almost but not quite what happens for me, perhaps because only one of us has a location filled in.
 
and yes, I see what Aran sees with a faint "Oops, something went wrong" underneath
 
Relevant JS console output:
 
and I don't have it filled
 
10:25 PM
> Google Maps JavaScript API error: RefererNotAllowedMapError https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error
Your site URL to be authorized: https://stackoverflow.com/users/edit/1222951
 
the uprising has begun
rhubarb
 
wim
@Aran-Fey same here
In light of the big github/microsloth news, somebody made a Windows XP theme for github
 
10:41 PM
I'm so glad that CSS modifications are being made as chrome-only extensions instead of just putting the CSS up on stylish for use with Stylus
 
hmm, I think my sarcasm detector may be broken...
 
00:00 - 21:0021:00 - 23:00

« first day (2789 days earlier)      last day (2174 days later) »