@ihavenoidea huh, not a single maintainer/contributor on that comment thread. Pretty worrying. Then again if I understand correctly it's about tensorflow+keras, so it might be non-trivial where the leak is.
Is there a free alternative to "Read the Docs"? From what I understand they don't offer privacy in their free version. Meaning, whenever you upload something it's necessarily visible?
One comment: *"Yeah, semantic web really hacked the brains of academic-facing bureaucrats. It fell into this giant gap between what administrators don't know about business and what they don't know about technology... a gap big enough to shove every utopian idea about "an effortlessly integrated, data driven society" into.* *There's no such thing as "right" way to represent any given data stream, just ways that are more or less suitable to specific tasks and interests. That's why HTML failed as descriptive language (and has become fine-grained-formatting language), and it's why symantic web…
i thought we just include it in the directory to make the directory read as a module
import os
import importlib
import inspect
import sys
from dataparser.parser_interface import ParserInterface
def load_parsers():
parsers = []
dir_path = './dataparser'
for file in os.listdir(dir_path):
if file[-3:] == ".py" and file != "__init__.py":
importlib.import_module("dataparser."+file[:-3])
for class_name in ParserInterface.__subclasses__():
parsers.append(class_name())
return parsers
Yes, but rather than manually adding each import, you could write a script that runs through the filenames in the directory, and writes an __init__.py with all of the corresponding imports.
Okay. In that case it totally does not depend on best practice but what kind of shop you are interviewing for. If they want clever h4ckz, go with the dynamic submodule discovery/import. Otherwise, I'd pick explicit imports - writing one import line per class is negligible compared to writing the class itself.
Hii, I have some doubts on python regex. I'm using re.search using the variables(var1 and var2). (re.search(rf"\b(?=\w){re.escape(var1)}|{re.escape(var2)}\b(?!\w)", s, re.IGNORECASE) is that possible to search(re.search) both var1 and var2 values, instead of using or(|) operator.
im searching this in a excel sheet. i need something like, if both val1 and val2 values present in a cell #do something... i have to use regex because it may contains any alphanumeric in excel cell. need to know whether var1 and var2(both) present atleast once
so i can use the if condition like this, `if (re.search(rf"\b(?=\w){re.escape(var1)}\b(?!\w)", s, re.IGNORECASE)) and (re.search(rf"\b(?=\w){re.escape(var2)}\b(?!\w)", s, re.IGNORECASE)):`
@RobertCalove How will you find which parser is needed? Or is this the case where every parser needs to be run until a match is found, or where every parser needs to be run and longest match is found? Use __init_subclass__ in the parsers to have them add themselves to a parser list, or use __subclasses__() on a common base class to find all the parser classes (only finds immediate subclasses, so if there is an inheritance hierarchy among the parsers, then you'll need to do a recursive wrapper).
@PM2Ring I've gone through that answer several times. I'm super-impressed with your ability to get into my thought processes on that one. At some point I'll write up my ears-popping-in-train-tunnels question that we spoke about here a year or so ago, but I get a bit nervous with Physicists :P
I tried spinning up a virtualenv via the cmd in my vscode, but no matter what i try to do with pip i get this error
Could not fetch URL pypi.org/simple/pip: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
@roganjosh Thanks. I vaguely remember you asking about black hole density a while back, and I just threw a bunch of stuff together that I thought was relevent. :) Your ear-popping question should be ok, as long as it looks like a conceptual question. The homework policy on Physics.SE is pretty strict. See physics.meta.stackexchange.com/q/714
@Skyler well, you could update pip but my impression from the few answers I came across suggest that the issue is on the client side, either with not having administrator privileges or being behind a firewall etc. (though the error doesn't really suggest that)
@Hassan Those links were specifically not about Python, but sets in general. The link to the Python sets (and their & operator meaning) is in this message.
I'm so confused by the last parts of this answer, particularly the last line of code. I don't get what Jinja does there, at all. They're suggesting, I guess, that background= is deprecated, but then they change the jinja pattern
@MisterMiyagi any better now mate ? Set mutual to neighbours this will create the set for person1 and person2, then return the friends that set person1 & person2 have in common, then return the length of mutual.
I thought writing a wrapper library for tkinter would be convenient ("I only need to implement the annoying stuff once"), but now I find myself liberally sprinkling calls to update_idletasks() around the code until it somehow magically makes tkinter behave the way I need it to behave
This might be a language problem. The individual pieces make sense, but as a whole they don't quite fit. What do you mean by "Set mutual to neighbours", "the set for person1 and person2"? Both person1 and person2 are not sets. The neighbours of person1 and person2 are sets.
@Aran-Fey Have you considered wrapping tk (or whatever slumbers beneath tkinter) directly?
@MisterMiyagi Mutual is assign to neighbours in friendship, this will return the set of friends that person1 & person2 have in common, then return the length of mutual.
@MisterMiyagi ignore the previous one, Mutual is assign to neighbours in friendship, this will return the sets of friends that person1 & person2 have in common, then return the length of mutual.
@Hassan I don't really understand what you're trying to say. It's not exact. If I didn't know what you were talking about I wouldn't understand the algorithm, for instance.
then again I haven't been following the story too closely
I think someone tried starting a machine learning room a while ago, but I'm not sure that took off. You can also look around at chat.stackexchange.com for other sites on the network
okay... no need to give any details here nor do further investigation... please just raise a flag on one of their comments so I can identify privately what user you're referring to
OK @JonClements I flagged something, let me know what you think
Do let me know if I am rigthly concerned by that, or I should disregard it in the future. I just think that it contributes to the site's reputation as unfriendly.
There are well-known veteran curmudgeons whom you can't do much about. They sometimes get suspended for a week or a year. In any case the only thing you can do is flag for a moderator (or just flag each comment as unkind or abusive as necessary).
@Nicolas Thanks for being concerned. Note that you won't necessarily get direct feedback but it'll be looked in to. If I might add though, while I appreciate you're trying to help, perhaps given your concerns, the comment you made on the post you flagged was best not left - I think it's perfectly fine, but sometimes it's best to not draw attention to yourself and just flag
@NicolasGervais I've marked your flag as helpful... looking at history - the mods are well aware of the user so errr... yeah... you've done what you need to and we'll see what happens moving forward - without targeting the user, if you happen to notice such comments again, just flag accordingly and further evaluation can take place etc...
@NicolasGervais meh... that's just rubbish... everyone knows it's "ssssnake_cassssse"... :)
@NicolasGervais Thanks for helping! Have a great weekend too - thank you! Feel free to drop by whenever, we're a friendly bunch that love Python stuff!
Well, I leave a lot of comments on stuff that gets roombaed, those definitely get deleted. Not sure about manual ones...I do delete a few but rarely. I used to leave helpful comments to lazy or confused askers which can probably be seen as unfriendly, especially these days.
although I do try to go out of my way not to be hostile toward most users
I've seen plenty of harmless-looking comments of mine disappearing into the void for no obvious reason, those were probably all stray unkind flags
I don't like walking on eggshells and sugarcoating criticism, so I'm not exactly "welcoming" by today's standards
I personally don't even bother. It came to the fore a few days ago when someone downvoted my answer because it didn't solve their unrelated problem that I'd never seen, and yet asked me for help. I'm not shocked that my comment was deleted, but the sentiment stays.
there's that but also, but let's say for instance you had 10 comments on a post, but that post got deleted, the comments wouldn't show up in your history - however if the post got undeleted, they'd come back
@Hassan - you are getting closer. What are the two sets and how are they found? What set operation (set operations were described in the second mathisfun link) is done on them to find the set of friends they have in common? You must use the name of this set operation to get full marks.
@PaulMcG ok thanks mate i will have a look and try figure it out, also the beginning bit mutual would assign be fine or set or initialise ? im getting a little confuse
@Hassan - It is useless to comment that you are assigning to a variable, or computing its length, those are plain to see. It is like commenting x = 1 with "# assign 1 to x" or "# initialize x to 1". "Assign" vs "initialize" is not important, the fact is you are just commenting the obvious. Or size = len(list_of_things) as # get length of list_of_things. This is just clutter. The things that are important to comment are those things that are not plain.
Please just answer the two questions in my previous post, and forget about assigning or length. Your comment will be something like "# find mutual friends by _____________" (fill in the blank, describing the two sets and the set operation to be done)
Another approach that might help would be to research what that '&' operator does. You will find it in the link I sent earlier on Python's set type and what operators it supports.
@wim They're using ther Q&A to spam their URL repeatedly. It's trying to boost their SEO by creating legitimate-looking backlinks.
Hey what memory package do people use to get accurate (deep) memory-usage data, rather thansys.getsizeof? Or manually measuring memory used by each attribute and summing them.
I see some references to pympler. Is it used much?
@NicolasGervais I was getting concerned, that description sounded familiar, then I checked the rep tab and remembered that there seems to be little correlation between the quality of some of my answers and the amount of downvotes they receive.
@PaulMcG hi paul this was really helpful, the set operation we are using is Intersection as we need to find the mutual friends between person1 & person2, the neighbour function create a set returning back the friends they have in common
@PaulMcG the & sign is use to reteive the elements from person1 and person2 that have friends that are link to each other
Ok, you have gotten much closer, I can help you clarify the rest. The neighbour function itself just returns the friends of person1 and person2, each as a set. It is the '&' intersection operator that is actually finding which friends they have in common.
@PaulMcG find mutual friends from the neigbour set of person1 & person2 which will intersection the sets and return the mutual friends they have in common.
person1 and person2 will each have a neighbour set, won't they? You make it sound like there is just one neighbour set. Also cut "and return the mutual friends... etc." Just focus on the sets and the intersection operation.
@PaulMcG no there will be a set for person1 and person2 as we call neigbour for both so in total 2 sets. then the & will show us the friends they have in common.
@PaulMcG neighbours will return the friends of person1 and person2 as sets, then the ‘&’ intersection operator will find the friends they have in common
Ok, I think you've pretty much got it now. Out of curiosity, how do you compare this approach with your original scan of all nodes in the graph? For instance, what if each person only had one or two friends, but the graph contained millions of persons? Bonus points: how would you add person3? or person5 thru person10? And get the friends that they all have in common?