gleitz / howdoi Goto Github PK
View Code? Open in Web Editor NEWinstant coding answers via the command line
Home Page: http://blog.gleitzman.com/post/43330157197/howdoi-instant-coding-answers-via-the-command-line
License: MIT License
instant coding answers via the command line
Home Page: http://blog.gleitzman.com/post/43330157197/howdoi-instant-coding-answers-via-the-command-line
License: MIT License
Command: howdoi sleep with your mom
Program returns: t1.interrupt(); //this will throw the exception when t1 is sleeping
Excepted response: more detailed instructions
$ howdoi -f git commit
usually the "-f" flag is used for "force" and feels volatile, it might be nice to change it to "-a" for "--article"
It could be interesting. The most times I use howdoi for the same development, so I always search the same terms, like "javascript".
Hey, I am having problem getting it to run on OSx 10.7 python 2.7 as default.
Traceback (most recent call last):
File "howdoi/howdoi.py", line 35, in
from pyquery import PyQuery as pq
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyquery-1.2.8-py2.7.egg/pyquery/init.py", line 11, in
from .pyquery import PyQuery
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyquery-1.2.8-py2.7.egg/pyquery/pyquery.py", line 9, in
from lxml import etree
ImportError: No module named lxml
I tried to install lxml then which ended up to another issue:
llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-
aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/usr/include/libxml2 -I/private/var/folders/43/m1qv9zf53q19sqh6h9kg9pz80000gn/T/pip_build_sanjeevkumar/lxml/src/lxml/includes -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.macosx-10.7-intel-2.7/src/lxml/lxml.etree.o -flat_namespace
unable to execute llvm-gcc-4.2: No such file or directory
error: command 'llvm-gcc-4.2' failed with exit status 1
A facetious query on my part, but there's an error nonetheless:
File "/usr/local/bin/howdoi", line 9, in <module>
load_entry_point('howdoi==0.2', 'console_scripts', 'howdoi')()
File "/Library/Python/2.7/site-packages/howdoi/howdoi.py", line 93, in command_line_runner
howdoi(args)
File "/Library/Python/2.7/site-packages/howdoi/howdoi.py", line 80, in howdoi
instructions = get_instructions(args) or 'Sorry, couldn\'t find any help with that topic'
File "/Library/Python/2.7/site-packages/howdoi/howdoi.py", line 66, in get_instructions
page = get_result(link)
File "/Library/Python/2.7/site-packages/howdoi/howdoi.py", line 27, in get_result
result = opener.open(url)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 400, in open
response = meth(req, response)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 513, in http_response
'http', request, response, code, msg, hdrs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 438, in error
return self._call_chain(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 372, in _call_chain
result = func(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 521, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: Not Found
Im getting the following error after install with pip install howdoi on Fedora release 14 (Laughlin) i686 python 2.7
[ozdemircili@localhost ~]$ howdoi
Traceback (most recent call last):
File "/usr/bin/howdoi", line 5, in
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2707, in
working_set.require(requires)
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 686, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 584, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: cssselect
Headsup. I keep getting this error. (also deleted the Cached file and tried a few times.)
% brew install howdoi
==> Downloading http://pypi.python.org/packages/source/h/howdoi/howdoi-1.1.4.tar.gz
Already downloaded: /Library/Caches/Homebrew/howdoi-1.1.4.tar.gz
Error: SHA1 mismatch
Expected: 21891197671194db38d45b9ca6616eb018ea8428
Actual: 5bc7c5c464b9125aea4d345ef740a95e5fdff6bb
OS: Windows 7 x64
C:\Users>pip --version
pip 1.3.1 from c:\python33\lib\site-packages\pip-1.3.1-py3.3.egg (python 3.3)
C:\Users>python --version
Python 3.3.1
Note: This is the second run as my console did not capture all lines on the first try.
C:\Users>pip install howdoi
Downloading/unpacking howdoi
Running setup.py egg_info for package howdoi
Requirement already satisfied (use --upgrade to upgrade): pyquery in c:\python33\lib\site-packages (from howdoi)
Requirement already satisfied (use --upgrade to upgrade): pygments in c:\python33\lib\site-packages (from howdoi)
Requirement already satisfied (use --upgrade to upgrade): requests in c:\python33\lib\site-packages (from howdoi)
Requirement already satisfied (use --upgrade to upgrade): requests-cache in c:\python33\lib\site-packages (from howdoi)
Downloading/unpacking lxml>=2.1 (from pyquery->howdoi)
Running setup.py egg_info for package lxml
Building lxml version 3.2.3.
Building without Cython.
ERROR: b'Der Befehl "xslt-config" ist entweder falsch geschrieben oder\r\nkonnte nicht gefunden werden.\r\n'
** make sure the development packages of libxml2 and libxslt are installed **
Using build configuration of libxslt
c:\Python33\lib\distutils\dist.py:257: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
warning: no files found matching '*.txt' under directory 'src\lxml\tests'
Downloading/unpacking cssselect (from pyquery->howdoi)
Running setup.py egg_info for package cssselect
no previously-included directories found matching 'docs\_build'
Installing collected packages: howdoi, lxml, cssselect
Running setup.py install for howdoi
Installing howdoi-script.py script to c:\Python33\Scripts
Installing howdoi.exe script to c:\Python33\Scripts
Running setup.py install for lxml
Building lxml version 3.2.3.
Building without Cython.
ERROR: b'Der Befehl "xslt-config" ist entweder falsch geschrieben oder\r\nkonnte nicht gefunden werden.\r\n'
** make sure the development packages of libxml2 and libxslt are installed **
Using build configuration of libxslt
building 'lxml.etree' extension
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic:\users\marco\appdata\local\temp\pip-build-marco\lxml\src\lxml\includes -Ic:\Python33\include -Ic:\Python33\include /Tcsrc\lxml\lxml.etree.c /Fobuild\temp.win-amd64-3.3\Release\src\lxml\lxml.etree.obj
lxml.etree.c
c:\users\marco\appdata\local\temp\pip-build-marco\lxml\src\lxml\includes\etree_defs.h(9) : fatal error C1083: Datei (Include) kann nicht ge”ffnet werden: "libxml/xmlversion.h": No such file or directory
c:\Python33\lib\distutils\dist.py:257: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
error: command '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\cl.exe"' failed with exit status 2
Complete output from command c:\Python33\python.exe -c "import setuptools;__file__='c:\\users\\marco\\appdata\\local\\temp\\pip-build-marco\\lxml\\setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\marco\appdata\local\temp\pip-rpxb94-record\install-record.txt --single-version-externally-managed:
Building lxml version 3.2.3.
Building without Cython.
ERROR: b'Der Befehl "xslt-config" ist entweder falsch geschrieben oder\r\nkonnte nicht gefunden werden.\r\n'
** make sure the development packages of libxml2 and libxslt are installed **
Using build configuration of libxslt
running install
running build
running build_py
copying src\lxml\includes\lxml-version.h -> build\lib.win-amd64-3.3\lxml\includes
running build_ext
building 'lxml.etree' extension
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic:\users\marco\appdata\local\temp\pip-build-marco\lxml\src\lxml\includes -Ic:\Python33\include -Ic:\Python33\include /Tcsrc\lxml\lxml.etree.c /Fobuild\temp.win-amd64-3.3\Release\src\lxml\lxml.etree.obj
lxml.etree.c
c:\users\marco\appdata\local\temp\pip-build-marco\lxml\src\lxml\includes\etree_defs.h(9) : fatal error C1083: Datei (Include) kann nicht ge”ffnet werden: "libxml/xmlversion.h": No such file or directory
c:\Python33\lib\distutils\dist.py:257: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
error: command '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\cl.exe"' failed with exit status 2
----------------------------------------
Command c:\Python33\python.exe -c "import setuptools;__file__='c:\\users\\marco\\appdata\\local\\temp\\pip-build-marco\\lxml\\setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\marco\appdata\local\temp\pip-rpxb94-record\install-record.txt --single-version-externally-managed failed with error code 1 in c:\users\marco\appdata\local\temp\pip-build-marco\lxml
Storing complete log in C:\Users\marco\pip\pip.log
C:\Users>howdoi test
Traceback (most recent call last):
File "c:\Python33\Scripts\howdoi-script.py", line 5, in <module>
from pkg_resources import load_entry_point
File "c:\Python33\lib\site-packages\distribute-0.6.36-py3.3.egg\pkg_resources.py", line 2806, in <module>
working_set.require(__requires__)
File "c:\Python33\lib\site-packages\distribute-0.6.36-py3.3.egg\pkg_resources.py", line 696, in require
needed = self.resolve(parse_requirements(requirements))
File "c:\Python33\lib\site-packages\distribute-0.6.36-py3.3.egg\pkg_resources.py", line 594, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: cssselect
Do you happen to have any idea why this fails?
Looks to me that calling xslt-config
fails, do I have to add that manually or was it just "not installed"?
Please follow
http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
In particular cache should default to $XDG_CACHE_HOME/howdoi and if the env variable doesn't exist, fallback to ~.cache/howdoi
Hi, Is there anything to do with the exe to avoid the UAC besides disabling UAC?
Also running howdoi.exe from command line, it finishes execution and closes the window before see what it says.
Then we can run the command more efficiently.
Such as hdi (how do i) or ht (how to)?
Thanks!
howdoi meo
Traceback (most recent call last):
File "/usr/bin/howdoi", line 9, in
load_entry_point('howdoi==1.1.5', 'console_scripts', 'howdoi')()
File "/usr/lib/python2.7/site-packages/howdoi/howdoi.py", line 241, in command_line_runner
print(howdoi(args).encode('utf-8', 'ignore'))
File "/usr/lib/python2.7/site-packages/howdoi/howdoi.py", line 201, in howdoi
return get_instructions(args) or 'Sorry, couldn't find any help with that topic\n'
File "/usr/lib/python2.7/site-packages/howdoi/howdoi.py", line 177, in get_instructions
answer = get_answer(args, links)
File "/usr/lib/python2.7/site-packages/howdoi/howdoi.py", line 136, in get_answer
link = get_link_at_pos(links, args['pos'])
File "/usr/lib/python2.7/site-packages/howdoi/howdoi.py", line 108, in get_link_at_pos
link = links[-1]
IndexError: list index out of range
I've been trying to use howdoi over the past few days and I keep getting "Sorry, couldn't find any help with that topic". Did something break recently?
None of the queries in the test file work:
format date bash
print stack trace python
convert mp4 to animated gif
create tar archive
The requests
module has finally fixed its ssl problems, however, now they require explicit proxy schemes for the requests.get
method. Currently I get this error when trying to run howdoi:
<snipped long stacktrace>
requests.exceptions.MissingSchema: Proxy URLs must have explicit schemes.
The problem is that my environment proxy variables don't use explicit schemes; for example http_proxy
is set to wwwproxy.company.com:3128
instead of http://wwwproxy.company.com:3128
. Naturally, this can be solved if I make sure that all my environment proxy variables use explicit schemes, i.e. http://wwwproxy.company.com:3128
, https://wwwproxy.company.com:3128
, etc. Unfortunately this solution is not readily apparent to the hapless user.
A more elegant solution would be to instead modify howdoi to filter out http
and https
, since those are the only proxies howdoi uses, and then make sure that they use explicit schemas.
I have a working solution on my computer, if you are interested in reviewing a pull request.
This is a cool tool. It seems like some people on HN aren't satisfied with the first answer that howdoi provides, and instead of searching again and again it would be nice to have an option that displays, for example, the first three results
Love this tools :)
It would gain a lot of readability if the output would wrap the line at a given width - or is there a way to force that? at this point the output cut whatever word in order to move to next line.
thanks!
I get this error when installing howdoi. Any thoughts on what I'm doing wrong here?
Fails to build lxml.etree
building 'lxml.etree' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
creating build/temp.linux-x86_64-2.7/src/lxml
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/root/build/lxml/src/lxml/includes -I/usr/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o
src/lxml/lxml.etree.c:4:20: fatal error: Python.h: No such file or directory
i upgraded to a new howdoi version trying to fix this error queries <<keep resulting in "Sorry, couldn't find any help with that topic">> and now when i try to query i get the title message
Tried installing on my MacBook; results are as follows:
EDP24:ArborwellWebForms jseidel$ brew install https://raw.github.com/gleitz/howdoi/master/howdoi.rb
######################################################################## 100.0%
==> Downloading http://pypi.python.org/packages/source/h/howdoi/howdoi-1.0.tar.gz
Already downloaded: /Users/jseidel/Library/Caches/Homebrew/howdoi-1.0.tar.gz
==> python setup.py install
Using build configuration of libxslt 1.1.24
warning: no files found matching '*.txt' under directory 'src/lxml/tests'
cc1: error: unrecognized command line option "-march=core2"
lipo: can't open input file: /var/folders/0Y/0YhDVwcDGu4v6rBRQGIUdk+++TM/-Tmp-//cc6ZuOKi.out (No such file or directory)
error: Setup script exited with error: command '/usr/bin/gcc-4.2' failed with exit status 1
READ THIS: https://github.com/mxcl/homebrew/wiki/troubleshooting
Also, see http://pastie.org/5811939 for details
when i try and install howdoi with sudo pip install howdoi i get an error message in compilation. Reproducing the relevant lines below:
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -lxslt -lexslt -lxml2 -lz -lm -o build/lib.linux-x86_64-2.7/lxml/etree.so
/usr/bin/ld: cannot find -lz
I've googled on this issue and the error seems to be a broken link to a library. But while google points to the genric error unfortunately it doesn't specify which library corresponds to -lz. I found links for -lm and a few others.
I really want to try this applciation so any help will be appreciated
thanks
First off, since I'm not a Python developer I have no idea if this is easy to include in a build process or not. However, since I've seen several Python applications that run on Windows without having to install Python (for example, PyLoad), I think that it might be easier in Python than say, .NET or Java.
I'm not expecting this issue to be fixed soon - I just thought I should post it as a wish.
Also, it doesn't necessarily need an installer (I think any user of this knows how to copy a folder to Program Files), but with one, it would be possible to add howdoi
to the %PATH%
, so that people can pop up a prompt and run it easily.
I'd like to always see the link with results, or at least have a flag to do that. Right now you can only geet one or the other.
$ howdoi -n 3 -a list to string python
Traceback (most recent call last):
File "/usr/local/bin/howdoi", line 8, in
load_entry_point('howdoi==1.1.5', 'console_scripts', 'howdoi')()
File "/Library/Python/2.7/site-packages/howdoi/howdoi.py", line 226, in command_line_runner
print(howdoi(args).encode('utf-8', 'ignore'))
File "/Library/Python/2.7/site-packages/howdoi/howdoi.py", line 187, in howdoi
return get_instructions(args) or 'Sorry, couldn't find any help with that topic\n'
File "/Library/Python/2.7/site-packages/howdoi/howdoi.py", line 163, in get_instructions
answer = get_answer(args, links)
File "/Library/Python/2.7/site-packages/howdoi/howdoi.py", line 136, in get_answer
for html_tag in first_answer.items('.post-text > *'):
AttributeError: 'PyQuery' object has no attribute 'items'
💩
I believe the readme should indicate that the script should be ran with Python 2.7 rather than 3.*, to avoid things like this.
It'd be nice to able to install this anywhere via a global pip install!
Can't get this installed on my mac:
pip install howdoi
-bash: pip: command not found
I get:
gem install gosu
for people like me (python-idiots), pip install
is unfamiliar. i think having installation go through something with a bit broader reach might be useful. i personally would prefer to have this as a brew formula.
At home I can use howdoi, no problem. At work I get this:
edwardd@lnxedwardd> howdoi say hello in german
Failed to establish network connection
edwardd@lnxedwardd>
I edited howdoi.py to print the ConnectionError before returning, which displays this message:
[Errno 1] _ssl.c:504: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
No idea what it means, but I'm guessing it is a proxy error, mainly because all network errors here at work usually have to do with the proxy.
Is it possible to make howdoi work behind a proxy?
like unix.stackexchange.com
If the search found no results , Howdoi could returns "Did you mean X ?" instead of nothing.
The new cache feature is not compatible between major versions of python:
$ howdoi-python2.7 python hello world
print("Hello, World!")
$ howdoi-python3.2 python hello world
Traceback (most recent call last):
File "/usr/bin/howdoi-python3.2", line 9, in
load_entry_point('howdoi==1.1.4', 'console_scripts', 'howdoi')()
File "/usr/lib64/python3.2/site-packages/howdoi/howdoi.py", line 217, in command_line_runner
print(howdoi(args).encode('utf-8', 'ignore'))
File "/usr/lib64/python3.2/site-packages/howdoi/howdoi.py", line 176, in howdoi
return get_instructions(args) or 'Sorry, couldn't find any help with that topic\n'
File "/usr/lib64/python3.2/site-packages/howdoi/howdoi.py", line 143, in get_instructions
links = get_links(args['query'])
File "/usr/lib64/python3.2/site-packages/howdoi/howdoi.py", line 68, in get_links
result = get_result(url)
File "/usr/lib64/python3.2/site-packages/howdoi/howdoi.py", line 59, in get_result
return requests.get(url, headers={'User-Agent': random.choice(USER_AGENTS)}, proxies=get_proxies()).text
File "/usr/lib64/python3.2/site-packages/requests/api.py", line 55, in get
return request('get', url, *_kwargs)
File "/usr/lib64/python3.2/site-packages/requests/api.py", line 44, in request
return session.request(method=method, url=url, *_kwargs)
File "/usr/lib64/python3.2/site-packages/requests_cache/core.py", line 111, in request
hooks, stream, verify, cert)
File "/usr/lib64/python3.2/site-packages/requests/sessions.py", line 335, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib64/python3.2/site-packages/requests_cache/core.py", line 89, in send
response, timestamp = self.cache.get_response_and_time(cache_key)
File "/usr/lib64/python3.2/site-packages/requests_cache/backends/base.py", line 64, in get_response_and_time
if key not in self.responses:
File "/usr/lib64/python3.2/_abcoll.py", line 365, in contains
self[key]
File "/usr/lib64/python3.2/site-packages/requests_cache/backends/storage/dbdict.py", line 171, in getitem
return pickle.loads(bytes(super(DbPickleDict, self).getitem(key)))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 192993: ordinal not in range(128)
@gleitz I have done some work some time ago, mainly involving:
Most of these features can be controlled through command line arguments.
I see though that there has been a lot of work done in the meanwhile, let me know if you are interested in merging any of the above, I'll be more than happy to discuss.
https://github.com/georgepsarakis/howdoi/
P.S.:
Great idea! 👍
Hi there
I've just recommended howdoi to my colleagues and found that the version they've all installed via pip is quite out of date. :( (Still suffers from unicode bug)
Could you release a new one, please?
Thanks!
$ brew update
Already up-to-date.
$ brew doctor
Your system is raring to brew.
$ brew install https://raw.github.com/gleitz/howdoi/master/howdoi.rb
######################################################################## 100.0%
Warning: HOMEBREW_USE_LLVM is deprecated, use HOMEBREW_CC="llvm" instead
==> Downloading http://pypi.python.org/packages/source/h/howdoi/howdoi-0.2.tar.gz
Already downloaded: /Library/Caches/Homebrew/howdoi-0.2.tar.gz
==> python setup.py install
http://packages.python.org/distribute/easy_install.html
Please make the appropriate changes for your system and try again.
READ THIS: https://github.com/mxcl/homebrew/wiki/troubleshooting
I really wanted this so I just installed Python 3.3.0, and tried to install howdoi.
Seemingly I could not compile lxml, but that was sorted out getting a binary here
Problem is, when I run howdoi, it gives me this:
File "howdoi.py", line 81
print instructions
^
SyntaxError: invalid syntax
Why? I am completely clueless and know nothing about Python to sort it out. I have all dependencies (even installed argparse just now, seeing this)
Edit: just in case it matters, I installed using pip install howdoi
, then I tried the setup.py later, and even tried it all again after installing the lxml binary for Windows, but still nothing happens. Oh, and I have the python directory in my path, also python/Scripts
one. Tested on Windows XP 32-bit.
Python 2.7.2
$ howdoi ask
Traceback (most recent call last):
File "/opt/zenoss/bin/howdoi", line 8, in <module>
load_entry_point('howdoi==1.1.4', 'console_scripts', 'howdoi')()
File "/opt/zenoss/lib/python2.7/site-packages/howdoi/howdoi.py", line 217, in command_line_runner
print(howdoi(args).encode('utf-8', 'ignore'))
File "/opt/zenoss/lib/python2.7/site-packages/howdoi/howdoi.py", line 176, in howdoi
return get_instructions(args) or 'Sorry, couldn\'t find any help with that topic\n'
File "/opt/zenoss/lib/python2.7/site-packages/howdoi/howdoi.py", line 143, in get_instructions
links = get_links(args['query'])
File "/opt/zenoss/lib/python2.7/site-packages/howdoi/howdoi.py", line 68, in get_links
result = get_result(url)
File "/opt/zenoss/lib/python2.7/site-packages/howdoi/howdoi.py", line 59, in get_result
return requests.get(url, headers={'User-Agent': random.choice(USER_AGENTS)}, proxies=get_proxies()).text
File "/opt/zenoss/lib/python2.7/site-packages/requests/api.py", line 55, in get
return request('get', url, **kwargs)
File "/opt/zenoss/lib/python2.7/site-packages/requests/api.py", line 43, in request
session = sessions.Session()
File "/opt/zenoss/lib/python2.7/site-packages/requests_cache/core.py", line 155, in <lambda>
**backend_options)
File "/opt/zenoss/lib/python2.7/site-packages/requests_cache/core.py", line 63, in __init__
(backend, ', '.join(backends.registry.keys())))
ValueError: Unsupported backend "sqlite" try one of: redis, memory
I gave a fast look to the code and i saw that support for duckduckgo is planned (at least there is a func for it) but not in use.
BTW, isn't it better to directly search on stackoverflow?
bash-4.2$ howdoi make a log scale d3
Traceback (most recent call last):
File "/usr/local/bin/howdoi", line 8, in
load_entry_point('howdoi==0.2', 'console_scripts', 'howdoi')()
File "build/bdist.macosx-10.8-intel/egg/howdoi/howdoi.py", line 93, in command_line_runner
File "build/bdist.macosx-10.8-intel/egg/howdoi/howdoi.py", line 81, in howdoi
UnicodeEncodeError: 'ascii' codec can't encode characters in position 195-196: ordinal not in range(128)
I think this is because the source page has a ± character in it.
http://stackoverflow.com/questions/11924335/horizon-chart-not-visible-when-using-d3-scale-log
There are cases, when I want to see the found answer in a web browser, e.g. for following a link or upvoting the answer (which is an important give-back to the community).
Therefore I propose an -o
/ --open
flag, that opens the answer in the browser instead of printing to the terminal:
$ howdoi upvote an answer
# ...ah, interesting, let's upvote the answer
$ howdoi --open upvote an answer
# opens browser at stackoverflow.com/...
An implementation could be based on Python's webbrowser
module:
if args['open']:
webbrowser.open(link)
else:
print answer
If a query has only say, 10 answers and you request the 11th, or even the 100th, howdoi will silently give you the last one.
$ howdoi -p8 python quickcheck
What unit testing in PHP to start
$ howdoi -p9 python quickcheck
I don't know of any one resource which will provide you with sample inputs[…]
$ howdoi -p10 python quickcheck
xldate_as_tuple
$ howdoi -p11 python quickcheck
xldate_as_tuple
$ howdoi -p100 python quickcheck
xldate_as_tuple
Shouldn't it print an error message in such a case ?
for readability, it might be nice to colorize the output that is code vs text. additionally, you could make keyword matches bold.
I followed the link in the readme file to download the Windows stand alone executable. I have tried moving this file to c: and to "C:\Program Files\howdoi", after adding these to my path environment variable I can access the application, but cannot find any answers.
howdoi -h
returns the expected help menu, however any subject I search on returns "Sorry, couldn't find any help with that topic". I have even tried the date format example that you give in the readme and still get the same response.
Try using HTTP instead of HTTPS by setting the environment variable "HOWDOI_DISABLE_SSL".
how to fix this!
Thanks
mac ox 10.8
I install howdoi success.
In terminal:
$:howdoi convert doc to pdf
show the error message: Try using HTTP instead of HTTPS by setting the environment variable "HOWDOI_DISABLE_SSL".
I try to fix it, but i do not how to setting the environment variable "HOWDOI_DISABLE_SSL".
please help!
thanks
$ howdoi kill someone
ps aux
though the second codeblock is a more suitable answer.
ssh hostname "ps aux| egrep '.*python' | grep -v 'grep'| awk '{print \$2}'| xargs kill -KILL"
From pip:
Downloading/unpacking howdoi
Running setup.py egg_info for package howdoi
Requirement already satisfied (use --upgrade to upgrade): pyquery in /usr/local/lib/python2.7/site-packages (from howdoi)
Requirement already satisfied (use --upgrade to upgrade): pygments in /usr/local/lib/python2.7/site-packages (from howdoi)
Requirement already satisfied (use --upgrade to upgrade): requests in /usr/local/lib/python2.7/site-packages (from howdoi)
Requirement already satisfied (use --upgrade to upgrade): requests-cache in /usr/local/lib/python2.7/site-packages (from howdoi)
Downloading/unpacking lxml>=2.1 (from pyquery->howdoi)
Running setup.py egg_info for package lxml
/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
Building lxml version 3.2.3.
Building without Cython.
Using build configuration of libxslt 1.1.26
warning: no files found matching '*.txt' under directory 'src/lxml/tests'
Downloading/unpacking cssselect (from pyquery->howdoi)
Running setup.py egg_info for package cssselect
no previously-included directories found matching 'docs/_build'
Installing collected packages: howdoi, lxml, cssselect
Running setup.py install for howdoi
Installing howdoi script to /usr/local/bin
Running setup.py install for lxml
/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
Building lxml version 3.2.3.
Building without Cython.
Using build configuration of libxslt 1.1.26
building 'lxml.etree' extension
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/include/libxml2 -I/private/var/folders/lm/5bkc7gl14t37_2bx2q2b4qc40000gn/T/pip-build-johanndiedrick/lxml/src/lxml/includes -I/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.macosx-10.7-x86_64-2.7/src/lxml/lxml.etree.o -flat_namespace
clang: warning: argument unused during compilation: '-flat_namespace'
In file included from src/lxml/lxml.etree.c:16:
/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:33:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
^
1 error generated.
error: command '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang' failed with exit status 1
Complete output from command /usr/local/opt/python/bin/python2.7 -c "import setuptools;file='/private/var/folders/lm/5bkc7gl14t37_2bx2q2b4qc40000gn/T/pip-build-johanndiedrick/lxml/setup.py';exec(compile(open(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /var/folders/lm/5bkc7gl14t37_2bx2q2b4qc40000gn/T/pip-3NZjzY-record/install-record.txt --single-version-externally-managed:
/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
Building lxml version 3.2.3.
Building without Cython.
Using build configuration of libxslt 1.1.26
running install
running build
running build_py
copying src/lxml/includes/lxml-version.h -> build/lib.macosx-10.7-x86_64-2.7/lxml/includes
running build_ext
building 'lxml.etree' extension
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/include/libxml2 -I/private/var/folders/lm/5bkc7gl14t37_2bx2q2b4qc40000gn/T/pip-build-johanndiedrick/lxml/src/lxml/includes -I/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.macosx-10.7-x86_64-2.7/src/lxml/lxml.etree.o -flat_namespace
clang: warning: argument unused during compilation: '-flat_namespace'
In file included from src/lxml/lxml.etree.c:16:
/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:33:10: fatal error: 'stdio.h' file not found
^
1 error generated.
error: command '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang' failed with exit status 1
Command /usr/local/opt/python/bin/python2.7 -c "import setuptools;file='/private/var/folders/lm/5bkc7gl14t37_2bx2q2b4qc40000gn/T/pip-build-johanndiedrick/lxml/setup.py';exec(compile(open(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /var/folders/lm/5bkc7gl14t37_2bx2q2b4qc40000gn/T/pip-3NZjzY-record/install-record.txt --single-version-externally-managed failed with error code 1 in /private/var/folders/lm/5bkc7gl14t37_2bx2q2b4qc40000gn/T/pip-build-johanndiedrick/lxml
Storing complete log in /Users/johanndiedrick/.pip/pip.log
Here’s what happens when I brew-install howdoi
in bash:
/usr/local/Cellar > brew install https://raw.github.com/gleitz/howdoi/master/howdoi.rb
######################################################################## 100.0%
==> Downloading http://pypi.python.org/packages/source/h/howdoi/howdoi-0.2.tar.g
Already downloaded: /Library/Caches/Homebrew/howdoi-0.2.tar.gz
==> python setup.py install
/usr/local/Cellar/howdoi/0.2: 2 files, 8.0K, built in 2 seconds
However, no link is placed in /usr/local/bin
. So then I try:
/usr/local/Cellar > brew link howdoi
Warning: Already linked: /usr/local/Cellar/howdoi/0.2
…and there's still no link. I brew-installed tree
and it linked fine. I checked with an associate and he was able to install howdoi
and have a link appear in /usr/local/bin
even though his ownership and write permissions appear to match mine.
I did a brew cleanup and a howdoi
uninstall before trying again. Same results.
I’m able to use howdoi
through a $PATH
amendment to include /usr/local/share/python/
, but the lack of linking seems like a bug of some sort. I’m just not sure what sort.
According to PKG-INFO Python3.2 is supported, but it does not actually work:
File "howdoi.py", line 30
ANSWER_HEADER = u'--- Answer {0} ---\n{1}'
^
SyntaxError: invalid syntax
I am unsure if the PKG-INFO is incorrect or some change was introduced breakign Python3.2.
New release or add github install to doc
pip install git+https://github.com/gleitz/howdoi.git#egg=howdoi
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.