Live data from Hacker News

StackOverflow Importer – Import code from Stack Overflow as Python modules

github.com

41–50 of 87 posts

Re: StackOverflow Importer – Import code from Stack Overflow as Python modules

#41

Earlier quoted context omitted.

I'm kind of shocked how many people here are talking as though they would actually include this in a codebase.

What if, somehow, there was a guarantee that the code can't harm your machine -- would you use it then? This isn't a joke.

It's not just about harming your machine - it can harm your* data, or data passing through your* system!

* Where "your" can mean you, your employer, your customer, another company, etc.

Re: StackOverflow Importer – Import code from Stack Overflow as Python modules

#42
post #11

Reminds me of stacksort[1] [1] https://gkoberger.github.io/stacksort/

Very funny. I hadn't seen this before. I particularly like:

>>Is it safe?

>>Uh… it evals both user input and random code, unchecked, from an external site. This is what security-minded folks would refer to as Very Bad™.

Re: StackOverflow Importer – Import code from Stack Overflow as Python modules

#43
post #28
post #7

If I have editing powers could I hijack the answer that gets its code imported?

Edits get reviewed before being published.

That doesn't guarantee the folks doing the reviewing know what they are reviewing.

Re: StackOverflow Importer – Import code from Stack Overflow as Python modules

#44
post #39

This might be a joke but everybody does it manually for real. Whenever I copy-paste some tricky function from SO I like to add a code comment with the url pointing to the stackoverflow.com answer. This allows future maintainers to refer back to SO and see if a better answer has surfaced or read comments about any issues.

I do it for that reason but also for license attribution and indicate that I didn't write it.

Re: StackOverflow Importer – Import code from Stack Overflow as Python modules

#47
post #42
post #11

Reminds me of stacksort[1] [1] https://gkoberger.github.io/stacksort/

Very funny. I hadn't seen this before. I particularly like: >>Is it safe? >>Uh… it evals both user input and random code, unchecked, from an external site. This is what security-minded folks would refer to as Very Bad™.

I do my best to make it safe(ish), though :) It only runs code samples that were posted before I made StackSort.

Re: StackOverflow Importer – Import code from Stack Overflow as Python modules

#48
post #39

This might be a joke but everybody does it manually for real. Whenever I copy-paste some tricky function from SO I like to add a code comment with the url pointing to the stackoverflow.com answer. This allows future maintainers to refer back to SO and see if a better answer has surfaced or read comments about any issues.

Almost 3 years ago Visual Studio demo-ed a feature that would copy-paste code from StackOverflow, while automatically renaming the variables to fit your code :

https://blogs.msdn.microsoft.com/visualstudio/2014/02/17/int...

The tool is available here:

https://visualstudiogallery.msdn.microsoft.com/a1166718-a2d9...

Re: StackOverflow Importer – Import code from Stack Overflow as Python modules

#49
post #28
post #7

If I have editing powers could I hijack the answer that gets its code imported?

Edits get reviewed before being published.

No they don't. From http://stackoverflow.com/help/privileges/edit

> We believe in the power of community editing. That means once you've generated enough reputation, we trust you to edit anything in the system without it going through peer review. Not just your posts—anyone's posts!

Post reply on HN