« first day (3285 days earlier)      last day (1666 days later) » 
06:00 - 19:0019:00 - 00:00

7:12 PM
@AmagicalFishy Well, my searching suggests that Kafka might be quite a bit more work to maintain, and that Kinesis is the closer alternative if you want to stay with AWS. At this point, I really can't offer much guidance, though, sorry.
 
oh, no worries. thanks for your help. honestly, the fact that you didn't say "oh my god that will totally destroy [x]" is guidance enough :D
 
mmm, be careful how far you read into the lack of such a response here :P The fact that some issue doesn't pop out to me shouldn't be taken as there being no issue, only that I haven't worked a lot in this space and nothing pops out immediately to me
 
7:31 PM
I get a lot of silence when I ask questions in the C# room and I usually take it to mean "the thing you are trying to do is so far off the beaten path that an ordinary person would never even consider it as a possibility, let alone think about how to implement it"
 
"Groping families by number of family members and last names in Python pandas.DataFrame". Pandas gets stranger by the day
 
Then again sometimes I get silence for a question which, to me, seems indisputably ordinary, like "how do I make unit tests for my web project?"
I can only assume that most C# devs seek this forbidden knowledge, discover that it's impossible because web project classes are effectively permanently private, and undergo a 1984-esque reeducation procedure in order to convince themselves that 80% unit test coverage is fine, actually
 
wim
The recommended code to replace the deprecated imp.load_source function makes me sad docs.python.org/3.7/library/…
 
That won't even work for packages.
 
wim
exec recommended by 714k rep user %-| stackoverflow.com/a/301139/674039
>>> import importlib.machinery
>>> importlib.machinery.SOURCE_SUFFIXES
['.py']
LOL
 
7:50 PM
What's wrong with that?
 
wim
seems violating YAGNI to me, unless the contents of this list is something platform dependent
oh look
>>> !head -4 /usr/local/lib/python3.7/importlib/machinery.py

"""The machinery of importlib: finders, loaders, hooks, etc."""

import _imp
"do as I say, not as I do" 😏
 
You've got a point, but honestly - the import machinery has been changed so often, I don't mind them erring on the side of caution at this point
 
wim
I wonder if the list is writable
can you import kevinscript just by appending ".kpy" ?
 
@wim I wrote a state machine transpiler using pyparsing, and hooked it into import so that you could import a ".pystate" file, and all the "statemachine etc:" statements would generate Python code in place, compile the expanded module, then pass the whole thing to be imported. Presumably this would update that SOURCE_SUFFIXES list to include '.pystate'.
I haven't revisited this code with recent Python versions, so whether this still works or not is unknown
 
Sam
8:15 PM
Hey all, anyone familiar with Selenium? I'm trying to access the site Gumtree via the webdriver but its detected the automation. I'm wondering if there's specific headers that are attached to the chrome session when using Selenium?
 
the first suspect would be the User-Agent
 
Sam
Yeah I did give that a shot
hmm, maybe I need to try and inspect the headers and see whats going on
The site is protected by a bot management company so I imagine its going to be hard/impossible :P
 
8:33 PM
@PM2Ring a non-Ulam prime spiral on a math-related matlab blog that might interest you
 
8:45 PM
Hello everyone!
 
hello
 
I'm now thinking this numpy answer is O(N^3). First for the iteration of every element in the array, second for the in operation but the third part with where and the indexing is throwing me, plus knowing there will be a full memory copy after delete. Can anyone help correct my understanding here?
 
I have a question about string slicing and its time complexity.. when we reverse string with s[::-1], what is the time complexity?
 
@roganjosh yeah, although there's N and M for the two arrays
it might be worse: a == val smells like O(N) and np.where(bool_array) sounds like yet another one
and yeah, the space complexity is probably a disaster
 
8:50 PM
@harvpan almost certainly O(n)
 
@Aran-Fey and space complexity?
 
same
 
space is O(n) for sure
 
