-
Notifications
You must be signed in to change notification settings - Fork 869
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request for Help: Show me queries that don't have a good answer #378
Comments
Started collecting some bad queries and potential solutions at https://docs.google.com/spreadsheets/d/16nzBO6s4S61iScaEgtf6KAoJ5he7f3he5dJ-ElG9ViM/edit?usp=sharing |
We should update this line To be smarter about how we pick the code block or answer. For example if there are multiple |
The following gives the wrong answer.
If I change the query slightly (delete the word "run"), I get correct answers.
|
This query In C++
The above answer returned is not the actual implementation whereas other languages usually return the full implementation even the uncommon languages. In JavaScript
In Go
Also while working on syntax highlighting, I noticed a lot of howdoi queries on C++ do not return an accurate answer. Following are some more examples -
Furthermore, a lot of queries are based on C++ mentioned in this sheet |
$ howdoi -ac check file exists bash --explain
INFO: Version: 2.0.19
INFO: Fetching answers for query: check file exists bash
INFO: Searching google with URL: https://www.google.com/search?q=site:stackoverflow.com%20check%20file%20exists%20bash&hl=en
INFO: Links from stackoverflow.com found on google: 1
INFO: URL: https://stackoverflow.com/questions/638975/how-do-i-tell-if-a-regular-file-does-not-exist-in-bash
INFO: Answers requested: 1, Starting at position: 1
INFO: Total answers returned: 0 The answer to this query is in a code block in the top (accepted) answer of the SO link shown in the |
@justin-f-perez would you try passing the
|
@gleitz This seems to be a pretty complex problem. Clearing cache didn't help. My 'normal' I get the same result as you when I install:
I also get "no answer" if I try to $ pipx run howdoi -ac check file exists bash --explain -C
INFO: Version: 2.0.19
Cache cleared successfully
...
ERROR: Sorry, couldn't find any help with that topic% so I created a conda environment, pip installed howdoi (which returns an answer as expected) and diffed what was installed: $ diff =(pipx runpip howdoi list) =(pip list)
5c5
> certifi 2020.6.20
---
< certifi 2021.10.8
7c7
> charset-normalizer 2.0.9
---
< charset-normalizer 2.0.8
23c23
> setuptools 58.0.4
---
< setuptools 59.4.0 Then I littered some print(f"{page=}")
html = pq(page)
print(f'{html=}')
first_answer = html('.answercell').eq(0) or html('.answer').eq(0)
print(f'{first_answer=}') The content of < html=[<html>]
---
> html=[<html.html__responsive.>]
< first_answer=[]
---
> first_answer=[<div.answercell.post-layout--right>] So, I created a new vanilla python3-venv ( $ /path/to/brew/bin/python3.10 -m venv ./tmp-venv
$ source tmp-venv/bin/activate
$ pip install howdoi
$ howdoi -ac check file exists bash --explain -C
Error... I tried getting in there with pdb, but the misbehaving code runs in a multiprocessing pool. |
Wow that's wild. Thanks for the in-depth exploration. The hypothesis is that there is something about I wonder if you could use this solution to get pdb in a multiprocessing thread: |
@gleitz thanks for the suggestion! will try when I have time (finals death-march season...) I thought it was pipx at first too- then I thought it was python3.10 related. Now I suspect the problem is somehow related to homebrew's distribution of python3. That would explain why In other words... < conda env create -n howdoi # uses first python3 it finds on $PATH
> conda env create -n howdoi python=3.9 # conda installs its own interpreter
conda activate howdoi
pip install howdoi
howdoi -ac check file exists bash --explain -C
< ERROR
> answer
|
Running class Demo {
overload(a) {
console.log('hi');
}
overload() {
console.log('bye');
}
overload(a, b) {
console.log('wow');
}
}
const d = new Demo();
d.overload();
d.overload(1);
d.overload(1, 2); Which first, doesn't use TypeScript, and second, doesn't reverse a binary tree. (Atleast it doesn't look like it, I haven't executed the code.) On the topic of binary trees and TypeScript, running interface TreeNode<T> {
left?: TreeNode<T>;
right?: TreeNode<T>;
data: T;
} (thats it) Running person[name] = 'Tom' |
Turns out this now gives a (more) correct answer, that is also in Typescript. Kudos to the community for ranking answers and linking to them which raises their search ranking. |
howdoi
needs your help! We're looking to improve the quality of answers returned by the system. If you find a query that doesn't seem to have the right answer, could you please include the query and the response below? We'll use this to build a robust set of heuristics and perhaps an AI model to help you hack better.Here's an example:
Instead, we should probably return the entire answer for this query.
Thanks!
The text was updated successfully, but these errors were encountered: