Hors - instant coding answers via the command line

Hors is mainly copy from howdoi. After one months' developing, it's almost feature complete.

It's simple:

And quickly (when you have used hors search for question A, and you want to search for question for the same question A in the future, hors is likely to answer very quickly):

% time hors -a -n 3 -c "globle variable in rust"
hors -a -n 3 -c "globle variable in rust"  0.10s user 0.04s system 11% cpu 1.234 total

It's my first project in rust, I hope it can be helpful and enjoyable.

For more usage information, please checkout github page.

6 Likes
  1. This is really cool. Thanks for creating/sharing it.

  2. I clicked on the hors / howdoi links – but I couldn’t find this – where is the database of answers / code snippets stored?

  3. (Completely serious, not joking) – anyone else believe something like this is how “software replaces programmers” starts ? It starts out as retrieving human written answers – then it’s only compilable answers – then it’s snippets of code from github – then it figures out how to combine snippets … :slight_smile:

Thank you very much! For your question:
I clicked on the hors / howdoi links – but I couldn’t find this – where is the database of answers / code snippets stored?
Hors is saving the human written answers(which lays in stackoverflow) in the local cache directory. Which is defined by current operation system.

Here is where cache saved:

Platform Value Example
Linux $XDG_CACHE_HOME or $HOME/.cache /home/alice/.cache
macOS $HOME/Library/Caches /Users/Alice/Library/Caches
Windows {FOLDERID_LocalAppData} C:\Users\Alice\AppData\Local

And howdoi is use something like this, it save results to $USER_CACHE_DIR/howdoi. So the cache it’s something like local database

Sorry – I poorly phrased my question. What I wanted to ask is not where this is stored locally – where on the internet is the archive of answers coming from? Is this a StackOverflow dump? Is there some public archive that people can submit snippets to?

I see :slight_smile:
The answers are all coming from StackOverflow.
It’s a StackOverflow dump for specific answer, hors will going to parse the dump and extract out user answers.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.