« first day (2945 days earlier)      last day (2228 days later) » 
00:00 - 23:0023:00 - 00:00

00:05
@wim but this would discourage a lot of help vamp traffic, and that isn't good for this site's revenue model, of course...
wim
wim
00:44
today's xkcd goes over my head. don't get it
 
3 hours later…
03:37
I feel like I'm missing something elementary somewhere, but here goes:
04:34
Nvm...I was missing something. And I learned something.
:D
I need sleep
05:13
cbg all
06:02
@wim I take it you've never played super smash brothers?
06:37
Any ML pros in here?
I'm trying to figure out how to pre-process MNIST images so that the output of the function would be the same in case of translations of an image: f(an_image) = f(same_image_but_slightly_translated)
Motivation behind this is that I'm trying to design a custom distance-function that would use the output of that function (or maybe I don't even need such a function) that would ideally realize that an image translated by 1 pixel is the same as the one not translated (applying L2-distance-function to those two images would return a big distance, which is counter-intuitive).
07:10
pre-process means vectorization, or actually pre-process?
(not an ML pro though)
it can be anything
it could be "count the amount of pixels in 4 corners and return the 4-dimension vector" or "normalize the image"
so you just have input->(image, image), output->similarity, and that's it?
07:36
I have MNIST, and can do whatever I want with it before trying to apply my similarity-metric to it.
Your diagram, although not exactly clear, seems to indicate that you understood. :)
sounds like a straight forward feature to implement. There should be plenty ways to do it, a simple one would be to split the image into pixel chunks and putting them in buckets. If two images have very similar buckets, they are probably shifted.
You know what I mean?
def chunkify_image(image: List[List[float]]) -> List[List[List[float]]]
# n*m pixel image produces some < n*m chunks
def hash_chunk(chunk: List[List[float]]) -> String
def image_similarity(image: List[List[float]], other: List[List[float]]) -> float
# chunkify both images, hash their chunks, compare how many they share, return share-ratio [0..1]. Done.
07:52
cbg
08:08
@Arne why use hashing, sorry?
You can also just compare the chunks as they are, i guess
Hashing two very similar input would produce two very different Strings, which really wouldn't help, I think
any ideas as of how to chunkify "intelligently" so as to obtain meaninful information rather than just random information?
08:30
If they are shifted, they should hold equal values
anyways, the problem doesn't become much harder if you want it to work with a close-enough-compare as opposed to an equal-compare
The example i used in that repl was shifted one pixel to the right, and with 7*7 pixels and a chunksize of three it gives 0.84 similarity, which is a good start imo
08:54
rbrb, i hope i could somewhat communicate my idea @payne
jpp
jpp
09:50
cbg
What's the consensus here on opinion-based style / design questions on Python?
they're gathering close votes pretty quickly these days. but I always felt Python was designed to be read and so it's a core part of learning the language.
Examples: 1, 2. Meta: 1
10:12
cbg
10:23
@jpp As an opinion, I hate 1 char links, esp. on mobile :P
jpp
jpp
@IljaEverilä, here you go: example 1, example 2, meta 1
Hey, sorry for interrupting previous discussion:^ does anyone have experience with GitPython?
I'm trying to get some commit data (I want to access code files that had been committed in a particular commit), but all blobs and trees inside it have paths pointing toward .gitignore.
This is probably a rather silly question, but I'm new at this and I've been trying to figure it out for such a long time. I would really really appreciate any help
cbg all
jpp
jpp
@coldspeed, There's a reason why people put headings like "Explanation", "Example", etc. The majority of readers (we hope) aren't OP but have come from google. Humans aren't good screen readers, they have low attention spans online, and (mostly) a left-aligned bias, the headings help align people's eyes to what they want at any specific time.
Any good ways to debug a hang that's happening with ctypes? I'm just using libvlc and something is going wrong after I use a Ctypes wrapped method
10:38
@jpp Sure, I just find it weird how it suddenly became a trend, starting with you :P
jpp
jpp
Ha, yes. I do like headings generally (using ### for mark-up), esp if there are alternatives. For experienced users, putting the method name in the title helps give the gist at a glance.
@payne maximum of cross-correlation function?
If two images are shifted you see huge correlation at the shift
Well, 1 - normalized cross-corr for a distance, something like that. What template matching does
Otherwise you could shift the image so that the weighted mean is in the same place, but this probably depends on how your shifts work exactly
@KiokoKey I can't even figure out how to list all the files affected by a particular commit...
Actually, I can
import git

repo_path = r'D:\Users\Aran-Fey\Desktop\folder\coding\python\eventlib'
repo = git.Repo(repo_path)
commit = next(iter(repo.iter_commits()))

files = set()
for parent in commit.parents:
    for file in commit.diff(parent):
        files.add(file.b_path)

print(files)  # output: {'eventlib/README.md'}
git is awfully unintuitive
11:07
I have a silly question. I'm looking into feed parsing for the first time (arxiv.org specifically, which is in Atom 1.0) and I'm trying to decide what libraries to use for this. The feedparser and beautifulsoup libraries both sound appropriate for this; would anyone have a recommendation for one or the other?
@Aran-Fey git is fine. Its commands often have weird/inconsistent syntax.
cbg
11:23
Hi, could someone point me in the right direction for the following?

I'd like to populate a dictionary with all of the functions that have been defined within a script. With the following code, is it possible to populate the data within the `functionDict` dictionary automatically/at runtime?

And, further, how could I manipulate the keys of the dictionary via `input()` (e.g. choosing `f1` (or any another string) as the key for the `function1` function (which would be the value of the aforementioned key)?
def showCmds():
	print(functionDict.keys())

functionDict = {'f1': function1, 'f2': function2, 'help': showCmds}

def main():
	while True:
		selection = input('Selection > ')
		if not selection:
			break
		elif selection in functionDict.keys():
			functionDict[selection]()
		else:
			print('...')
Essentially, I'd like for functionDict to be filled with all of the defined functions within a script. From there- perhaps the script could prompt whether I'd like to define the names of the keys for each function or to allow the script itself to assign keys automatically for each value (which would be the name of a function that has been defined in the script)
I guess you can always parse globals() and pick out functions from there, but I don't know if it's possible to distinguish between functions defined in the given module and the rest (my guess would be "no")
hmm, though function1.__module__ might help with that
how might I implement that so that it feeds nicely into the dictionary?
Anyway, I don't know enough about the subject to be able to help. I could guess but this is messy business and some ways are surely more robust/safe than others
11:30
@waxwing you can write a decorator that would add your function to functionDict
>>> def myfunc():pass
...
>>> {func.__name__: func for func in globals().values() if callable(func) and not isinstance(func, type)}
{'myfunc': <function myfunc at 0x000000000040C1E0>}
There isn't really a goal for this script. I'm simply learning-- and after reading various questions/answers concerning this on SO I've reached the code that I sent above.

Oh! Could you perhaps elaborate a bit more on that please? @marxin ? Could you throw together a bit of code to illustrate how to do this?
hmm
@Aran-Fey imported names need to be excluded I suspect
for each arg command, you would define it as

@arg_command
def showCms():
...

And then arg_command decorator would add this function to your dict
{func.__name__: func for func in globals().values() if callable(func) and not isinstance(func, type) and func.__module__ == __name__}
11:34
Guys anyone well in Saml process please answer this question . stackoverflow.com/questions/53205541/…
I'm still quite a beginner with Python; however, I have read about both decorators and dictionary comprehensions (which is what that last piece of code looks like).

Could you perhaps show me what it would look like -- essentially where to place that in my original code?
Would it be useful or redundant to use both a decorator, such as the one @marxin mentioned- and what @Aran-Fey wrote? What are some pros/cons to each of the two?
the decorator is explicit, you choose each of your functions one by one
Aran's version and what I had in mind is automatic, it catches every function defined in the given module at the global level
Where should I put Aran's version my code? (Apologies, just trying to wrap my head around this)
the decorator would be something like
fundict = {}
def arg_command(fun):
    fundict.update({fun.__name__:fun})
    return fun
@waxwing wherever you want to have that dict of functions
11:42
yeah, I guess update is uncalled for
decorator way is less dirty I would say, globals is more of a hack
yup
explicit is better than implicit, etc.
Awesome! Thank you so much @marxin -- the visual makes it perfectly clear.
And thanks Andras and @Aran-Fey
If I were to use the Cmd module instead of the vanilla input code within main(), would I need to modify anything for the decorators to behave in a similar fashion?
I appreciate your time and help! Cheers
12:08
Explosion is better than implosion
12:53
cbg
13:57
morning cabbage
repcap cbg :D
@piRSquared shouldn't it be named "littlebobbytables"
@PaulMcG he meant you not me ;-)
Hello, does anybody know how to correctly initialize a instance of python SyntaxError class?
@Thiner SyntaxError()
or do you mean to raise it as well?
@piRSquared oops :D
indeed
14:05
@Arne Mmm maybe I just happened to find out the correct way: SyntaxError(msg, (filename, lineno, offset, text))
Although I am not sure whether documentation about this exists
you can print(help(SyntaxError))
@Arne not helpful at all. :D
@Thiner the C source code is the documentation
Oops I just did not happen to have read CPython source code ...
@Thiner how else could you figure these things out.
with C you can read the standard...
with Python "whatever CPython does is the 'standard'"
021
021
14:22
Hello
I have a veeery similar error to this stackoverflow.com/questions/42013053/…
So, I cannot post a question for mine as it will be a duplicate
This question has no answer
I cannot comment to ask the author if he has found a solution by the time as I don't have the needed rep
How do I seek help ?
DSM
DSM
Thursday cabbage for all.
021
021
I upvoted it, but I don't know if it'll make it appear in the stackoverflow feed
Unless it's still Wednesday... then Wednesday cabbage for those people and Thursday cabbage for the rest... cbg @DSM
021
021
I'm peas
DSM has removed DSM from the list of this room's owners.
6
DSM
DSM
14:28
As you can tell from the feed, after much thought I'm tendering my resignation as RO. So long, and thanks for all the cabbage! ;-)
22
Thank you for being a model RO for all these years, @DSM
@DSM and may the Rhubarb be with you
@021 It can't be closed as duplicate if the older question doesn't have an upvoted or accepted answer
@DSM are you going to stick around the room though or is it going to be less and less ?
and I'm sad that you are stepping down, and thank you for the years of services.
@DSM may the kimchi be with you!
DSM
DSM
14:37
@MooingRawr: I'll still pop in from time to time, and I'll still answer questions, but I'm reorienting my hobbies to be less SO-focused. I used to make a lot more PRs to OSS packages than I do now, for example, and I'd like to get back into that.
I see, as long as I can reach you when we win the cup, that's all that matters. We or at least I, support you and feel free to reach out if you need anything
021
021
Oh, ok, thanks @Aran-Frey, I did not know that
DSM
DSM
@MooingRawr: thanks! And don't jinx us. :-P
021
021
Now I'm wondering, should I post my own question to get visibility ? Isn't there a better option since the same problem has already been asked ? Thx
The other option is to start a bounty... if you have the rep
14:47
Just post a new question but make sure you follow the rules and guidelines.
021
021
Alright, thanks, I'm going to create a new question
@DSM sorry to see you go
@DSM but but... you make puppy sad :*(
who will be our Data Science Man
14:59
this is like the death of superman....are we going to get four version of a DSM now?
^^^ See - look what you've done @DSM :)
this is a lot to handle
DSM
DSM
@idjaw: you'll be able to tell it's me if I come back wearing a black shirt.
@DSM with a bit of cabbage poking out the pocket?
/saystoself enough rocking back and forth in a corner... @DSM will be back now and again, won't he?! snap out of pir, wipe those tears away... you have a meeting to go to.
15:12
Once Doomsday shows up, DSM will surely make his come back....What would be the pandas version of Doomsday?
not only did DSM dero himself, I am out of green bean cake :(
Pandas is privatized and to become new API for excel.
I bricked my Windows installation and water-damaged my phone
In Homer's voice: "What a week!"
@vaultah I spilled coffee on my keyboard and phone at the same time yesterday and then spilled water five minutes later
all by the mighty power of my elbow
what a week indeed
@DSM's stepping down is so impactful it started yesterday.
15:33
cbg all
@DSM thankyou for your service :) I genuinely believe I wouldn't be where I am now if I hadn't found this room.
Of course I'm befevered on the floor of my living room instead of at work, so take that with a pinch of salt, I guess.
"befevered"? TIL a new way to say "having a fever"
16:00
I have a strong opinion that my method is better than the one offered up by the competing answer. However, I have a difficult time arguing the point as I see that it may come off as pandering for the accepted answer. I get frustrated when other frequent contributors don't come forth to make their opinions known. I can't get too upset though as I'm guilty of the same thing. On occasion, I find it my obligation to scroll through q&a just to vote without stopping to answer myself.
Thank you for listening to me on my soapbox... stepping off now.
in a whileloop does a return terminate the loop
how would it not?
16:16
how about if it is in a try block and it returns true
What returns true?
the while loop
 try:
        slow = head
        fast = head.next
        while slow is not fast:
            slow = slow.next
            fast = fast.next.next
        return True
    except:
        return False
you don't have a return inside a while loop
and never put a bare except: in your code
anyway, return doesn't throw an exception so it's unrelated to try..except
(try..finally would be more interesting ;))
but this will throw an exception if the while fails
16:22
return leave the function, no matter if its in a loop or not
I feel there are difficulties in your fundamental understanding of how these language constructs work (either that or very bad communication)
Are you working through a tutorial of some kind? If not, have you read one?
what would cause the above exception to return false
depends on what head is ?
head is a linked list
for instance if someone presses ctrl+c while the loop is running :P
an attribute error is more likely of course
but that's why you don't write bare excepts
16:25
it will throw false when there is a circular cycle
but I don't understand how the code gets to the exception
@rick: you are not supposed to add exception handlers unless you expect an exception
if you remove the try..except you will actually SEE what went wrong and even get a nice traceback
well again, first check what type of the exception you get because now you don't even know, most likely its attribute error
@ThiefMaster there is nothing wrong with it. It works as expected
understanding why it works is more important to me
"Working as expected" is not the same as "Nothing wrong with it"
There is nothing wrong with it because it passes all tests
16:28
but it returns False? then something is wrong
maybe your tests simply don't cover this part properly
yes it is meant to detect circular objects
garlic
yeah above /\
@Rick we are walking in circles. Your questions and confusion don't seem to make sense. Please try to formulate a coherent question, otherwise we're wasting each other's time
Note that we started from "does a return end a while loop" then code that doesn't return in a while loop, then "when does the except return false", now "this code passes tests but how does it work?". All this within 10 minutes.
i have the feeling he's catching a recursion limit exception...
or no, no recursion used here..
16:32
it'll be attribute error
i'll ask somewhere else thanks
try #python on freenode. but you'll be told the same
@Arne the link leads me to an empty project ..?
16:53
@AndrasDeak not sure I get it: more explanations or a link to some litterature would be appreciated.
Semi-interesting puzzle that came up while I tried to solve a recent question: given a list of integers and a number x, group the list into sub-lists where each sub-list adds up to a multiple of x. ex. [2, 5, 4, 3, 7] and 7 becomes [[2, 5], [4, 3], [7]]
Pretty straightforward to do by accumulating values in a while loop, but I wonder if there's an efficient one-liner solution
@payne There's no literature I have in mind, just the general concept. This is template matching: docs.opencv.org/2.4/doc/tutorials/imgproc/histograms/…
(assume that sum(the_list) % x == 0)
cross-correlation is a pretty general concept
probably a bit too heavy to compute for a distance metric
haha... listening to Trump having a go at the press...
16:57
[[*t] for i in range(1, len(the_list) + 1) for t in combinations(the_list, i) if sum(t) == x]
Hmm, not sure if that quite fits. Here's another test case: solve([1,6,1,1,5], 7) == [[1,6],[1,1,5]]
And while we're at it, let's have one where not all sublists add up to x exactly: solve([8, 6, 7], 7) == [[8,6],[7]]
@AndrasDeak in itself, my first guess was to just take the image (1), compute its distance to the other image (2). Then take back image (1) and shift it by 1 pixel in all directions and compute the distance of those shited images with (2). The returned distance would be the minimum of all the computed distances.
wim
wim
@Code-Apprentice no
But in practice it didn't perform better than L2 on KNN.
However, somehow, it did better for clustering.
@Kevin
[*{*((*sorted(t),) for i in range(1, len(the_list) + 1) for t in combinations(the_list, i) if sum(t) == x)}]
or
[*map(list, {*((*sorted(t),) for i in range(1, len(the_list) + 1) for t in combinations(the_list, i) if sum(t) == x)})]
17:07
@wim me either. it's a fighting game with characters from all of Nintendo's other games
Those two pass solve([1,6,1,1,5], 7) == [[1,6],[1,1,5]] (modulo type), but they don't pass solve([8, 6, 7], 7) == [[8,6],[7]]
def chunk(seq, x):
    result = [[]]
    for item in seq:
        result[-1].append(item)
        if sum(result[-1]) % x == 0:
            result.append([])
    if not result[-1]:
        del result[-1]
    return result
This is the long-winded implementation I had in mind
Umm... is there extra points for it being absolutely horrendous? :p
woah! I missed something. how does [8, 6] get in there
8 mins ago, by Kevin
And while we're at it, let's have one where not all sublists add up to x exactly: solve([8, 6, 7], 7) == [[8,6],[7]]
@Kevin do they have to be strict sublists? otherwise wouldn't [8, 6, 7] also work
17:16
[[8,6,7]] would satisfy the requirements as stated, but for maximum points you should find the result that has the most sublists
There are some inputs where the expected answer is a list containing one sublist which is the complete input list. ex. solve([7], 7) == [[7]]
Or solve([3,4], 7) == [[3,4]]
wim
wim
the problem doesn't seem well-constrained to me
seems similar to bin-packing (NP-hard)
If it's not clear, it's required that flatten(result) == the_list. So the comparative order of items remains the same.
ex. solve([3,7,4], 7) returns [[3,7,4]] rather than [[3,4],[7]]
my last entry... back to my other distractions
def slv(listy, modulus):

  def pred(t):
    return sum(t) % modulus == 0

  def comby(n):
    prelim = [*filter(pred, combinations(listy, n))]
    return [*map(list, {*map(tuple, map(sorted, prelim))})]

  return [*chain(*(comby(n) for n in range(1, len(listy))))]
>>> def solve(lst, x):
...     out = []
...     [out.append([item]) if not out or sum(out[-1]) % x == 0 else out[-1].append(item) for item in lst]
...     return out
...
>>> solve([8,6,7], 7)
[[8, 6], [7]]
>>> solve([1,6,1,1,5], 7)
[[1, 6], [1, 1, 5]]
almost oneliner...
if it's a single-shot function I could turn it into a lambda with out=[] default kwarg
my last super gross thing should work if I change to modulo
[*map(list, {*((*sorted(t),) for i in range(1, len(the_list)) for t in combinations(the_list, i) if sum(t) % x == 0)})]
17:29
>>> solve = lambda lst,x: (lambda out: [out.append([item]) if not out or sum(out[-1]) % x == 0 else out[-1].append(item) for item in lst]+[out])([])[-1]
>>> solve([8,6,7], 7)
[[8, 6], [7]]
>>> solve([1,6,1,1,5], 7)
[[1, 6], [1, 1, 5]]
sorry for the named lambda
ftfy "Sorry wim, for the named lambda"
wim
wim
you may apologize for lambda, named or not :)
You're right, I should write more idiomatic code. Here it is:
def solve(lst,x): return (lambda out: [out.append([item]) if not out or sum(out[-1]) % x == 0 else out[-1].append(item) for item in lst]+[out])([])[-1]
^ now that's better
should be a space in the signature (lst, x)
17:35
wha! Got [[7], [6, 8]], expected [[8, 6], [7]]
idk I just run the things ¯\_(ツ)_/¯
new interwebs proposal "ltl" (laughing too loud)
DSM
DSM
Maybe something like [[v[0] for v in vv] for _, vv in groupby(zip(seq, chain.from_iterable([[0], accumulate(x % n == 0 for x in accumulate(seq))])), key=lambda x: x[1])]? Corner cases not tested, but something like that should work.
Hmm, looking at it, I think that's just trying to be a more itertools-y version of Andras'.
@DSM yeah... I was thinking along the lines of accumulate and mod 7 and at those points increment a group id... something along the lines of:
from itertools import groupby, accumulate

