Data dodania Pytanie
2018-02-15 11:02 Compute the cumulative sum of a list until a zero appears »
I have a (long) list in which zeros and ones appear at random: list_a = [1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1] I want to get the list_b sum of the ...
(6) odpowiedzi
2018-02-14 11:02 Work on list of tuples in Scala - part 1 »
I'm new to Scala, and trying to understand how to work on lists of tuples, so I've created a fictive list of people: val fichier = List(("Emma Jacobs...
(2) odpowiedzi
2018-02-14 10:02 Python splitting list to sublists at given start/end keywords »
If I were to have a list, say lst = ['hello', 'foo', 'test', 'world', 'bar', 'idk'] I'd like to split it into a sublist with 'foo' and 'bar' as st...
(5) odpowiedzi
2018-02-14 09:02 Aggregate duplicate records by maintaining the order and also include duplicate records »
I am trying to solve an interesting problem, it's easy to just do a groupBy for aggregation like sum, count etc. But this problem is slightly differen...
(3) odpowiedzi
2018-02-11 22:02 How to remove duplicate items in nested list? »
I have a Haskel function called flatten that works as such: flatten :: [[a]] -> [a] flatten [] = [] flatten ([]:vs) = flatten vs...
(1) odpowiedzi
2018-02-11 12:02 Remove duplicates in list without scrambling values, in python? »
How to remove duplicates in a list, but without scrambling the values. The set() command removes duplicates, but then scrambles all the values, I bel...
(0) odpowiedzi
2018-02-11 09:02 How to get all permutations of string as list of strings (instead of list of tuples)? »
The goal was to create a list of all possible combinations of certain letters in a word... Which is fine, except it now ends up as a list of tuples wi...
(3) odpowiedzi
2018-02-10 16:02 What is the meaning of the cons "::" operator right after the "new" key word in this code snippet? »
I'm studying Scala and see in a tutorial the following definition. There are 3 "::". My understanding is that the first "::" is a method in class List...
(1) odpowiedzi
2018-02-10 15:02 Why assigning time in ArrayList and List is the same when adding 10000000 integers? »
I have the following code in which I compare the performance of the ArrayList and List through adding 10000000 integer numbers. In ArrayList I have bo...
(2) odpowiedzi
2018-02-09 08:02 Python - Flatten the list of dictionaries »
List of dictionaries: data = [{ 'a':{'l':'Apple', 'b':'Milk', 'd':'Meatball'}, 'b':{'favourite':'co...
(3) odpowiedzi
2018-02-07 11:02 How to check if tuple having a list or dictionary is empty »
I have a tuple: details = ({}, []) As there is no data in the following tuple I want to return a null response. For this I am writing: if not det...
(1) odpowiedzi
2018-02-04 20:02 backquote, unquote and unquote-splicing in normal functions »
I am still in the process of understanding macros and though I think I understand the basics of "backquote" "unquote" and "unquote splicing", I had th...
(3) odpowiedzi
2018-02-04 19:02 How to sort List<KeyValuePair<String,DateTime[]>> by date in c#.net »
I have a datatable in c#.net with below format DataTable mydt; mydt.Columns.Add("ID"); mydt.Columns.Add("date"); AND I FILL THIS DATATA...
(0) odpowiedzi
2018-02-04 01:02 Create a nested parent child list in Java 8 »
I am new to Java 8 and need a solution to the below problem. I have two classes as below: class Person { String name; int age; List<A...
(4) odpowiedzi
2018-02-03 22:02 Splitting a List Based on a Substring »
I have the following list: ['1(Reg)', '100', '103', '102', '100', '2(Reg)', '98', '101', '100', '3(Reg)', '96', '99', '98', '4(Reg)', '100', '100', '...
(8) odpowiedzi
2018-02-03 18:02 Clip up numbers bigger than maximum »
I have this function: fun min x y = if x >= y then y else x and I need to use this function (as a partial application) and make function clipup...
(3) odpowiedzi
2018-01-28 19:01 Generate combinations »
I am trying to write a function in Lisp that generates all possible combinations of given keys and values. Here is an example input and output: Input...
(2) odpowiedzi
2018-01-28 11:01 Removing and replacing coefficients of polynomials in Python »
I´m having some trouble using python´s list function for polynomials. For example, if I write the poynomial p1 = [0, 0, 0, 1, 1], I get the outpu...
(6) odpowiedzi
2018-01-26 23:01 Comparing two large lists and assigning property values from another »
I have a very simple method of comparing two lists and then assigning the value from first list to second like following: private void FindUPC(List&l...
(1) odpowiedzi
2018-01-26 13:01 Finding row in list - python »
I'm comparing two list of the same structure, one with the full dataset, and one with a subset.list_a ist the full list and list_b ist the subset. The...
(3) odpowiedzi
2018-01-25 18:01 Looping checkbox Coldfusion »
I have a loop with checkbox values. <cfloop list="form.check_values" index="i" delimiters=","> </cfloop> The problem is, when i loop th...
(1) odpowiedzi
2018-01-24 06:01 Scala large list allocation causes heavy garbage collection »
EDIT, Summary: So, in the long chain of back and too, I think the "final answer" is a little hard to find. In essence however, Yuval pointed out that ...
(1) odpowiedzi
2018-01-23 22:01 How are Kotlin Array's toList and asList different? »
The Kotlin Array class offers asList(), toList(), and toMutableList() methods. The first two methods both return a List and are described in the Kotli...
(2) odpowiedzi
2018-01-23 13:01 Haskell -- Sums Accumulated in Lists »
I need to create or know if there is a function in Haskell that allows you to add items from a list. So, for example: cumulativeAmount :: [Integer] -...
(3) odpowiedzi
2018-01-23 09:01 Crossing elements from two different lists »
I have two lists like this: > output [[1]] A C freq 1 11 432 2 4 51 332 3 [[2]] A B C freq 5 51 5 332 3 > k [[1]] [1] "A,C...
(1) odpowiedzi
2018-01-20 20:01 Recursive and random grouping a list »
I'm trying to write a function which creates dichotomously grouped list, f. ex. if my input is as following: [a, b, c, d, e, f, g, h] I want to ...
(2) odpowiedzi
2018-01-20 10:01 Remove elements from list which are just before some specific element »
Let's say I am having a list as: a = ['no', 'no', 'no', 'yes', 'no', 'yes', 'no'] Here I want to remove every 'no' which is preceded by every 'yes'...
(5) odpowiedzi
2018-01-14 23:01 Arrays, Lists and Hashtables in Common Lisp »
I am wondering what is the difference between arrays, lists and hashtables in Common Lisp. That is, I am aware how to implement and use them syntactic...
(1) odpowiedzi
2018-01-14 15:01 How to convert a `NonEmptyList[Either[Error, User]]` to `Either[Error, NonEmptyList[User]]` with cats? »
I'm using cats, wonder how to turn a data with it: val data = NonEmptyList[Either[Error, User]] to val target: Either[Error, NonEmptyList[User]] =...
(1) odpowiedzi
2018-01-13 12:01 LISP find last paired parenthesys »
The function i wrote has to return the position of the } corresponding to the first occurrence of the { it finds from the start (i'm not looking for t...
(0) odpowiedzi
2018-01-09 12:01 Convert list of ordered dict to nested lists »
I've list of ordered dict that includes some duplicate Ids in data.. something like this [OrderedDict([('caseId', 20), ('userId', 1), ('emailStatus',...
(2) odpowiedzi
2018-01-08 14:01 Outputting a list of lists in Haskell? »
I am a complete beginner to Haskell but I'm being asked to create a sudoku solver. I've been making some steady progress with it but one of the things...
(1) odpowiedzi
2018-01-07 19:01 How do you generalise the creation of a list with many variables and conditions of `if`? »
I create a list as follows: ['v0' if x%4==0 else 'v1' if x%4==1 else 'v2' if x%4==2 else 'v3' for x in list_1] How to generalize the creation of su...
(4) odpowiedzi
2018-01-07 15:01 Inserting list values from a list to another in a specific order in Python »
I was trying to insert list values from one list to another, but in a specific order, where dates[0] entered text[1], dates[1] entered text[3] and so ...
(6) odpowiedzi
2018-01-06 17:01 How Python execute [list] * num? what's time complexity and memory complexity? »
I am new to Python. I was recently confused by a syntax "[list] * k". I want to understand how Python actually executes it. Example: >>> l ...
(1) odpowiedzi