Data dodania Pytanie
2017-03-18 03:03 Fastest way to check whether a value exists more often than X in a list »
I have a long list (300 000 elements) and I want to check that each element in that list exists more than 5 times. So the simplest code is [x for x ...
(4) odpowiedzi
2017-03-17 17:03 Numpy reductions over successive non-contiguous slices »
Say I have two numpy arrays, A of shape (d, f) and I of shape (d,) containing indices in 0..n, e.g. I = np.array([0, 0, 1, 0, 2, 1]) A = np.arange(12...
(3) odpowiedzi
2017-03-17 11:03 Return object's property if it is found into an array of objects in JavaScript »
I have the following array of objects: var contacts = [ { "firstName": "Akira", "lastName": "Laine", "number": "054323654...
(4) odpowiedzi
2017-03-17 11:03 How to apply join only for particular section of an array? »
I'm getting an array and strigifying it in this array variable: let arrayStr = oldArr.join(', '); My array looks like this in console: (a), text1,...
(3) odpowiedzi
2017-03-16 18:03 Storing values from HTML Collection in array? »
I'm new to all this and I really need help. I've been on this for hours now. I have these checkboxes. I'm using a cfoutput to generate them and givi...
(1) odpowiedzi
2017-03-16 11:03 How to split a numpy array in fixed size chunks with and without overlap? »
Lets say I have an array: >>> arr = np.array(range(9)).reshape(3, 3) >>> arr array([[0, 1, 2], [3, 4, 5], [6, 7, 8]])...
(1) odpowiedzi
2017-03-16 10:03 Sort Multi-dimensional Array by Value? »
Hi i will try multi sort array , display array list base on recent post values, i need order list please find my code and help with us. <?php $da...
(1) odpowiedzi
2017-03-15 22:03 multiply every element in numpy.array a with every element in numpy.array b »
Given two numpy.arrays a and b, c = numpy.outer(a, b) returns an two-dimensional array where c[i, j] == a[i] * b[j]. Now, imagine a having k dimens...
(5) odpowiedzi
2017-03-15 19:03 get the i-th slice of the k-th dimension in a numpy array »
I have an n-dimensional numpy array, and I'd like to get the i-th slice of the k-th dimension. There must be something better than # ... elif k ==...
(5) odpowiedzi
2017-03-15 19:03 How to fix aborting Fibonacci sequence code »
I am trying to get a Fibonacci sequence of 5 million elements. This code aborts abnormally, when I pass 1000 as a parameter. def self.fibo_seq(limi...
(4) odpowiedzi
2017-03-15 16:03 Recurse through a dynamic array »
I am looking for a generalised solution for the following snippet:: var d = [[1,2,3], [1,2], [1,2,3,4,5,6]]; d[0].map((val1, index1) => { ...
(2) odpowiedzi
2017-03-15 09:03 Complex Laravel collection »
I'm having some issues with the Laravel Collection class. What I'm trying to do: I have a multisite solution in which a site has "facilitators". S...
(2) odpowiedzi
2017-03-14 13:03 Find Max Slice Of Array | Javascript »
I need to find the maximum slice of the array which contains no more than two different numbers. Here is my array [1, 1, 1, 2, 2, 2, 1, 1, 2, 2, 6, 2...
(3) odpowiedzi
2017-03-14 08:03 Can I manipulate the current iteration of the collection being currently iterated over? »
Say I have a collection of @lines, and I want to iterate over it, but I want to manipulate how it is iterated over based on the contents of the collec...
(5) odpowiedzi
2017-03-14 06:03 Need help writing a dynamic method that gives user a different prompt when the method is called with a different parameter every time »
Im trying to write a method that works around user choices (ex. queryChoicesMethod). There are 4 choices that the user can pick, and at the end of it ...
(1) odpowiedzi
2017-03-13 02:03 QuickSort vs MergeSort on arrays of primitives in Java »
I know that Java's Arrays.sort method uses MergeSort for sorting arrays of objects (or collections of objects) since it is stable, and Java uses Quick...
(4) odpowiedzi
2017-03-12 17:03 Skipping to next vowel and consonant in a string »
I completed an assignment that has the following instructions: Pseudocode and write a method that takes a spy's real name (e.g., "Felicia Torres")...
(4) odpowiedzi
2017-03-12 17:03 Concatenate Array in Java by Reference »
I would like to concatenate an array in Java by reference like so. int[] a = new int[] {1,2,3}; int[] b = new int[] {4,5,6}; int[] ab = concatArrayBy...
(3) odpowiedzi
2017-03-12 16:03 Concatenating a sequence of std::arrays »
Consider the following: (Wandbox) #include <array> #include <algorithm> #include <iostream> template<typename T, int N, int M&g...
(7) odpowiedzi
2017-03-11 21:03 Convert array of integers into dictionary of indices »
I have a (large) integer array like materials = [0, 0, 47, 0, 2, 2, 47] # ... with few unique entries and I'd like to convert it into a dictiona...
(8) odpowiedzi
2017-03-11 09:03 Cannot convert the value of type '[String]' to expected argument type 'String' : while appending arrays to get data from Fireabse in table view cell »
Getting error while appending arrays in snapshot. I want to retrieve all values from these arrays EngNames , UrNames and cakeImages in the snapshot so...
(1) odpowiedzi
2017-03-11 07:03 How to make for loop to execute very faster using swift »
Hi am developing a app using swift 2.2 in my app i want to follow pinterest style collection so that am followed a method CHTCollectionViewWaterfallLa...
(0) odpowiedzi
2017-03-11 01:03 How do I find the index of any element from an array within another array? »
I have an array: ["a", "b", "c", "d"] How do I figure out the index of the first element of the above array to occur within a second array: ["next...
(3) odpowiedzi
2017-03-10 18:03 Flat Array vs nested Array in React are treated differently »
I have noticed that I can pass to React a set of nested arrays and it will render the items properly, but when I go this way, it will not complain of ...
(2) odpowiedzi
2017-03-09 22:03 What is a faster way to write this function to delete rows/objects in a table? »
So, I have this function that, after an update, deletes elements from a table. The function, lets call it foo(), takes in one parameter. foo(obj); ...
(2) odpowiedzi
2017-03-09 19:03 Query where based on the values of a field that is an array »
I have a class User that has a field permissions that is an array. t.text "permissions", default: [], array: true The array permissions could h...
(2) odpowiedzi
2017-03-09 14:03 How to add values to an object property from another object having the same definition In JavaScipt »
I have an object similar to the one below: var obj1 = { fparams: { keys: ['a', 'b'], pairs: { 'p': 'qwert' } }, qparams: { ...
(4) odpowiedzi
2017-03-08 22:03 Using matrix operations instead of FOR loop for boolean comparison of cell array to index value »
I have a function that takes one vector as its input, uses another function to create a derivative vector from the input, and then compares the two ve...
(1) odpowiedzi
2017-03-08 13:03 How to perform sort in js? »
I have an array like this var temp = [{"rank":3,"name":"Xan"},{"rank":1,"name":"Man"},{"rank":2,"name":"Han"}] I am trying to sort it as follows ...
(3) odpowiedzi
2017-03-08 13:03 XPath Parsing in JRuby »
This is my line of code in JRuby when XPath.match(@xmlDoc, "//services/service[./serviceType = 'ADDRESSBOOK']/@data-uri").value When I run this I g...
(1) odpowiedzi
2017-03-08 08:03 Change property name dynamically »
I have an object like this var taskText = { 0: "t1", 1: "t2", 2: "t3", 3: "t4" } i'm gonna remove the 1 property using delete like...
(4) odpowiedzi
2017-03-07 18:03 RSpec ruby parameter »
describe Array do describe "#sum" do it "has a #sum method" do expect([]).to respond_to(:sum) end it "should be 0 for an empty ar...
(2) odpowiedzi
2017-03-07 14:03 How do I access the next item in the array, in the current iteration with Ruby on Rails and Haml? »
I iterate through an array called questions. I need to compare the current "question.title" to the next "question.title. It looks like this: - questi...
(1) odpowiedzi
2017-03-07 14:03 How to combine arrays of monoid type? »
A list or array of monoid type A is a monoid too. Now I would like to combine arrays of integers using cats. scala> 1 |+| 2 res1: Int = 3 scala&g...
(1) odpowiedzi
2017-03-07 10:03 how to append array value from < cfloop> in coldfusion? »
I am a beginner in ColdFusion and want to append values to an array from within a loop. I have written this code, but it does not work for me. <cf...
(1) odpowiedzi