x = [2, 5, 4, 3, 7]

def f(iterable, n):
    group = 0
    total = 0
    for i in iterable:
        if total and total % n == 0:
            group += 1
        yield i, group
        total += i

res = [[el[0] for el in g] for k, g in groupby(f(x, 7), lambda L: L[1])]
But making f actually somehow in the lambda to groupby :)
Is there an online tool like jsfiddle but for python?
17:46
Heck it doesn't even need to produce [0, 0, 1, 1, 2] but as long as it's something... even [False, False, True, True, False] would do
@erotavlas if you have a google account this might work colab.research.google.com
@erotavlas have you seen this? tio.run/#
Interesting, thanms
What about Repl?
I like that online jupiter notebook, I think that's what I was looking for, gonna check it out, thanks
@DSM yeah... that's pretty much what I've ended up with... First you resign as RO and then you Kevin me... :p
18:02
recbg
so...anyone have some wisdom on why list(dict) and list(dict.keys()) return the same thing?
I blame dict.__iter__
@toonarmycaptain did you expect something else?
>
iter(d)

Return an iterator over the keys of the dictionary. This is a shortcut for iter(d.keys()).
list() calls iter, therefore list(dict) is the same as list(d.keys())
wim
wim
I believe they're asking why it's designed like that
instead of yielding, say, items.
@vaultah I'm not sure what I expected, maybe the same result as list(dict.items), or null.
18:04
¯\_(ツ)_/¯
I wouldn't mind it yielding items, personally
wim
wim
My reason: so that it's consistent with "key in mydict"
Gotta wait for Python 4.0 to make that breaking change though
This is all really because I forgot that dict.keys() is an iterator not a list, and had to figure out why I was getting an error.
wim
wim
If it yielded items, then you would want it to be consistent with "(key, val) in mydict", which is much less useful/common
Or Python Π
I imagine that'ld break a few things, though..
18:07
So what I'm hearing is, for most collection types, for x in y: print(x in y) will never print False, and it would be weird if only dictionaries broke that trend. OK.
wim
wim
@DSM which open source projects are you planning on contributing for, out of curiosity?
@Kevin yeah
for a in container:
    assert a in container    # this should ALWAYS be true
