« first day (2672 days earlier)      last day (2294 days later) » 
01:00 - 20:0020:00 - 00:00

8:14 PM
I've visited chat very very rarely. I'm also curious about another thing. How many of you are Data <s>Nerds</s> Analysts/Scientists? Maybe I can find a good home here <3
 
cᴏʟᴅsᴘᴇᴇᴅ does data science.
 
wim
DSM = data science man
glob.glob vs os.walk is not opinion-based. they do different things.
 
@Simon, yeah - he's been a blessing. Just wondering the scope of how many others are out there in the SO universe and active here
 
In search for my first message I find myself right back to October: chat.stackoverflow.com/transcript/6/2017/10/27
 
does this make any sense in python: val = list[i,1]
 
8:29 PM
val = list([i,1]) for me, not as far as I can see it is already a list.
 
I saw it here youtu.be/uwwWVAgJBcM?t=23m21s , I thought the two indices looked weird
 
he's using numpy
 
Melon @Simon
Potato?
 
also mylist[0,1] is more like it, not using the actual list keywor
 
So I've just noticed in the from the video. Don't know numpy so I don't know.
 
8:30 PM
ah. I didn't know numpy affected the bracket syntax
 
@SavagePotato Pineapple your using salad language! Very well thank you : )
 
He did from numpy import * :|
 
no no no don't ever do that
and don't ever call things list
 
I should get myself checked, I missed that ^
 
the list keyword is my mistake..
 
8:34 PM
Avocado! It's banana!
 
I thought arrays where np.array() in nump
 
Good to hear though
 
You should do import numpy as np instead and explicitly use the required module / method in the code, that way you don't mess up things you don't intend to.
 
>>> import numpy as np
>>> a = np.reshape(np.arange(4),(2,2))
>>> print(a)
[[0 1]
 [2 3]]
>>> print(a[0,1])
1
they are np.array()...if you import numpy as np
 
PyQt5 > tKinter?
 
8:37 PM
@excaza oh so the two indices is just a 2d array lookup?
 
I would recommend reading the documentation
 
ok, yes I just found that page. thanks
 
though this page is probably more applicable
 
Can anyone explain how sorting with key works? For example, if I do list.sort(key=lambda item: item[0]*item[1]), is the lambda run on all of the items as a preprocessing step, or is it run in place when comparing two items?
 
8:40 PM
@SavagePotato. Side note: Easygui for very basic things.
 
@ROODAY I'm not sure I see the difference
are you worried about the number of times/order of calls?
 
By that I mean, does the lambda create a new list that is then sorted, or does it do it in place on the original list?
Yeah i want to make sure that providing the lambda doesnt change the nlogn time of pythons sort
 
@ROODAY see Sorting HOW TO
 
Although, now that i think about it, it shouldnt change the O time anyways, right?
 
nope
I mean, I really don't think so
 
8:43 PM
more like O + c => O
 
Cool, I just wanted to be sure
Also @excaza thanks for the link, "This technique is fast because the key function is called exactly once for each input record." pretty much answers it
 
And unless you are sorting hundred thousand entries, don't think it'd matter (unless you are running a cryptocurrency exchange :-p )
 
Okay, fair point
 
@SavagePotato. I hope you do not mean what I thought you meant pyqt is a totally different (and more powerful) GUI than tkinter.
They are both GUI toolkits though
 
9:00 PM
@MattR easygui last I checked was no longer being maintained
Still I still use it on my Python 3.6
 
Afternoon cbg to room 6
 
midnight cbg
although, I'd prefer icecream at this time.
 
9 PM cabbage @cᴏʟᴅsᴘᴇᴇᴅ @AshishNitinPatil
 
oh wait, I'm an adult, I can get one of those right now! brb
 
8AM cabbage
 
9:04 PM
I love using a smart phone typing is so easy
@PM2Ring what is the weather like in Australia? (I think you are in Australia)
I'm longing for sun
 
@Simon didn't even realize it was no longer maintained. I still love it!
 
midnight icecreams are the best
 
Are there actually any benefits to using python 2.x.x?
 
Well documented, thoroughly tested
 
The weather report just said we're expecting 29C in Sydney today, but it probably won't get quite that hot in my suburb, since I'm near the coast.
 
9:13 PM
Mm, true
 
@SavagePotato nope (unless you really need a random library that does not work in py3)
 
@SavagePotato Stubborn user, extensive library and very stable
@PM2Ring thanks I feel much better now ; )
 
@SavagePotato Is that a trick question? ;)
 
I might take a trip to Australia if it doesn't stop raining here
 
I was out in Townsville a few weeks ago, got very sunburned
 
9:18 PM
@SavagePotato Rule of thumb: if you don't want anything you make to be deceased in 26 months don't use it.
 
@excaza Wow! Did you say hi to the Powerpuff Girls?
 
unfortunately I could not find them
 
Townsville is way too close to the equator for me. Coffs Harbour is nice: it's subtropical, but close to the mountains so it generally doesn't get too hot.
 
Cool. Rbrb for a bit. Good film on.
 
Okay, melon, sounds banana. Not really planning on using 2.x.x, but it's banana to know about it.
 
9:34 PM
@SavagePotato what do you mean by "banana" here?
 
Laurel. WHY?!. but I tomato love it.
 
We can add this to the list of sentences that only make sense in room 6: "My salad is rusty"
10
 
9:55 PM
@SavagePotato Yes, using python-2.x helps you understand why no one uses it anymore
7
 
laurel true.
 
