Questions tagged [digits]
Questions dealing with getting, manipulating, or changing the digits of numbers
1,279
questions
1
vote
3answers
53 views
Why is my loop always running only one time?
actually am a beginner in c programming and I was trying to find out the sum of digits of a number. I developed a logic and my code was:
#include <stdio.h>
int main(void)
{
int n;
int count= 0;...
0
votes
2answers
39 views
flutter: how to show currency digits inside textfield
I want to make a textfield for input of money-amount in Won(Korean currency) like in these picture.
How do you show comma per each 3 digits?
TextFormField(
decoration: ...
0
votes
1answer
32 views
foobar please-pass-the-coded-messages hidden test case not passing
I have been attempting google foobar and in the second level i got the task named please-pass-the-coded-messages. below is the task
==============================
You need to pass a message to the ...
0
votes
0answers
14 views
Auto-typed brute force attack from the keyboard to a 4-digit code
I have a question about how to hacking simple brute force attack. I'm a layman in terms of programming code and I really need help. I have separated the topic into parts so that I can explain my ...
-1
votes
0answers
8 views
Control the number of digits in model summary output of R [duplicate]
Is there an effective way to control the number of digits in model summary output of R? it seems that options(digits = 3) only control the number of digits of t-value, not on the coefficients.
Thanks.
0
votes
0answers
30 views
How to replace digits except one character in sed?
I tried many ways to replace digits into @XXXX but I always get @1212 or just XXXX instead. I know I tried using this code:
sed -E 's/1212/XXXX/' file
but the only thing I want is to match digits [0-...
-1
votes
1answer
22 views
How do i run Nvidia Digits without import errors
I just tried to install Nvidia Digits 6.1.1 on my Ubuntu 16.04 Pc. I did every steps carefully but at the end of the installation i get this error on startup.
Traceback (most recent call last):
File ...
-1
votes
1answer
43 views
Formatting decimal digits of an float number? --PYTHON
Kind regards friends, I know there are many ways to do it. But all methods I have tried is giving me a conclusion which I don't want. As an example, there is a float value named 'yaw' which constantly ...
1
vote
1answer
39 views
Prediction with ANN are most of the time false
my probleme is that my ANN predicts only about 2 times out of 10 the right digit but when the ANN was fitted it tells me about 98% accuarcy. I'm quit a starter with ANNS and I don't know if I'm ...
1
vote
1answer
58 views
How to check whether or not a string consists of a single repeating digit using Python
the code:
def repeatingDigits(digits):
pattern = set(digits.lstrip("0"))
print(pattern)
if len(pattern) > 1:
return(False)
if len(pattern) == 1:
return(True)
repeatingDigits("...
1
vote
0answers
25 views
Regex: In a rule between 3 and 11 alphanumeric characters, how to limit between 0 and 3 digits [duplicate]
In a rule between 3 and 11 alphanumeric characters, how to limit between 0 and 3 digits anywhere in the value ?
I try this regex ^(?=.*\d{0,3})([a-zA-Z0-9_-]{3,11})$ but it do't work.
Matches examples:...
-3
votes
4answers
46 views
If the String has number inside then square the number and return as a String. How do i replace old number with the squared number Java
So it should work like that
squareDigits("a22b") on "a44b"
squareDigits("a9b2") on "a81b4"
What I have got so far :
public class Code {
public static void ...
0
votes
0answers
8 views
How get full number of digits in forecast coordinates in Weka
When I forecast [Explorer] coordinates the numeric result is rounded, reducing precision. It goes from:
41.4049364 2.177356
41.4049656 2.1773926
41.4049938 2.1774287
to
3 41.405 2.1774
...
1
vote
3answers
87 views
How to shortly add 1 to several variables in Python?
If we have chance to do so:
a, b = 1, 4
Maybe we have chance to iterate several variables simultaneously like this?
a, b += 1, 2
0
votes
3answers
59 views
Creating a number from smallest digits of other numbers
I'm looking for a way to create a number which is composed from the smallest digits of other numbers. It starts with an input which directs how many numbers there will be. After that the program needs ...
-1
votes
1answer
30 views
Suppose you buy 32-bit PC with 512 MB of RAM. What is the 8-hex digit address of the last byte of installed memory?
I've searched around and found a thread referring to how to convert 32mb, and using the power-of-2 method. But I'm still not finding the correct answer.
I also have another followup question dealing ...
0
votes
0answers
16 views
How to round when you have a mix of numeric and character in R?
After some statistics, I have a final data frame Measure containing 2 columns Mean and Sd.
We can easily merge Mean and Sd into a single column Mean_Sd:
Measure = Measure %>%
unite(Mean_Sd, Mean,...
0
votes
1answer
22 views
Generating a random sequence of 6 numbers with Python sometimes yields a result with only 5
I have a small problem with a function that should potentially generate a random 6-digit code. The code in itself is absolutely straightforward, using python 3 I do it like this:
def secret_code(num=6)...
0
votes
3answers
66 views
Adding comma every 3 digit problem, in python, what's different using list or using format
I am practicing an algorithm on a website.
I want to add data(number) comma(,) every 3 digit.
But 'a', which variable I made, can't be the collect answer.
But 'b', which variable I searched, is the ...
1
vote
1answer
20 views
How to get Max value from last two digits out of max 3 in Postgresql?
I want to trim some numbers to two digits and get the max value from it.
My table column is called "thousands" (int4) and has values like:
912
905
900
11
7
6
I expect to receive the value ...
1
vote
1answer
23 views
How I should remove digits with other characters (eg:100g) in R
The chips column table "productWords" looks like this:
"Natural Chip SeaSalt175g" "CCs Nacho Cheese 175g"
"Smiths Crinkle Cut Chips Chicken 170g" "...
0
votes
1answer
59 views
How to find the frequency of digits in a number using a switch statement?
For my college intro to computer science class we must write a program which outputs frequency of digits in a given integer. For example, if the number is 124243294 the output is:
Number Frequency
1 ...
-1
votes
2answers
48 views
Numbers and letters validation in C
I am new at programming and I faced up with validation. I try to write a program where the program gets the user’s Name and Age as inputs. And I need to check if the name contains only letters (it can ...
1
vote
0answers
34 views
Tesseract for negative numbers
What might I do to improve tesseract accuracy for negative numbers? For whatever reason it just won't detect it correctly, even though the picture is pixel-perfect.
I'm running tesseract 4.1, using ...
0
votes
0answers
28 views
how to sort and count and assign some value in python
every one, I am very much new in programming and facing a problem to write in code in python, i am having few data file. in first data i am having items with their codes. for example 001 = mango, 002 =...
0
votes
2answers
58 views
How to get/check number of digits of a row in a df.query()?
I have a dataframe df like:
number | col1
123 | a
1234 | b
567 | c
I want to count how many rows have more or less than 3 digits in column "number".
The column as dtype = int64.
...
1
vote
1answer
79 views
Recursive method that finds the difference between the number of digits in 2 given ints
The input is two given ints, which are both N numbers, the output has to be the result of the difference. For example, for the first number being 1234 and the second being 1, the output has to be 3. I ...
1
vote
1answer
84 views
How to check if two arrays have the same set of digits in C?
I want to check if two integer type arrays have the same set of digits. For example, if array 1 is 5 1 2 3 3 4 6 1, and array 2 is 1 2 3 4 5 6, the program returns 1. If any number from either array ...
-2
votes
1answer
34 views
C++ count digit of factorial of a large digit, two digit number or more [closed]
Click Here to View CodeFunction to perform factorial of digit and count the number of digit of that factorial
When i give "Input:13" this code give the desired output but when i use a "...
1
vote
1answer
54 views
JLanguageTool do not ignore digits in words
I'm using JLanguageTool with the German language (de-DE) for spellchecking and noticed that digits seems to be used as a word separator (just like spaces?). For example We8lt is not reported as a ...
0
votes
2answers
37 views
pytesseract can't recognise digits from a image,
The image I'm trying to analyze is the following:
I'm running this code:
from PIL import Image
import pytesseract
pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files\Tesseract-OCR\tesseract'
...
0
votes
4answers
81 views
Sum of Digits in a specific way in Python
I'm looking for a code that runs, i.e:
int(input) = 2565
Printed Output should be like:
2 + 5 + 6 + 5 = 18 = 1 + 8 = 9
I wrote the code that gives final answer "9". But I couldn't ...
-2
votes
1answer
32 views
I would like to store a number's digits individually in an array/ arraylist, and write them out in a given order. Any suggestions what im doing wrong?
I would like to store a number's digits individually in an array/ arraylist, and write them out in a given order. Any suggestions what im doing wrong?
import java.util.Scanner;
import java.util....
1
vote
1answer
74 views
Print all digits of a given number in LMC
I need to print all digits of a given number in LMC. I tried with this code who gives me the last digit but I don't know how to keep going with the other digits.
INP
L0 STA R0
SUB R1
BRP ...
0
votes
0answers
13 views
How to keep only n digits after a comma or a special character
Knowing that i couldn't transform it to decimal or float!
-1
votes
1answer
98 views
How to convert Integer in String and String in Integer in Haskell?
I'm still learning Haskell and I'm really confused with this language... i have to implement two functions fromInteger :: Integer -> String and toInteger :: String -> Integer that translate ...
0
votes
2answers
44 views
Huge Numpy list - How to get n digit?
Currently i have a huge database of randomly generated numbers in numpy.
array([62051180209, 87882444506, 49821030805, ..., 54840854303,
21222836608, 24070750502])
Now i want to check how many ...
-2
votes
2answers
63 views
Sum of digits in a number [duplicate]
This function is supposed to return the sum of all the digits in a number.
def sum_digits(num):
if int(num) <= 0:
return 0
else:
sum = 0
while int(num) != 0:
...
0
votes
1answer
31 views
MySQL JavaScript query replaces last digits of a number with 0
I have this code (shown below) that connects to the database, and then runs a SQL query that selects all the values (bigint snowflake IDs) in the "id" column that are also IN the array ...
2
votes
2answers
114 views
Find the sum of an even number from a list of integers
input-258345
output-14
ex-2+8+4=14
myList = input()
result = 0
for i in myList:
if not i % 2:
result += i
print(result)
I am getting an error:
if not i % 2:
TypeError: not all ...
0
votes
1answer
44 views
How to match a string with exactly one digit in R Studio? [closed]
I am trying to match a string with exactly one digit in R Studio
I already this Code:
grep("[:0-9:]+\d{0,1}]" , text_strings, value = TRUE)
but the output is still wrong
1
vote
2answers
97 views
How to print a float number without extra zero digits in C [duplicate]
When I print a float number with "%f", it prints a float with 6 digits, but I don't want to print extra zeros. I can to use for example "%.3f" to print just 3 digits, but I want to ...
0
votes
3answers
65 views
remove row if specific columns does not contain digit in pandas
I have the following pandas dataframe:
>>>ID WKT
0 4272 Point(4.21189 3.1298)
1 2345 Point(None None)
2 1254 Point (3.8945 4.6712)
...
I would like to remove rows that do no ...
0
votes
1answer
29 views
Extract from column only the digits and split to different columns
I have very big dataframe that a row in it typically looks like that:
>>>ID name year location
0 341 Dali 1995 {{"{\"latitude\":\"9.4714611480000004\"...
1
vote
1answer
29 views
Why I can't concatenate to rebuild and digits arrays the content of c char from text file?
the program fails. I want to rebuild the content of a text file eg: a1b2c3 to be like - a1b2c3123, the digits at the end of file
int counterc=0;
int counterd=0;
char rebuild[100];
char ...
0
votes
1answer
31 views
How do i write a program that calculates the product of a number's digits that are different from another number i input? [duplicate]
I have to input 2 numbers, n and k, and find the product of n's digits which are different from k.
Example: n = 1234, k=2, and the product should be 1 * 3 * 4;
#include <iostream>
using ...
0
votes
1answer
203 views
Cleanest way to check input char is between 0~9 in Assembly
The problem is to convert string to int in RISC-V
if any char that is not 0~9 exist, return -1 immediately
but I wonder if there's any way to check it by using minimum instruction
my way is to put 48 ...
-1
votes
1answer
35 views
Determine if a number contains a specific digit [duplicate]
My idea is to create a loop and not print numbers that contain a 3 in them like 13, 23, 43,etc. between 2 numbers given by a user.
My problem is on the loop. How do I check that the numbers contain a ...
0
votes
1answer
46 views
How do we express repeating numbers in oracle?
I have a field with an id value.
a ) The value of this field cannot be values like 0, 00000000, 99999999. How do I express this in oracle? Will I do it with Regex?
b ) The field cannot be all ...
0
votes
2answers
44 views
How to specify digits and imeOptions together in XML of Android Studio?
In Android EditText I found a strange issue. I have put android:imeOptions="actionNext" and it worked correctly but when I specified digits as android:digits="abcdefghijklmnopqrstuvwxyz ...