(that code snippet is from bugs.python.org/issue4296#msg75735)
DSM
DSM
@wim: I used to do a lot more with mathy libraries like Sage and data libraries like pandas.
DSMScript!
@DSM wow... Sage... that's a behemoth of libraries :)
wim
wim
seems wes is interested in apache/arrow and pandas needs some love, the issues list is in the thousands
I have not used sage, but I see it uses maxima which saved my life a few times
18:19
@Kevin This is probably a rabbit hole, but...how would that happen?
(absent some threat unsafe stuff, I guess)
wim
wim
ask your nan ...
DSM
DSM
Yeah, np.arrays yield different NaNs each time, and so both equality (natch) and identity matching fail.
I expect built-in containers to behave nicely (except when they contain objects that don't equal themselves), but of course you can write your own classes that violate whatever design principles you choose
>>> class DumbList(list):
...     def __contains__(self, x):
...             return False
...
>>> y = DumbList([1,2,3])
>>> for x in y:
...     print(x in y)
...
False
False
False
<= to be continued =|
18:32
@payne huh, I thought those links were static. Well, this gist should be: gist.github.com/a-recknagel/28fc953b8da407e290fec09310a79b00
19:07
Hmm today I wrote an answer to a post asking how to find all the paths in a tree that satisfy a particular requirement, and it occurs to me that the OP is going to shoot themselves in the foot if they incorrectly assume it only finds paths that start at the root and end at a leaf, and yet I can't be bothered to edit my post a fourth time to add a warning
caveat askor
@Kevin but you're bothered enough to tell us here in a fair few words what you can't be bothered to do? :p
Yes because then they'd say "ok, so where's the code that only finds root-to-leaf paths? I'm waiting" and I'd have to redouble my efforts to get the single upvote that's been dangled before me like a carrot on a string all day
Your answers are an order of magnitude higher quality than most on this site, they'll survive I'm sure
wim
wim
19:31
heheh. 🥕
lunch cabbage
19:49
@Kevin ...tempted to find the post and unartributively quote you in a comment..
Don't cross the streams
Wow... I realize that the use of "unartributively" is a mere typo but if you Google that word you get absolutely nada. Which is odd considering that "asdfsadf" will at least return a few hits.
The main site must never learn what a horrible goblin I really am
@toonarmycaptain making up new words, I see =p
That word passes in seven out of ten scrabble games
20:09
because no one wants to challenge it
wim
wim
anyone got something as good as requests-mock that works with urllib too?
If by 'all other languages" he means "the boring mainstream languages" then it's relatively answerable: no, in those languages you can't access a child class' member from a parent class' function.
Python ignores this rule because it's a loose cannon that doesn't play by the rules
Hey guys, I got a little off-topic question if you don't mind. Does anyone know the name of the paradox that goes like this?

You wouldn't call of bundle of two hay straws for a bundle, but you would if it eg consisted of 50 hay straws. So the question is, if you start with one hay straw and keep adding one at a time, when is it considered a bundle?
The sorites paradox (; sometimes known as the paradox of the heap) is a paradox that arises from vague predicates. A typical formulation involves a heap of sand, from which grains are individually removed. Under the assumption that removing a single grain does not turn a heap into a non-heap, the paradox is to consider what happens when the process is repeated enough times: is a single remaining grain still a heap? If not, when did it change from a heap to a non-heap? == The original formulation and variations == === Paradox of the heap === The word "sorites" derives from the Greek word for heap...
sorites paradox ... thanks!
@Kevin wowsers... that was quick :)
20:30
I know a lot of paradoxes
That's because you are one ;)
Except there's one paradox I can never find the article for. It's the one about the two generals in the army that wish to collaborate to attack their enemy at dawn, but neither wants to attack alone because they'll get destroyed. So general A sends a messenger to general B saying "we attack at dawn, please reply to confirm. If you do not reply I will assume this messenger was captured before he arrived, and I will not attack".
General B receives the message and sends a messenger back, saying "yes, we will attack at dawn. Please reply to confirm. If you do not reply I will assume this messenger was captured before he arrived, and will not attack."
General A receives the message and sends a messenger back, saying "I acknowledge that you have acknowledged my request. Now please acknowledge this acknowledgement. If you do not reply I will assume this messenger was captured before he arrived, and will not attack."
At this point - hasn't dawn come and gone? :p
wim
wim
sounds like TCP/IP
It's like TCP/IP except if a packet gets dropped, you and your 1000 closest friends all die
20:35
@Kevin You're welcome.
https://en.wikipedia.org/wiki/Two_Generals%27_Problem
Also - what if the messenger is a spy to start with?
Nice work. Please reply to this message to confirm that you have received my compliment.
It's apparently just known as the "two general's problem"
wim
wim
try copy and paste your paradox into the search bar first, downvote.
Wim that is exactly what I did with Kevins description of the paradox to find the wiki article lol
20:36
I just get a bunch of results about the civil war when I google two generals in the army that wish to collaborate to attack their enemy at dawn, but neither wants to attack alone because they'll get destroyed
This is what I googled:

paradox two generals in the army that wish to collaborate to attack their enemy at dawn, but neither wants to attack alone beca
The paradox of the search engine whose results get worse as you add more detail
haha, kinda stupid
one would expect the opposite
Question: I have Jupyter Notebook installed from Anaconda.
However, one of the libraries I'm trying to use is not available in Anaconda.
What happens if I install Jupyter Notebook via pip3 now?
wim
wim
would you like to hear a TCP joke?
20:39
(or how do I change the libraries-set used by my Jupyter Notebook?)
Yes, I'd like to hear a TCP joke
@Payne It'll explode ... Just kidding I dont know. I am just as incompetent to help as a fried monkey :3
I don't even know what TCP is.
wim
wim
OK, HTTP/1.1 302 Found a TCP joke.
TCP/IP is the communication protocol that computers sometimes use to talk to one another. Maybe it's how the Internet works. This has been "half-remembered Wikipedia Articles" with your host Kevin
20:43
What about the paradox about the guy who googles about the paradox of googling paradoxes and in the process could not find the correct paradox because the paradox he was googling was his own recursive never-ending paradox... (eyes cross and drooling ensues)
@payne you can always fire up a native python virtualenv (venv) and install everything there. Then all the libraries are isolated from the main and other installations
My favorite paradox is the Abilene paradox because I can use it to justify not leaving my house. My least favorite paradox is Newcomb's paradox because it gives me a headache if I think about it for more than fifteen seconds.
Welp, now I have to explore those paradoxes.
Studying can wait ...
21:05
If I have 3 numpy arrays, j, k, and i. and I run shape on them I get back 1045 for each one. How can I create a dataframe from them where j,k, i are columns?
pd.DataFrame({'col1': j, 'col2': k, 'col3': i})
I tried that. I get Exception: Data must be 1-dimensional I think the arrays are 1045x1 instead of 1x1045
j.ravel() etc.
and 1x1045 is as 1d as 1045x1 (it's not)
thanks
that worked
somehow u have all my solutions. you are my favorite person on the internet
ill have to check the docs for ravel vs flatten
@ex080 that's a bit harsh to all the other people, but I'm glad I could help
21:10
Haha, I didn't mean it towards the other ppl. You've been helping me for like the past few weeks now
Everyone is wonderful
:)
too late, you've already pledged fealty to me
haha ok
21:41
I only tell UDP jokes, because if you don't get it, I don't have to repeat it
16
21:54
You can say that again.
22:35
@idjaw When everyone's pandas code produces a SettingWithCopyWarning.
22:48
Little math exercise for today: my wife's tutoring student (4th grade) was given this assignment: How many combinations of quarters, dimes, nickels, and pennies can be made that add up to 30 cents?
I feel discriminated against
Feel free to convert to your local currency, as long as a quarter is 25x a penny, dime is 10x, and nickel is 5x.
00:00 - 23:0023:00 - 00:00

« first day (2945 days earlier)      last day (2228 days later) »