14
votes
Accepted
A wounded Zombie finder, or: how to find the almost dead undead?
Not utterly wrong, but
q.PostTypeId = 1
and
AND a.PostTypeId = 2
are superfluous. The only post types with a non-null ...
13
votes
Accepted
CodeReview question markdown downloader
PyCharm complains on this line:
m = json.loads(data)
If the above call to fetch_compressed_data fails, and the resulting ...
13
votes
Stack Exchange review queue notifications
I don't see much benefit to the enum. The Notification.permission string (or the return value of requestPermission()) is already ...
11
votes
CodeReview question markdown downloader
Just a couple stylistic points
Function/Variable Naming
Functions and variables should be in snake_case (PEP 8).
...
9
votes
CodeReview question markdown downloader
Improving HTTP communication scheme
Instead of urllib.request/urllib.error use requests lib as well-known, elegant and simple ...
7
votes
Accepted
Zombie killers ranking
As a heads up - we have very different formatting styles for our code. Feel free to ignore that difference and don't consider it a comment on your style (unless you prefer mine, in which case please ...
7
votes
Accepted
Python tool to assemble CodeReview posts from source files
PEP 8
I would review PEP 8. Some of your style choices are not considered best practice by the Python community. Some quick observations:
Constants are given ...
6
votes
Accepted
Show how close a user is to being unsung
I tried it on myself, elapsed time of 136 msec for userid 145459:
https://data.stackexchange.com/codereview/query/1822723/how-close-am-i-to-being-unsung?opt.withExecutionPlan=true#executionPlan
The ...
5
votes
Get a notification when questions get posted
Why would you use stackexchange.com and only take ones with the title of stackoverflow.com? That's a huge waste.
You could ...
5
votes
Accepted
The sniper: a Zombie searcher for specific tags
When using "simple" Aliases for table names in a query you should alias all the tables, not just some of them. This makes the query appear more consistent. In your query, you have ...
5
votes
State the word count for a given Stack Exchange user
Reviewing your T-SQL script I see that you have a cursor to iterate over Posts from a specific owner. For each body you use a neat trick to determine the word count of the body and use an extra ...
5
votes
Stack Exchange review queue notifications
Usability
I ran the script on the SO review dashboard to see how it would perform with various numbers. The biggest thing I noticed was that it didn't properly handle numbers greater than 999 since ...
5
votes
Finding solutions on GitHub and Stack Overflow
Selenium
Selenium imposes a lot of overhead and complexity that you don't need to deal with. If you needed to scrape, use requests + ...
5
votes
Finding solutions on GitHub and Stack Overflow
For simply content scraping without JavaScript and ajax content try scrapy for best practices. Scrapy uses Python classes by default as it is a Python framework.
Easy tutorial to learn Scrapy:
Scrapy ...
4
votes
Find how much reputation a user had on a given date
This is a partial answer as these were the bits I could verify easily.
In your column query for ReputationFromSuggestedEdits you can move all of the projection to ...
4
votes
"How can I make this SEDE query better?" (bad title finder)
Let me address a possible DRY issue in the query in exchange for possible poorer performance.
I'm in particular talking about this bit:
...
4
votes
Data Explorer query that makes bar graphs
I'll answer your main questions:
Can I refactor it so that the list of when like then statements occurs only once? (Preferably without complicating the code too much.)
Yes, but not at the expense of ...
4
votes
Accepted
SE main site tag ratings based on Wilson score confidence interval
So it seems that dynamic SQL in general and EXECUTE() in particular, as pointed out by Phrancis, is slow. As I also don't want to be dealing with the composition of ...
4
votes
Accepted
Bookmarklet that helps Stack Exchange users farm reputation
First, a few general pointers.
Commented out code is bad. It tells readers that you don't really know why this code was there, but removing it seems to have fixed something, or maybe adding it broke ...
4
votes
Stack Exchange graph data - helper modules
You're storing the magnitudes like this:
_MAGNITUDE = 'f p n μ m| k M G T P E Z Y'
This is a serialized format that requires parsing. This is inconvenient and ...
4
votes
Accepted
iOS Swift 3 app that requests data from the Stack Exchange API
Property accessors
Defining accessor methods for stored properties such as
...
4
votes
CodeReview question markdown downloader
Personally I use Prospector and Flake8 with a lot of plugins. The problem with linter runners is that they don't support many of the lint tools available in the Python ecosystem. But, for the most ...
4
votes
Accepted
SE Data Explorer: Users by City
LOWER(Location) LIKE 'sulaimani, iraq' or LOWER(Location) LIKE 'erbil, iraq'
It is not necessary to use LIKE if you want an ...
3
votes
Scraper to grab a Stack Overflow profile name
IMO the answer highly depends on how you are planning to extend the functionality of your class.
If its only function is fetching the username, it's probably better to transform it into a function. ...
3
votes
Accepted
Get a notification when questions get posted
Apart from using the SE API (for example via some module like py-stackexchange), there are some other optimizations possible.
In your notify function you could use ...
3
votes
Bookmarklet that helps Stack Exchange users farm reputation
Skimming from top to bottom, just dumping what comes to mind here:
You should be using 'use strict'; when you can, to make your code conform to modern standards. ...
3
votes
We'll be counting stars
There are also some possible BeautifulSoup related improvements:
It is highly recommended to specify an underlying parser that ...
2
votes
Accepted
Condensing a Table
Algorithm
The algorithm to build the collapse-specs is inefficient:
It makes a pass over all headers to find the percentage headers
Then for each percentage header:
It finds the index using ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
stackexchange × 170sql × 75
sql-server × 50
javascript × 45
t-sql × 32
userscript × 30
python × 24
beginner × 15
jquery × 14
performance × 12
python-3.x × 12
chat × 12
web-scraping × 10
beautifulsoup × 7
formatting × 6
java × 5
json × 5
html × 3
python-2.x × 3
time-limit-exceeded × 3
node.js × 3
ecmascript-6 × 3
websocket × 3
bookmarklet × 3
c# × 2