input

Bash input without pausing the script?

我的未来我决定 提交于 2021-02-09 05:20:22
问题 In Bash the only way to get a (user) input seems to be to use the read method, which pauses the rest of the script. Is there any way to receive a command line input (ending with the enter key) without pausing the script. From what I've seen there may be a way to do it with $1 ..? 回答1: read -t0 can be used to probe for input if your process is structured as a loop #!/bin/bash a='\|/-' spin() { sleep 0.3 a="${a:1}${a:0:1}" echo -n $'\e'7$'\r'"${a:1:1}"$'\e'8 } echo 'try these /|\- , dbpq , |)>)

Bash input without pausing the script?

天大地大妈咪最大 提交于 2021-02-09 05:14:45
问题 In Bash the only way to get a (user) input seems to be to use the read method, which pauses the rest of the script. Is there any way to receive a command line input (ending with the enter key) without pausing the script. From what I've seen there may be a way to do it with $1 ..? 回答1: read -t0 can be used to probe for input if your process is structured as a loop #!/bin/bash a='\|/-' spin() { sleep 0.3 a="${a:1}${a:0:1}" echo -n $'\e'7$'\r'"${a:1:1}"$'\e'8 } echo 'try these /|\- , dbpq , |)>)

Bash input without pausing the script?

吃可爱长大的小学妹 提交于 2021-02-09 05:14:32
问题 In Bash the only way to get a (user) input seems to be to use the read method, which pauses the rest of the script. Is there any way to receive a command line input (ending with the enter key) without pausing the script. From what I've seen there may be a way to do it with $1 ..? 回答1: read -t0 can be used to probe for input if your process is structured as a loop #!/bin/bash a='\|/-' spin() { sleep 0.3 a="${a:1}${a:0:1}" echo -n $'\e'7$'\r'"${a:1:1}"$'\e'8 } echo 'try these /|\- , dbpq , |)>)

Write non English numbers in HTML input

穿精又带淫゛_ 提交于 2021-02-08 19:32:09
问题 I have a ASP .Net core web application and i am using Devextreme controls. My application should support Persian and Arabic languages including numbers and dates. I have my local windows keyboard with Persian language and when i type in notepad for instance it shows Persian numbers but when i write in my web application or any web page like google for example it only shows English numbers. I tried setting the lang attribute in the html tag to "fa" and didn't work. How i can use Persian or

Multiple lines input from console in c#

五迷三道 提交于 2021-02-08 13:59:16
问题 I am trying to read some values in c# from console and then processing them. However i am stuck at a error. The input from console is: Name:ABCD School:Xyz Marks:80 //here the user enters a new line before entering new data again Name:AB School:Xyz Marks:90 //new line again Name:AB School:Xyz Marks:90 and so on. I do not know before hand the number of console inputs...How can i detect that user has stopped entering & store the input. I tried using string line; while((line=Console.ReadLine())!

Extract data from excel file using C++ [closed]

北战南征 提交于 2021-02-08 12:09:22
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 9 years ago . Can anyone provide me a direct and easy way (ofcourse with codes and other necessary libraries to be included for right execution) to input data from excel file to C++? Actually, I need to input a huge amount of

How to restrict the user to only input whole number and refuse any other characters in scanf?

最后都变了- 提交于 2021-02-08 10:20:13
问题 I'm trying to get user input and allowing them to only input a whole number which is also positive. I'm trying to figure out this task printf("Enter the first and second number in whole number: "); scanf("%d,%d", &first, &second); if (input != '\n') //notice this line I'm trying to check if is a character// printf("Error! CHARACTER NOT ACCEPTED!!\n"); else if (First <= 0) printf("Error! First must be a positive value!\n"); else if (Second <= 0) printf("Error Second must be a positive value!\n

I want to trigger onChange after a delay from last change

给你一囗甜甜゛ 提交于 2021-02-08 10:01:54
问题 Basically, I have an angular application, and I would like to have (change) only be triggered after a few seconds of nothing happening. Therefore instead of sending requests every time a letter is written in an input field, only after writing a letter and nothing happening for a few seconds, then the request would be sent. 回答1: You may use rxjs debounceTime piped to the valueChanges observable of the reactive FormControl as in the example at https://stackblitz.com/edit/angular-debounce-form

Toggle visibility in Antd form

家住魔仙堡 提交于 2021-02-08 08:20:45
问题 I need to display certain inputs when an option from the dropdown menu is selected. The dropdown menu consists of three options, Blood Pressure, Weight and Temperature. When the user selects an option, the input fields relating to that option need to be visible and the rest hidden. For example when the user selects Blood Pressure, the systolic and diastolic input fields need to be visible, the temperature and weight fields need to be hidden. <Form.Item label="Vital"> {getFieldDecorator("vital

Capturing input without \n

醉酒当歌 提交于 2021-02-08 06:10:15
问题 I am making a simple 2d game in the terminal, and I have been wondering how I could get stdin without having to return. So, instead of the user having to press w\n (\n for return), they would just press 'w' and it would go forwards. scanf, gets, and getchar cannot do this, but I have seen it be done before in programs such as Vi. How would I achieve this? 回答1: You need to set your terminal to non-canonical mode. You can use functions like tcsetattr, and tcgetattr to set and get terminal