Questions tagged [variable-length]

Refers to anything whose length can vary

Refers to anything whose length can vary

290 questions
0
votes
1 answer

Node.JS convert Variable-length binary data to jpeg or png?

I was wondering how to convert Variable-length binary data(255216255224016747073700110010100255) to a jpeg or png to the web browser? Example Code: var Connection = require('tedious').Connection; var config = { "userName":…
camelCaseD
  • 2,483
  • 5
  • 29
  • 44
0
votes
1 answer

T-SQL UDF scalar function to return char of variable length

I wish to write a User Defined Function that will return a char value that is sized according to an input parameter. I'm not sure it is even possible, but I thought I'd ask anyway. So I have a query that looks like this: SELECT Convert(char(10),…
Chris
  • 439
  • 7
  • 15
0
votes
5 answers

using .length on vars that don't have the length property results in crash

I have a big array which contains all kind of types (booleans, arrays, null, ...), and I am trying to access their propiety arr[i].length, but some of them obiously fail to have length. I wouldn't mind if the guys missing length returned undefined…
ajax333221
  • 11,436
  • 16
  • 61
  • 95
0
votes
3 answers

Limiting the length of an input to x amount of digits

I'm running a java program I created that stores data inputted by user. Specifically 4 array lists which are songName, songArtist, songYear & songAlbum. I have a user input for "songYear" and I only want the program to accept a maximum of 4 digits…
RarkMowe
  • 77
  • 1
  • 3
  • 10
0
votes
1 answer

Making compatible (equal) dimensions for two vectors in R

I have a vector called classes that is the output of an analysis that used listwise deletion. As a result, the cases included in classes is a subset of the entire dataset -- some cases were dropped because of incomplete data. Selection is a dummy…
Captain Murphy
  • 855
  • 3
  • 15
  • 23
0
votes
3 answers

variable-length array and segmentation fault

In the following code if I declare the variable-length array 'int array1[x]' before scanning the desired length of the array 'x', I receive ' segmentation fault (core dumped)' while execution. (compilation is error-free). I used strictly ANSI C99…
KawaiKx
  • 9,558
  • 19
  • 72
  • 111
-1
votes
0 answers

.length variable failed to be shown

Beginner. optNumber variable is supposed to be a number from .length but failed to be shown. Instead it shows "jQuery{(optNumber)}". Why? const jQuery = optimizely.get('jquery'); const optNumber = jQuery('.item').length; const html = `
Jane Lim
  • 3
  • 3
-1
votes
1 answer

Finding the midpoint of tuple of any length in python

I need to take a tuple of any length and preforming an operation to return the midpoint. However, I need to function to work with a tuple of any length so I'm not sure how to go about it. def findMidpoint(P: tuple, Q: tuple) -> tuple: …
Kay
  • 17
  • 2
-1
votes
1 answer

Run function over dataframe with columns of differing length after dropna()

I am trying to apply the following function over each column in a dataframe: def hurst_lag(x): minlag = 200 maxlag = 300 lags = range(minlag, maxlag) tau = [sqrt(std(subtract(x.dropna()[lag:], x.dropna()[:-lag]))) for lag in lags] …
SGriff
  • 1
  • 2
-1
votes
1 answer

In Python why does the variable specified inside the loop has length 1 whereas the other outside the loop has its original length?

As declaring a variable1 inside for loop I have assigned some string to it>>>whereas given another variable2 .....when provided with the output it shows variable1 len is 1 and variable2 has 8 how does that work??? for variable1 in "something is…
-1
votes
1 answer

What exactly is going on here? (Python 3.7.6)

I'm studying someone else's solution on Codewars and am a little puzzled about something. Here is a link to the original question: Reverse or Rotate?. Credit goes to the original author, falsetru. Here's the solution: def revrot(strng, sz): …
-1
votes
1 answer

how to check length in Angular

I have normal tag components and super tag component. I've imported both component in my Edit Page Component. I'm trying make the user have at least 1 normal tag and super tag before they exist/close Edit page but not too sure how I can check the…
user13844259
-1
votes
1 answer

SAS: adding character variables in data step without setting the lenghth in advance

In a SAS data step, if one creates a character variable he has to be careful in choosing the right length in advance. The following data step returns a wrong result when var1=case2, since 'var2' is truncated to 2 characters and is equal to 'ab',…
Giuseppe
  • 518
  • 10
  • 22
-1
votes
2 answers

Why can't I get an array length after I split a string in google script?

In Google script, after I split a string, I can't then get the length of the resulting array. I guess it's not an array? If so, how can I turn it into an array with a length value? function splitAndCount() { str = "33,34,35"; //example string …
-1
votes
4 answers

Javascript new keyword .length not working

Hoping someone can shed some light on this simple piece of code not working as expected: var arr = new Array(10); arr.length; // 10. Why? Very wierd. Why does it return 10?
kea
  • 75
  • 9