Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Is there a way to query Stack Overflow directly from the command line and get back the most upvoted answer to the first question that comes up for that query?
I really mislike having to open up my browser whenever I want to brush up on my knowledge of writing RegExes for matching XHTML tags.
Yes, it is possible! Try out Benjamin Gleitzman's excellent tool howdoi.
It works like this:
$ howdoi get stackoverflow answers inside a terminal
and the program will query StackOverflow for keywords "get stackoverflow answers inside a terminal", find the question that best matches these terms and return the code from the best answer to that question.
You can also add the -a option to get the full answer, not just the code. So to get an answer for your example query, you would do:
$ howdoi -a RegEx match XHTML tags
Installation
If you have Python & pip installed, you can get it from the Cheese shop.
$ pip install howdoi
More help
Enter howdoi -h for complete usage instructions.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
i'm very new to mac world, and i'm using bash doing some work.
But I'm not clear about the bash command line. It's so different from cmd.
yb_server:~ Aaron$
above is the command line when i start a terminal.
what's the meaning of yb_server?( I used to remember it's originally macintosh, why
it's changing to yb_server, how can i recover?)
what does ~ mean?
what does $ mean?
yb_server is your computer.
: is an arbitrary delimiter.
~ is your home directory (the current directory).
Aaron is you.
$ is "Speak to me, master!" But it is effectively an arbitrary delimiter.
The whole thing is your prompt. Google "bash prompt" for lots of info. Its format is totally up to you. Say echo $PS1 to find out what the format is now. The default is:
\h:\W \u\$
Learning what those symbols mean is left as an exercise for the reader!
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am running an automated test script written in Ruby in which I get a result page, I would like to capture some of the text on the page and print them in a file. Can anyone assist with this effort?
Like the comments say, use Nokogiri.
Install it with gem install nokogiri.
To print the first top-level heading from example.com:
require 'nokogiri'
require 'open-uri'
doc = Nokogiri::HTML(open("http://www.example.com/"))
puts doc.css("h1").first
For more information on finding the text you want, try this guide
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Ok, I'm trying to make a small rpg as a small project in vbs. What I'm after is a msgbox with 5 buttons: attack, skils, magic, run, help.
My knowledge of vbscript is quite minimal, so you may need to explain.
You cannot easily do that with VBScript. (Wouldn't it be nice if you could do something like choice = MsgBox("Please select my next action", array("attack", "skills", "magic", "run", "take", "help"))).
But you can do the good old create-an-IE-instance-with-choices-hack. You can find examples and explanations on The Scripting Guys' Blog or on the site of Rob van der Woude.
Ninja edit: While you are looking at blending HTML code with VBScript, you should checkout this article about HTA's. I think this is just what you are looking for if you want to fiddle around with VBScript and need a GUI to make it interactive.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
When I type in ubuntu terminal:
$ rvm help use
The command output looks like:
M-bM-^HM-4 rvm use [ruby-string]
Setup current shell to use a specific ruby version.
...
What are the M-bM-^HM-4 characters? Should I use a special command to read the help?
This are unicode characters:
∴ rvm list
I see it too. Looks like it's just some weird characters that the documenter typed in before every instance of the term "rvm".
Likely on their console, it highlights the term, or something similar.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
In the Python Pyramid tutorial, I encountered this phrase:
"Windows users will need to adapt the Unix-isms below to match their environment."
It appears to relate to the "Export" command, but I am not entirely sure. The question therefore, is how do others go about this process of identifying and adapting "Unix-isms"? My only method so far is to see what isn't recognized, and obviously that could be due to different reasons.
Regarding research, I may have found a paywalled explanation for export specifically, but I'm sure there are better resources for adapting these commands.
Thank you!
The $ symbol is a Unix prompt
The ; is a command separator
export sets sets an environment variable, similar to setx
PATH=/path/to/tutorial_workspace/venv/bin:$PATH is modifying the PATH environment variable, similar to PATH=/path/to/tutorial_workspace/venv/bin;%PATH%
which searches the PATH for a program and returns its location.