Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I've been over time developing bash scripts here and there to make things easier for me, but they pretty much always just take some input and calculate some output.
I was wondering how to do more fancy stuff like:
Writing and updating the progress of an operation to the same pixel of the screen (instead of being only able to "append" new text or lines to the screen);
Allowing the user to select from a set of options (similar to using a List component in standard UIs);
From what I've gathered these things are not the simplest to be done just with bash. Is there any kind of library I could use that would take care of them for me? Maybe even in other languages (such as Python, perl, go, etc?) I've looked into zenity but that one is popping actually UI dialogs and that's not what I'm looking for.
Thanks
For bash, I'd encourage you to look at dialog. It might be everything you need:
Linux Journal: Dialog: An Introductory Tutorial
LinuxCommand.org: Dialog
Another option is Zenity
In general, ncurses is often an excellent choice. It's native to C, but there are ncurses bindings to most languages, including C, C++, Python and Perl (to name just a few).
whiptail seems to be another option: http://xmodulo.com/create-dialog-boxes-interactive-shell-script.html
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I'm new to rust and am trying to find out more about functions, structs, methods, etc. as I work on a project with external crates. I'm reading the documentation as I go which is sufficient but slow, as I'm used to something similar to getting Information on a function etc. I see that there is debugging, but I was wondering what general methods are out there to finding information on structs methods etc. aside from 'read the manual' or 'look at compiler errors'
Personally, I generally keep tabs to https://doc.rust-lang.org/std/index.html and https://docs.rs/ open. Of course, you likely have already considered those options.
As suggested by rodrigo#, you can run cargo doc --open to locally generate crate documentation for your project. The --open option will attempt to open the webpage for the documentaion in your preferred browser. (On macOS, this seems do work okay.) The webpage will be at something like <project-root>/target/doc/<project name>/ index.html.
Another alternative is to install rust-analyzer which will run an LSP server for Rust. This server can be integrated with many different IDEs or Editor to quickly show documentation or even jump to the implementation of a function. For example, I setup lsp-ui for Emacs a few weeks ago and have found the lsp-ui-doc-show and lsp-ui-peek-find-definitions to be very helpful for those purposes.
Hopefully some of this advice helps! =]
Aside: It's worth noting that Python and R are interpeted languages, and so have CLI-like environments where you can run something like a help function. Rust is however not an interpreted language, so you're not likely to find something very close to what you see in Python and R with respect to "help" functions.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I've always wanted to know how CL GUIs like top or nano or vi are constructed? I have a need to actually make one and am looking for a guide or tutorial on the general idea behind them.
Here is a bunch of them.
Also there is a list.
CDK
Dialog
ncurses
Newt, a widget-based toolkit
PDCurses
SMG$
Turbo Vision
You could start by reading about ncurses, it’s a very well-known library to draw on the terminal
Check out TWIN (apparently, inspired by Turbo Vision) by Massimiliano Ghilardi. More screenshots are available here. Be sure to use the GitHub version, as SourceForge repository has been unmaintained since 2002.
If you don't mind your GUI running in a JVM, take a look at Lanterna (Java and Clojure bindings).
I've also seen a post about Turbo Vision "ported" to (or rather rewritten using) C# and XAML, but haven't had a chance to examine it.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
Do you know any editor for man(1) pages which work on text screen (terminal and console)? Searching the interned did not gave any useful results as the words are very common.
Or should I learn the details of the format and write it by hand?
You can write it e.g. in markdown then convert it via e.g. pandoc to manpage format ((t|g)roff). Here is the fine manual: http://johnmacfarlane.net/pandoc/README.html .
HTH
Sure, go ahead and learn the format and write it by hand in a regular text editor.
On the other hand, the perl project uses a kind of universal markup called pod and then converts into manpages by running pod2man.
Man pages are written in plain text with a simple markup language called troff.
Actually there are several related markup systems all supported by a set of commands ending in roff: nroff, troff, and the all singing, all dancing super-set groff.
My Mac OS 10.5 systems has a nice summary of the history in man 7 roff.
As others have noted there are several tools around which can convert other markup formats to man pages.
The easiest way is to write content as "reStructuredText" (simpler than wiki syntax) and use docutils to generate manpage from it.
See this tutorial.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
Is there a tutorial for using AutoIT to handle modal windows in Watir or Firewatir?
Firstly let me again plug the hardware click duck punch for WATiR, which can be found here. This will allow you to do hardware left clicks on discoverable elements, and you can tweak it to do whatever you need. It will literally take your mouse pointer and do a top-level click at the coordinates.
Secondly there is a method in WATiR to handle modal dialogs:
ie.modal_dialog.text_field(:name, 'my_textfield').set('badger)
Although I think this is version specific, you may have to dig out an older version.
Thirdly, yes. Ish. Here are some resources that will be helpful:
List of AutoIT win message codes
AutoIT with Ruby
Steve Swanson being all helpful
There is also a method in Watir to send keystrokes: browser.SendKeys("boo{TAB}{ENTER}")
But an actual "This is how to use AutoIT in WATiR to interact with modal windows"? Not that I've ever seen or can find. If you wish to take this approach you may want to search for "Ruby AutoIT" rather than "WATiR AutoIT".
Every AutoIt installation comes by default with a tutorial on automating Notepad (notepad.exe), which also deals with the modal window that appears when you are asked to save a file. The tutorial explains the absolute basics, which depending on your own know-how, might not be what you need. If you need a more specific answer, then clarify what you're trying to do. As a final note, I want to add that there are no tutorials on how to deal with Watir or Firewatir specifically.
Use Ruby ability to access AutoIt methods.
Search for these lines:
require 'win32ole'; au3 = WIN32OLE.new("AutoItX3.Control")
Watir can handle different pop-ups on its own with little efforts. Look here.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I enjoy the game of Go (also known as weiqi in China or baduk in Korea). I want to create a program (an evaluation function) to play it.
I would prefer if the framework handled two important tasks:
Handle rules for the game, including captures, ko rules, and final scoring.
Handle communication between a server like KGS and my program.
Also, my home machines run Linux or Mac OS X; I cannot use any only-Windows platforms.
Thank you!
GNU Go is a great open source Go program. Its evaluation function is well-documented and it provides an easy way to output the explanation for every move the program made. You can either replace the evaluation function from scratch with your own, or tinker with the existing one.
Open Go is an open source tool with code for communicating using the Go Modem Protocol. I believe that's what you need for the second part of your question.
This is an old question, but for people out there interested in an Android implementation of Go (Baduk/Weiqi) take a look at my project on https://github.com/amgreg/AndroidGo
It's a simple validator with a user-interface attached. Drawbacks are: No AI; no scoring; no server connection.