variable-length Questions

4

Solved

I have a dataset that looks like below. That is the first item is the user id followed by the set of items which is clicked by the user. 0 24104 27359 6684 0 24104 27359 1 16742 31529 31485 1 167...
Treed asked 7/3, 2019 at 10:8

5

Go's builtin len() function returns a signed int. Why wasn't a uint used instead? Is it ever possible for len() to return something negative? As far as I can tell, the answer is no: Arrays: "The...
Ell asked 22/8, 2016 at 21:22

5

Solved

I am currently working on this problem as a personal project. Basically: Given an array of elements, e.g. E = {1,2,a,b} and Given a number, K, e.g. K = 2 I want to return all Combinations of E...

6

Solved

>>> n = [1,2,3,4] >>> filter(lambda x:x>3,n) <filter object at 0x0000000002FDBBA8> >>> len(filter(lambda x:x>3,n)) Traceback (most recent call last): File ...
Tepid asked 4/10, 2013 at 13:15

10

Solved

I haven't used C very much in the last few years. When I read this question today I came across some C syntax which I wasn't familiar with. Apparently in C99 the following syntax is valid: void f...

2

Solved

Background: In traditional Reverse Polish Notation, all operators must have fixed lengths, which allows RPN to be easily evaluated and manipulated by code because every token, expression, and subex...

11

Is this the best way to make a variable sized struct in C++? I don't want to use vector because the length doesn't change after initialization. struct Packet { unsigned int bytelength; unsigned ...
Cyclonite asked 27/3, 2009 at 3:48

4

I am trying to do some vanilla pattern recognition with an LSTM using Keras to predict the next element in a sequence. My data look like this: where the label of the training sequence is the la...

2

Solved

I have a problem with Python 3. I got Python 2.7 code and at the moment I am trying to update it. I get the error: TypeError: object of type 'map' has no len() at this part: str(len(seed_cand...
Discerning asked 2/5, 2016 at 12:48

11

Solved

I'm little bit confused when do I really need to use that length-1. I know that is when we don't want to have out of bound error. For instance I wrote this simple array: int [] oldArray = {1, 5, ...
Nucleon asked 21/10, 2013 at 3:49

3

Solved

I want to make a variable length array in Javascript. Is this possible. A quick google search for "Javascript variable length array" doesn't seem to yield anything, which would be surprising if it...
Graffito asked 24/3, 2010 at 2:37

11

Solved

I need to find out whether a name starts with any of a list's prefixes and then remove it, like: if name[:2] in ["i_", "c_", "m_", "l_", "d_", "t_", "e_", "b_"]: name = name[2:] The above only ...
Marchant asked 24/9, 2011 at 15:29

3

If I use len(np.array([[2,3,1,0], [2,3,1,0], [3,2,1,1]])), I get back 3. Why is there no argument for len() about which axis I want the length of in multidimensional arrays? This is alarmin...
Lecythus asked 28/3, 2017 at 23:43

5

Solved

I would like to use a multidimensional array to store a grid of data. However, I have not found a simple way to find the length of the 2nd part of the array. For example: boolean[][] array = new b...
Hindermost asked 19/9, 2012 at 21:3

4

I want to do some exercise about va_list. This is my code. int myscanf( char* fmt, ... ) { va_list ap; va_start ( ap, fmt ); vfscanf ( stdin, fmt, ap ); va_end ( ap ); } int main() { int a, ...
Magdala asked 22/7, 2016 at 11:57

4

Solved

I have read in a large data file into R using the following command data <- as.data.set(spss.system.file(paste(path, file, sep = '/'))) The data set contains columns which should not belong, ...
Samford asked 16/4, 2013 at 2:25

6

Solved

Why doesn't C allow a function with variable length argument list such as: void f(...) { // do something... }
Mcgovern asked 4/7, 2011 at 10:49

2

Solved

So, this may be a simple question but I'm having some trouble finding the answer anywhere. Take for example I have a simple program where I want to divide a by b like so: def main(): a = 1234567...
Waterbuck asked 31/5, 2014 at 13:9

3

Solved

I have a lot of cases when I iterate over a vector in MATLAB, so I do this : len = length(vector) for i=1:len do_something(); end But this is just an intuition that says "prevent calling the l...
Decigram asked 15/5, 2014 at 12:5

1

Many processors have instructions which are of uniform format and width such as the ARM where all instructions are 32-bit long. other processors have instructions in multiple widths of say 2, 3, or...

2

Solved

With MyISAM having variable length columns (varchar, blob) on the table really slowed queries so that I encountered advices on the net to move varchar columns into separate table. Is that still an...
Forbore asked 27/4, 2011 at 19:9

1

Solved

The best advice I found for editing a variable-length list of items was written for ASP.Net MVC 2 in 2008. http://blog.stevensanderson.com/2008/12/22/editing-a-variable-length-list-of-items-in-asp...
Meleager asked 11/6, 2012 at 4:18

2

Solved

How do you go about defining a two-dimensional MxN array in Cobol of which both M and N are of variable length? Here's the message I get in Net Express when attempting to have a variable array ins...
Cowskin asked 25/1, 2010 at 18:8

0

Cross posted: Need a good overview for Succinct Data Structure algorithms Since I knew about Succinct Data Structures I'm in a desperate need of a good overview of most recent development...
Sunward asked 30/4, 2012 at 17:33

3

Solved

My tuple looks something like this(for a particular set of generated value) tTrains = [ (3, ), (1, 3), (6, 8), (4, 6, 8, 9), (2, 4) ] Now, what I need to find is the length of longest tuple insi...
Veliz asked 7/4, 2012 at 21:11

© 2022 - 2024 — McMap. All rights reserved.