35,096 questions
3
votes
2
answers
90
views
Handling text input width and making it responsive
I'm working on my unit conversion solo project from the Scrimba Front-End developer course, and I'm struggling hard to make my text input squarish yet responsive.
I managed to make it somewhat like ...
0
votes
0
answers
23
views
Provide automatic key arrow inputs in interactive cli program
I want to automate the installation of a program (cuda toolkit to be precise) which uses an interactive cli by providing predefined arguments.
I can pass arguments based on strings like accept etc as ...
Tooling
3
votes
2
replies
68
views
How do i include a Search Bar on a Course hub Website
Pov: you have a website full of courses.
How do you make it easily accessible to customers using a search bar. Including a navbar and a possible way of rearranging the page in such a way that it ...
0
votes
2
answers
71
views
Angular Material: set the border color of an input field embedded within mat-form-field
I'm using Angular Material 21. The component's template has two <mat-form-field> elements, each one contains an <input> element. I would like to set a red border to the first input element ...
Advice
0
votes
6
replies
96
views
Python append list
I am a beginner learning GCSE level python, but stuck on this book problem
Here, the num1.txt file data is appended to the temp1list
num1.txt file data:
10,20,30,40
20,30,40,50
30,40,50,60
40,50,60,70
...
0
votes
3
answers
170
views
Why is my C program not printing the correct output when using scanf? [closed]
I’m a B.Tech CSE 1st-year student and I’m learning C. I wrote a simple program to take two integers as input and print their sum. But when I run it, the program either skips the input or gives the ...
Best practices
0
votes
7
replies
175
views
What is the Pythonic way to handle invalid user input in a while loop?
import random
number_to_guess = random.randint(1, 10)
while True:
guess = input("Guess a number between 1 and 10: ")
# This crashes if 'guess' is not a number
if int(guess) == ...
1
vote
2
answers
95
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
117
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
55
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
0
replies
109
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
83
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
116
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
132
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
53
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) ...