1,060 questions
0
votes
2
answers
77
views
How to auto-adjust the width of an input field based on character length of the decimal displayed within?
I'm working on a very simple program that takes a user-specified number (can be an integer or a float of any length) and performs one specific multiplication operation on that number. The program then ...
0
votes
0
answers
82
views
length greater than 32767 characters Oracle
I have the following code:
declare
v_output varchar2(32767);
begin
v_output := shell('ls -ltr /opt/ibm/');
dbms_output.put_line(v_output);
end;
It throws error as the output is more than 32767 and ...
2
votes
2
answers
78
views
What Excel function can I use to calculate the length of a date time string?
I am trying to calculate the length of the date-time string in a cell
In Microsoft Excel I am using the LEN function to calculate the length of the date time string in cell C2.
The value in C2 is 2017-...
2
votes
0
answers
79
views
Inconsistent behavior of EXCEL formula functions TYPE and COUNTA depending on text length
While writing some custom lambdas in an Excel workbook I had inconsistent results (and even Excel crashes, with a recursive lambda) depending on the length of the input text.
I was able to trace down ...
-1
votes
1
answer
85
views
How to count string's length in Python (if the string includes character escaping)? [closed]
There is a string
x = '1a\u0398\t\u03B43s'
How to count its length only using code?
I mean to add before the string r manually is no good
(x = r'1a\u0398\t\u03B43s').
Have tried this solution, but ...
1
vote
1
answer
375
views
Length of unicode emoji varies
I build a webapp and one specific user uses a chef-emoji (https://emojipedia.org/de/koch#technical) in his username.
At some point in my code I need to get the length of his username string.
I noticed ...
0
votes
1
answer
881
views
In Entity Framework how should I limit string length to no greater than 12000 characters
I tried the obvious...
[StringLength(12000)]
public string Instructions { get; set; }
...(also tried MaxLength) but when I run add-migration I get empty Up() and Down() methods. The only impact of ...
2
votes
1
answer
106
views
compareTo() method on integer (Java 8, Comparable, Comparator, sorting, String)
We can apply comparable & comparator both on integers, as like below:
List<Integer> intList1 = Arrays.asList(1,9,4,8,2,3,7,4,5);
Optional<Integer> val1 = intList1.stream().sorted((a, b)...
0
votes
1
answer
49
views
how to select rows that are x characters shorter than longest
I have a study assignment and I've been banging my head in the wall for at least a day now.
I'm totally new to this and just learning the basics.
This is my assignment:
Use union to combine these ...
0
votes
1
answer
67
views
How i can check the full length of number even if it includes zeros?
i want to check the length of x that includes number like (600,000) it always returns length of 5 not 6.
i think R doesn't count if they more than 4 zeros like above.
i want know how to count the full ...
0
votes
2
answers
311
views
In Tcl, why is the string length of an empty string 1, not 0?
In tclsh, first make an empty string:
set a []
Then run the following command:
string length a
It returns 1.
I'm expecting a return value of 0 for the length of an empty string, because it is defined ...
0
votes
2
answers
44
views
StringLengthAttribute does not enforce length
I have a property with StringLength attribute, but I can assign a string of any length to this property. I created the following test program in VB.NET 4.7 Framework:
Imports System.ComponentModel....
-1
votes
1
answer
208
views
C++ wrong std::string length when using constructor from "empty" char array
I tested this code snippet on different compilers but always got the same result, but I just can't understand why.
unsigned char buffer[0x4000] = {0};
string strText((char*)buffer, 0x4000);
cout <...
3
votes
1
answer
198
views
Strlen function giving wrong length when there are non-english characters in string
I have a program that accepts non-english characters also as an input field. Because we use strlen, it has failed to give expected length while calculating the length of the string when there is a non-...
0
votes
1
answer
48
views
How to get terminating length in length of string in java? [closed]
As the strings in C/C++ are terminated with the null character '\0', the strings in Java are terminated with length in length.
How to get this length of string without using any in-built function in ...
0
votes
0
answers
41
views
I get an error "TypeError: object of type 'Number' has no len()" in my laptop or any other system while the same code run fine in my system
This is the definition file which is being used to run another .py file.
I do not know what's wrong here as the same code runs fine in my desktop system.
class scalarpow(object):
"""...
1
vote
2
answers
258
views
Some test cases failing while trying to implement palindrome of a string in C without using built in functions
I was given this problem as a lab assignment and I've only got 3 days left to submit it.
The program is to print 1 for a palindrome and -1 for not palindrome. I could've easily done this using strrev()...
0
votes
3
answers
1k
views
ReactJS Uncaught TypeError: Cannot read properties of undefined (reading 'length')
I am making a striking application. I use json-server(fake api) as backend. So when i wanted to add students -list, i use this code: {User. length === 0 ? " " : alert('Checking')} so that I ...
-1
votes
2
answers
65
views
The "randomword" can not access the .length method. Why is that?
I am trying to make a hangman game and I have a problem with finding the length of the random word chosen automatically
import java.util.Scanner;
import java.util.Random;
public class Main {
...
-1
votes
1
answer
77
views
Java Stream API to find a lenth of object (the length of toString())
I don't understand why this code snippet Non-static method cannot be referenced from a static context
people.stream()
.mapToInt(String::length)
.forEach(System.out::...
-2
votes
1
answer
57
views
While condition in python doest stop the loop when true
I made a loop that needs to stop once the list U has no values in it. Once it reaches that point, the loop doesnt stop and it gives an error, because there is a value by 0 (the len(U) in the last loop)...
1
vote
1
answer
114
views
c++, How to display an error if user inputs more than one char
I have been trying to find a solution for my school project. The program should display an invalid error if the user enters "Y Y". Currently the program still accepts it and moves on to the ...
1
vote
2
answers
122
views
Oracle - Why I can't exclude rows where length(listagg(somecolumn)) > xxx
I just can't seem to work this one out :(
I run a query that returns some results but in those results I need to filter out where this customer does not have freetext notes that are greater than 240 ...
0
votes
0
answers
17
views
how create a method that will only accept user input if its 1 character string long or else, print error [duplicate]
task:
take string input from user and determine if it is a vowel or a consonant. only accept input if its a string length of 1. If two letters then print error message.
note:
i had this same code ...
2
votes
1
answer
232
views
In a batch script, is there a documented length limit for Labels and the text which appears _after_ the Label?
Consider the following Label with text added after to clarify what the arguments are for in a batch script (anything after a space is ignored . . .):
:LineBuilder [1 - main var type 1] [2 - main var ...
0
votes
3
answers
154
views
C# Check if any element in an Array Group is Null before comparing length
I have a statement that compares the length of elements in all string arrays.
string[][] allMyArrays= new string[][] { myArray1, myArray2, myArray3 };
lengthMismatch = allMyArrays.GroupBy(x => x....
1
vote
4
answers
883
views
Get the printed length of a string in terminal
It seems like a fairly simple task, yet I can't find a fast and reliable solution to it.
I have strings in bash, and I want to know the number of characters that will be printed on the terminal. The ...
0
votes
3
answers
91
views
How to break up string based on specific length after finding the whitespace nearest to the character limit?
I have to break up a string field into multiple string fields if the original string exceeds a specific character limit. The original string can be of different lengths but the additional fields like ...
-3
votes
5
answers
274
views
Python Beginner lerning len [closed]
I am doing some exercises, and I am a beginner in python. Doing some coding challenge and there was an exercise that tells me I should ask my name, and it should show me how many letters my name has.
...
1
vote
0
answers
151
views
EF 6, .NET 4.8 : resulting query doesn't seem to use StringLength
I've seen similar questions and have tried applying the answers, but to no avail, so I wanted to ask my question with more context of what I've tried.
My property looks like this:
[Column("colnm&...
0
votes
1
answer
2k
views
How many characters are in RSA SSH public key?
In the Linux terminal, I am generating an RSA key as follows:
ssh-keygen -t rsa -b 1024
I expect to get a public key consisting of 1024 bits.
when I show the public key using this command:
cat id_rsa....
-2
votes
1
answer
316
views
Writing a string into shared memory from producer process with different character array sizes but same length string
I am trying to write a string into shared memory using a producer process as shown below.
int main(){
char str[30];
scanf("%[^\n]", str);
int shm_id = shmget((key_t)1234, sizeof(...
0
votes
1
answer
95
views
How to make a column hold the length of an other column in mysql?
I have a simple table:
CREATE TABLE Tabale.new_table (
index INT UNSIGNED NOT NULL AUTO_INCREMENT,
col1 VARCHAR(45) NULL,
length_of_col1 INT NULL,
PRIMARY KEY (index),
UNIQUE INDEX ...
1
vote
1
answer
128
views
Print Length of String Value in Dictionary
I have a list called movies that contains dictionaries that include key: value pairs such as title, description, genre, etc. I want to be able to find the string length of the description of a given ...
1
vote
0
answers
56
views
PHP Limit words breaks div in string
I use the following php function to limit word length:
function limit_words($phrase, $max_words) {
$phrase_array = explode(' ',$phrase);
if(count($phrase_array) > $max_words && $...
0
votes
1
answer
57
views
it should return the boolean value `True`,or`False`. but it doesn't return anything
a=[1, 2, 3 ,4 ,5]
for i in a:
even=[]
odd=[]
for j in a:
if(j%2==0):
even.append(j)
else:
odd.append(j)
def compareList(even,odd):
if(len(odd) > len(even)):
...
0
votes
1
answer
69
views
How to specify spacings among words of several sentences to force nth word in each sentence start from exact the same coordinate on plot in python
I am trying to write some grouped texts, each sentence in each group contain 4 parts: value + unit + symbol + value e.g., 0.1 (psi) -> 0.0223, on a plot. Each group will begin from a specified ...
-1
votes
1
answer
34
views
how to remove duplicate data in mysql based on code and filter based on user and curr
Date
time
seq
debet
credit
curr
nominal
trx
user
checker
ket
12/1/2022
8:01:01 AM
1
11-47007-7101-1722704-0000-00000
800135681140
USD
222
CGD
SX40107X
RS04536X
SUCCESFUL
12/1/2022
8:01:01 AM
2
...
-1
votes
3
answers
83
views
Is there a way to count the length and occurrences of repeated elements in a string?
I have this long string:
string = 'FFFFFFFFFFFFFFFFFFFFFABCABCABCBACBCABCBCABCABCBACBFFFFFACBCABCAFFF'
I want to count the occurrences of repeated 'F' sequences and their length. In this example, ...
1
vote
1
answer
55
views
Inconsistent output given by same code on different C compilers
Different compilers are giving different outputs for the same logic in my algorithm.
I wrote the following code for a C code exercise.
The code checks for the longest string in a string vector.
But ...
0
votes
2
answers
141
views
Why is the length function not working in this for loop?
Why this code is not working after using length function ?
If I use for(n of names) this for loop then its working fine!
I am trying to capitalize each first letter of the names array. So, firstly I ...
-1
votes
1
answer
62
views
how to check for a sub_string in a string using python? [duplicate]
I am provided a string and a substring in python. I have to check how many times the substring appears in the string. My input is the string and substring. My output should be the number of ...
-3
votes
3
answers
500
views
Why the strlen() function doesn't return the correct length for a hex string?
I have a hex string for example \xF5\x17\x30\x91\x00\xA1\xC9\x00\xDF\xFF, when trying to use strlen() function to get the length of that hex string it returns 4!
const char string_[] = { "\xF5\...
-1
votes
1
answer
777
views
How to remove from a list in python, all but one of the elements that have equal length?
I am inputting a list and it must contain only one element of a particular length.
I tried:
lst = list(input("list: "))
for i, j in lst:
if len(j) == len(i):
lst.remove(j)
print(...
-1
votes
1
answer
45
views
Get Xpath results on 13 digits length (website crawling)
i am searching a way to get the 13 digit (EAN) code of the following code:
`<dl>
<dt>Merk:</dt>
<dd>Keddoc</dd>
<dt&...
0
votes
1
answer
189
views
Superscript last three characters in dynamic cell range
The code runs, but I would like to subscript the last three characters. Currently only superscripts the last characters.
Dynamic Date: Wednesday December 21, 2022(A)
text = Row.Cells(1, 9).Value
'...
2
votes
2
answers
418
views
How to print the longest sentence from a column in a csv file
I am very new to python and am really struggling with this problem. I have a csv file with different columns, labeled "height" "weight" "full_name" etc. I'm trying to ...
0
votes
1
answer
73
views
How can I get the text length value after truncating through css properties in javascript? [duplicate]
Text:
Value soooo soooo lognnng Value soooo soooo lognnng Value soooo soooo lognnng Value
Normal length: 83
Text After Truncate:
Value soooo soooo lognnng...
Truncate length: 28
Question:
How to get ...
0
votes
1
answer
117
views
How to find the biggest word in a 2D array?
I have an array that has a list of 15 different country names. I have to create a function that finds the largest name and returns its index, and if there are more then one that have a maximum length ...
0
votes
1
answer
32
views
Why is my if() -statement not working here?
I have a simple jquery code here which includes a dialog with two text input fields, "nimi" and "tunnus".
Within the dialog is also a "save" button, which is meant to ...