35,106 questions
-4
votes
2
answers
85
views
Input in if statements are hard [closed]
I have a question ovi, my question is about input() how do I make a input on a if statement block and make it about it for example a heads and tails game.
-1
votes
0
answers
37
views
How to handle non-numeric input when using scanner.nextInt() in Java [duplicate]
I’m learning Java and testing basic input handling.
I wrote the following simple program:
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner ...
1
vote
2
answers
85
views
Angular: Numbers only directive
I have this piece of code
<input matInput type="number" [(ngModel)]="value"
(ngModelChange)="onChange(true)" />
But I want to be able to enter only numbers, ...
1
vote
1
answer
87
views
Standard way to normalize mouse wheel input across devices and platforms?
If I want consistent scrolling behavior across platforms and different wheel resolutions, I need a way to make wheel input independent of the device’s physical precision.
Different mice seem to have ...
0
votes
1
answer
44
views
Why am I getting TypeError: unsupported operand type(s) when adding two numbers from input in Python? [duplicate]
I’m learning Python and trying to take two numbers as input from the user, then print their sum.
My code:
a = input("Enter first number: ")
b = input("Enter second number: ")
print(...
Advice
1
vote
1
replies
104
views
What modules exist for simultaneous input and output?
The prompt_toolkit module allows displaying output while simultaneously waiting for input without breaking the input line. Here's an example from the developer:
import asyncio
from prompt_toolkit....
0
votes
1
answer
80
views
I'm trying to have the user's cursor in an input statement at a specific point (after the ": |") so it types at that point
Here is my code:
print("Make a 20-digit code with numbers 0-9: |___|", end="\r", flush=True)
addDigits = input("Make a 20-digit code with numbers 0-9: |")
More ...
1
vote
1
answer
113
views
How can I get global keystrokes without eating all the keys?
I have a basic input grabber which looks like this:
Display *display = NULL;
int main(const int argc, const char *argv[]) {
display = XOpenDisplay(NULL);
if (!display) {
return 1;
...
0
votes
2
answers
119
views
How to copy the new value of a data attribute?
What I'm doing is having the value of my <input> reflected in the value of the data attribute every time I click a button, to then copy the value with another button.
Example: If I type "...
0
votes
0
answers
45
views
React Aria FileTrigger onSelect not firing on first file selection in Chrome iOS, subsequent selections trigger cancel event
I'm encountering an inconsistent event behavior with the FileTrigger component from @react-aria/components in a React application. The issue is observed specifically in Chrome on iOS (version 140) ...
0
votes
0
answers
76
views
Android keyboard stutters/freezes when opening/closing with react-native-keyboard-controller (KeyboardAwareScrollView)
I’m seeing noticeable UI hitches only on Android when the keyboard opens/closes while using react-native-keyboard-controller. On iOS everything is smooth — inputs scroll correctly, no dropped frames.
...
3
votes
1
answer
60
views
How to read multi-line input from clipboard at once?
How do you read multi-line input from clipboard at once?
I tried using input but line change appears treated as Enter pressing.
>> x=input(char.empty,'s');
2020
2037
2054
2131
ans =
...
0
votes
0
answers
17
views
Contentful - How to add new input field custom URL
I need to add new input type text field as custom URL within the media content type.
Need help
I tried updating the custom URL to the description but the description is required for SEO purpose. If i ...
0
votes
1
answer
90
views
fileInput error "net::ERR_CONNECTION_RESET" caused by "Run App" button
I'm working on a R shiny application. When I use the "Run App" button on the R interface my fileInput doesn't seem to be working (see image below).
My browser console shows this error:
:...
0
votes
2
answers
86
views
Terminal does not return output, instead restarts code
I'm new to Python and I am building a simple interactive calculator as a project. When I run the code in the terminal, it takes all the inputs but does not return the final output. The code restarts ...
0
votes
0
answers
46
views
Cannot successfully set input from workspace for Simulink test harness
I am trying to use the test harness to verify the function of my Simulink model. I set the input from Workspace, and write a .m file to build the input structure(I got embedded bus element in my bus ...
1
vote
0
answers
202
views
GitLab Inputs not being imported into pipelines when put in a template
I have a .gitlab-ci.yml template that looks something like so
# .base.yml
spec:
inputs:
RUNNER_TAG:
default: "one"
options: ["one", "two"]
type: ...
1
vote
2
answers
79
views
Pyscript terminal worker not executing past input()
I'm trying to add a python terminal onto a website using pyscript to run programs I've written using
<script type="mpy" terminal worker src="subrepo/folder/program.py"></...
2
votes
0
answers
88
views
How to feed gets to avoid manual input during test execution? [duplicate]
I have a problem with one of my class methods.
class Input
# Method to get a valid number of days to assign prices to
def Input.get_valid_number_of_days
puts "Time to enter the number of ...
1
vote
1
answer
136
views
Issue when doing float(input()) in python
I have a small issue that I "understand" but cannot fix.
Imagine you have
s = float(input("Write a number"))
When on a linux terminal the user types 0.4 and press enter: ...
-4
votes
1
answer
82
views
List index function behaving wrongly and keeps setting index to 0 [closed]
pfz0 = ["","centi","milli","micri","nani","pici","femti"] # z for zeta
illion = ["llion","illion"]
a0_ni = ...
-3
votes
2
answers
69
views
Update collection from manual entered gallery details in power aps
I'm getting a filtered record set from a SharePoint list to a collection, and then I'm getting that collection data to a gallery. In the gallery, I have added a text input. If we think, for example, ...
2
votes
2
answers
70
views
How to toggle between input date and input number in Laravel 12 - Livewire
I have 2 inputs (date and number) in view - blade, like this:
<div class="col-3">
<label for="jatuhtempodate">Jatuh tempo</label>
<input name="...
0
votes
0
answers
75
views
How to resize spinner buttons of a ion-input type number in a ion-alert?
I would like to resize the spinner buttons of the number input I declared in a ion-alert.
view of the too small spinner buttons
I tried tips I found but it does not work in my case.
In my ts file:
...
0
votes
1
answer
64
views
How to disable quick input in VS Code – Code does not run in the terminal
I'm learning to program in Python with a focus on Data Science using VS Code, along with the Python and Jupyter extensions.
However, whenever I run any code that uses input(), the input prompt doesn't ...
1
vote
1
answer
85
views
Read-and-validate istream equivalent to fscanf
I have a very simple scenario that looks like
std::ifstream file("myfile.txt");
std::string discard;
int num;
file >> discard >> num; // to consume e.g. HEADER 55
Despite all ...
0
votes
2
answers
254
views
Handle Control losing focus between button press and release events
I'm making a small game with Godot, and the player can keep some panels on top of the game display while playing, for easy access to some actions.
The panel is a Control node, and it could appear on ...
2
votes
2
answers
122
views
Convert String input to int array in Java
How do I convert a numeric string input from a user into an integer array in Java?
What I did so far is:
# Get User input
System.out.println("Guess the number: ");
String input = read....
1
vote
1
answer
87
views
How to rotate a virtual camera using keyboard and the unity 6 new input system?
I'm a newcomer to programing and I have an issue regarding the camera controls in my 3d strategy game.
I've been trying to add a "rotation" functionality to the camera using the Q and E keys ...
-1
votes
1
answer
35
views
input type=file usage & customization
I am working on a standard NextJS/React app and have a (maybe basic) question.
It is related to the code below in a component.
return (
<form>
<label>
<input type=&...
1
vote
1
answer
60
views
How to prevent Enter from submitting while the user is still typing/composing (IME input mode) in JavaScript/React
When typing in Japanese, pressing Enter often just confirms the conversion but not the submission. How can I achieve this?
I have an input field and upon pressing enter it will submit.
So I have this ...
0
votes
0
answers
49
views
undefined reference to `DirectInput8Create' [duplicate]
please help.
I am learning the DirectInput API, but I am having trouble calling a single function DirectInput8Create() in my MSYS2-MINGW64 environment. I verified dinput.dll is in the bin/ directory......
0
votes
2
answers
62
views
React Input loses focus after state update
I am trying to build a custom form component. In this I use inertiajs useForm hook to automatically load the data into a state (similar to react-use-form).
But my problem is, that everytime i type a ...
0
votes
0
answers
57
views
Inputs inside modal don’t focus unless I scroll
I'm building an Airbnb-style React app. The header starts as an expanded version and shrinks once the user scrolls. To detect scroll, I placed a 1px invisible div at the top of the page and observe it ...
3
votes
1
answer
117
views
Is `0x1F` an ASCII scan code, and if so, how is it repeatable?
I am writing a CLI text editor in c. I have to handle a lot of CTRL+key inputs. Right now, I am using a macro that gets the key you want to pair with CTRL, like this: #define CTRL(key) ((key) & ...
0
votes
1
answer
70
views
Problem with <input type=file> on mac in telegarm web app
I have problem in telegram web app on macOS (Vue js). If i use input with type file, then click and choose nothing - input don't work again.
<template>
<div>
<button @click="...
1
vote
3
answers
358
views
How could I detect key events in the terminal using C?
My operating system is Arch Linux and my desktop environment uses Wayland. I've been trying to make a small renderer in the terminal which moves the camera around using WASD. I've disabled canonical ...
-4
votes
1
answer
60
views
Why Google Colab reported syntax error for my code regarding amplxl
I am very new to this. I wanted to use EXCEL table data as input for my AMPL optimization code through Google Colab. I wrote the code as below, but it said Syntax Error. I don't know why. Can anyone ...
-2
votes
1
answer
87
views
TypeError when trying to get input from user [duplicate]
I'm trying to get the input of index from the user using the code below:
menu = ["pasta", "pizza", "salad"]
user_choice = input("Enter the index of the item: ")...
-2
votes
1
answer
80
views
pug template how to use a label of a hidden file input to upload file?
I use pug template with Node.JS. How can I use a label to hide file input control and use the label click to upload file? I have done the same thing using bootstrap but not sure about about to ...
0
votes
1
answer
57
views
Unable To Interect with element in div || Selenium
keyword_input = wait_for_element(
driver,
By.XPATH,
'/html/body/div[12]/div[2]/div/div/div/main/form/div[14]/div/div[2]/input',
description="Keyword input field"
)
if ...
-1
votes
1
answer
86
views
Automatic insertion of a value in the program [closed]
I need to periodically record a value in the program using a dialog box.
The program is written in Borland Delphi 7, Windows API. The recorded value is stored in RAM.
I also have a Java program in ...
0
votes
0
answers
121
views
Power spectrum and power spectral density in Matlab
I'm currently trying to analyze the spectrum of a prbs signal in order to better desing inputs for my experiments. However, I have some confusion so far. On one side, we can use Matlab's cpsd function ...
0
votes
1
answer
69
views
Java:Is there a way to print in the same line that you press enter to do an input?
In Java I want to print after press enter to do an input but in the same line, e.g: 'Username: // User input // Other print'.
Doesn't matter if I need to print in the loop or in the find method, if ...
-1
votes
2
answers
121
views
Why is this throwing a number format exception
I'm working on a simple mortgage calculator right now cause I'm new to coding and not very good at it I'm trying to get ask the user how big the loan is so I'm trying to user Number.format for ...
0
votes
1
answer
55
views
python script fails to accept keyboard input, win 11, gitbash
Here is a script that try to capture human play and later feed to a train script. I found that is not able to accept keyboard input, win 11, gitbash. using window native cmd, also has same problem. ...
-3
votes
1
answer
72
views
Checkbox styles not aplying [closed]
I'm trying to style a checkbox with CSS, but my styles are not working, can someone help me?
I'm checking the checkbox using javascript, hence the "onclick: return false" code
input[type=...
2
votes
0
answers
56
views
How can I add more storage in assembly (x86) as user is typing input?
I am trying to build some kind of simple text editor and I am trying to get input from user but it is not unlimited, user can only input 10 bytes of memory
section .bss
input resb 10
info ...
0
votes
2
answers
118
views
Svelte input blur triggered when element is focused
Maybe its not related to svelte, but if do some DOM changes after input is focused, for example
<input onfocus={() => toggleVisibiltyOfOtherElement = true } onblur={() => console.log("...
0
votes
0
answers
17
views
Doube Tap issue on iOS devices(inputs with type="file")
I have tested this thing. There is a div element in my application with two inputs(type="file") inside. There are no any styles or libraries. Only this div and two inputs inside.
I don’t ...