I see. Thank you guys.
@AndrasDeak @Aran-Fey :)
 
@AndrasDeak I suspected that too but then I thought my mind had run away with itself on the time complexity :)
 
9:07 PM
I've got a list of Nodes that I need to make into sublists depending on the value of each Node. What would be an efficient way to do that?
Each Node looks like
class Node:
    def __init__(self, v):
        self.Value = v
I was wondering if I could use comprehensions to do it more concisely
 
can we see some example in- and output?
 
node_sort([Node(1), Node(2), Node(1),Node(2)]) = [[Node(2),Node(2) ], [Node(1), Node(1)]])
 
oh, so you want to group them. Use a dict.
groups = collections.defaultdict(list)
for node in nodes:
    groups[node.value].append(node)
result = list(groups.values())
 
what would be a way without using collections?
 
I'm sure you can figure something out
 
9:15 PM
@roganjosh ^
for all intents and purposes they're both at worst linear
 
oh I meant something short
I'm iterating over nodes and popping them as I add them into sublists
 
wim
any quick hack to make a lambda which raises a BlockingIOError exception?
 
I'm too lazy to do an actual fit to get a slope at the end (something like 1.1-1.2 for where, maybe?)
@wim make it call a full function that does that...? :P
from __distant_future__ import raise_function
 
wim
def locked(*args):
    raise BlockingIOError
^ what I have currently
nothing wrong with it, just curious if anyone had a cool hack
 
@AndrasDeak I was just about to ask you whether M x N and N x M would reduce to N^2 in Big O. I can understand them as distinct, but the OP just reverses the loop. In the back of my mind I have that Big O is about asymptotic origins
 
wim
9:19 PM
(I'm testing a code path which catches that exception and does stuff)
 
@roganjosh yes, big O is asymptotics, it's a semantic question whether the two lengths are the same or independent
I didn't actually read the question very well
 
f = lambda: (_ for _ in '').throw(BlockingIOError)
 
ugh
 
you didn't need to say it... we all know (:
 
kudos, but ugh
 
9:22 PM
what I'm doing currently is
def advanced_sort(nodes):
    sorted_nodes = []
    for node in nodes:
        v = node.Value
        sub = []
        for n in nodes:
            if n.Value == v:
                sub.append(n)
                nodes.remove(n)
        sorted_nodes.append(sub)
    return sorted_nodes
 
@Aran-Fey can you make it have a clean traceback? ;)
 
as in, remove the genexp from the stack trace? Don't think so
with CPython specific hacks maybe
 
yeah
 
9:58 PM
ah I had made an error in removal of nodes that I just saw
 
10:38 PM
@AndrasDeak what's the red and green dashed lines?
 
wim
I wonder if CPython will accept a PR to make configparser support the mapping protocol better
>>> d.items()
ItemsView(<Section: default>)
>>> {**d.items()}
TypeError: 'ItemsView' object is not a mapping
^ ytho.jpg
dict(d.items()) works.
@Aran-Fey nicely done
is there any CPython implementation detail there?
 
don't think so
 
wim
I think I'll stick with my def for fear of getting yelled at by colleagues
 
wise choice
 
@Code-Apprentice linear and quadratic power for slope comparison
guess I could've added those to the legend
 
10:53 PM
I was trying to match obfuscated emails and while some are simple, there's one that I can't figure out. How can I match a a d i @ a b c . c o m, not sure how when it's a part of a sentence.
 
it's almost as if the person didn't want you to spam them
 
oh, I'm just trying to practice
 
they always do
 
not really using it anywhere lol
but I'm curious how that one would be done
 
11:40 PM
@aadibajpai what do you suppose someone might want to use that information for?
 
@AaronHall I'm just doing it for myself to get better at regex. Sort of trying to combine readability with obfuscation
not sure how to match that one so far
 
06:00 - 19:0019:00 - 00:00

« first day (3285 days earlier)      last day (1666 days later) »