I had a rusty cake last week
my GF made the frosting before she realized that the shortening can was rusted
walked in with a spoonful of frosting and asked me if it tasted rusty
I don't know why I actually tried it
 
10:11 PM
I expect you gave a twitching smile and said "no, darling, it's delicious"
also, cream-based decoration for life ;)
 
How come python doesn't have a safe data serialization module that can dump arbitrary objects? Do I really have to write a custom json encoder/decoder?
 
Isn't insecurity the price of generality?
If you have to allow serializing weird_foo_objects, I don't find it hard to imagine that sooner or later someone can come up with corrupt input that will break you
my lack of domain knowledge is hopefully evident
 
But you can just serialize the __dict__ of each object that isn't an int or string or other basic data type, though, right?
 
what do you mean?
 
You can even instantiate the class without calling its constructor, and then just overwrite its __dict__ and you're done, it's deserialized
The point is, I don't have to dump anything dangerous. Basic types like ints and dicts are the only thing that's dumped, and it's possible to deserialize objects without calling any code (like the constructor)
 
10:31 PM
Do you mean that you'd be fine with something safe but more restricted?
 
No, I don't see why I can't have both
 
Are you sure it's possible to deserialize objects without calling any code? I'm only asking because smart people seem to think that it's non-trivial to "fix" pickle et al.
What if the object has code execution as, say, default arguments for certain methods?
 
I think the only thing that could execute code is when I access the class. So for example if I try to load a foo.bar.Class object, that'll cause __getattr__ calls on foo and bar
 
I have no idea how that works
I mean, I guess it should serialize whatever object was returned at the original construction of the object?
 
proof of concept:
class Dangerous:
    def __init__(self):
        raise ExecutingEvilCode

    def __setattr__(self, attr, value):
        raise ExecutingEvilCode

inst = object.__new__(Dangerous)
inst.__dict__.update({'a': 0, 'b': 5})
# no exceptions thrown.
@AndrasDeak What do you mean by "original construction"?
 
10:42 PM
well, I had serialization of instances in mind
 
rbrb, need to get that weekend sleep. Gn.
 
@Aran-Fey as I understand the problem is not something evil that was pickled, but rather a hand-crafted pickle that unpickles into something evil
my impression is that you can't pickle evil_call_to_rmminusfslash(), but you can construct an evil pickle file that on unpickling would do exactly that
 
Well, I don't execute arbitrary code on deserialization. I guess the problem is if something unexpected is deserialized, and then subsequently used incorrectly.
 
I again don't understand "I don't execute arbitrary code". Who's "I"?
 
the deserializer
 
10:46 PM
it does, I think
 
not sure when that would happen. Like shown above, I can create an object of any class without calling dangerous code, and I can set its attributes without calling dangerous code
 
The problem, as I see it, is that it's possible that the user expects a TeddyBear to be deserialized but then gets an AngryDragon instead
 
How is the best way to test if a url works?
OH don't worryI've got an answer
 
also intresting links here stackoverflow.com/questions/10302247/…
as I said I know next to nothing about the subject but my go-to assumption is that the python docs claim it's insecure with big red letters for a reason
and insecure as in "arbitrary code execution"
 
10:53 PM
I'm sure that's true, but I think I can avoid making the same mistakes *shrug*
 
But again what are you talking about? Using pickle or reimplementing pickle?
If the former, the point is that you're not safe as long as third parties can access your pickle files. If the latter, sure, we can debate that, but I don't have any knowledge to have an opinion :P
 
I'd have preferred to use an existing module, but it seems that no safe and versatile module exists
 
that's possible, otherwise I'd expect that would be linked by the python docs as an alternative
 
things like this are why I'm working on 5 projects simultaneously -_-
 
can't you use built-in json?
 
10:57 PM
well, that only supports a handful of standard data types. Custom classes aren't json serializable
 
cbg
 
yup
 
cabbage
 
I’m gonna post some random messages over in the rotating knives room, can someone do me a favor and star them for testing purposes?
 
wim
k
done
can RO's see who starred what?
 
11:00 PM
no
the only power an RO with stars is un-starring
 
(which is what I’m testing, so feel free to star more :P)
 
I am the starloard in knives now
Stay away Kevin. This is now my space
 
Myspace?!
 
ugh....Poke took over
 
wim
is this just a scam to collect stars?
1. get lots of stars
2. ...
3. profit!
 
11:02 PM
relevant
omg this is hilarious
154 PRs
and all those issues. haha
 
I’m basically just rewriting my user script stackapps.com/questions/6239/chat-mass-unstar-script
 
haha I did not even notice that
 
Thanks for helping! :)
 
11:19 PM
Looks useful.
 
very
 
Is this a case of a double negative in numpy (0 and False)? stackoverflow.com/questions/48696344/…
 
11:52 PM
Try understanding the answers of user2357112 and hpaulj
There's no magic, where only interleaves arrays based on other arrays
 
@AndrasDeak the answer by user2357112 definitely did clarify part of it for me, I will read the answer by hpaulj now
 
Lol, OP accepted the worst answer
I'm going to sleep
 
@AndrasDeak there's a mismatch here though, I don't get an error in either case, just a warning
@AndrasDeak eh, another day then. Night mate :)
 
Yes, that's the point. OP has native floats or ints
Numpy knows how to handle inf/nan to a point
1/0 vs 1/np.array(0), probably
rbrb
 
01:00 - 20:0020:00 - 00:00

« first day (2672 days earlier)      last day (2294 days later) »