Data dodania Pytanie
2017-04-22 23:04 Why can a char pointer variable be initialized to a string but an int pointer variable can not be initialized to an array of integers? »
I am trying to understand the relationship between strings, arrays, and pointers. The book I am reading has a program in which it initializes a vari...
(3) odpowiedzi
2017-04-22 21:04 UIButton that increments an array from Core Data, done from another class »
I have a button that whenever it is pressed is supposed to increment by one, which as a result will display a new string into a textfield. I have a Co...
(1) odpowiedzi
2017-04-22 21:04 Chrome Array.sorting numbers out of order »
I was trying to sort an array of divs so that if a is below or to the left of b, a is before b. After a couple hours in CodePen, I realized that if a...
(5) odpowiedzi
2017-04-22 16:04 Getting multiple PHP variables into a Javascript array »
In my form, I have a lot of input type="radio" fields, which are generated by PHP looping codes. Each has its own name, which is an array. The values ...
(1) odpowiedzi
2017-04-22 15:04 How to convert array first value as key and second value as value »
Hi I am working on some array operations. I need to convert first value of array as key and second value of array as value. I have one variable $tes...
(2) odpowiedzi
2017-04-22 12:04 Swap elements in array if the next is bigger then current »
I want change order in arr if the next element is bigger than current. Hot to modify the code, so it will be work? arr = [5, 22, 29, 39, 19, 51, 78,...
(3) odpowiedzi
2017-04-22 08:04 Javascript performance: reduce() vs for-loop »
I was attempting this Codewars challenge and the problem involves finding the divisors of a number and then calculating the sum of these divisors squa...
(3) odpowiedzi
2017-04-21 16:04 Sorting a complex ruby hash works fine, but it's impossible to reverse, what can I do? »
I have a hash in ruby with a complex structure, like this: something = {} something[1488343493] = { :type => 'tag', :name => 'v1.2', :sha =>...
(4) odpowiedzi
2017-04-21 12:04 Obtain a string from the compressed data and vice versa in java »
I want to compress a string(an XML Document) in Java and store it in Cassandra db as varchar. I should be able to decompress it while reading from db....
(2) odpowiedzi
2017-04-21 12:04 Swift Array extension with generic items »
I am using Swift 3.1 and have some generic struct: struct Section<InfoT: Equatable, ItemsT: Equatable> { let info: InfoT? let items: [I...
(2) odpowiedzi
2017-04-21 10:04 Why does Array elements have to be of the same type »
Array DS requires all its members to have the same time. Java throws ArrayStoreException when an attempt has been made to store the wrong type of obje...
(3) odpowiedzi
2017-04-20 08:04 how can I use includes() function on nested arrays? »
I have an array like this: var arr = []; arr = [['red', 685], ['green', 210], ['blue', 65]]; Also I have two variables: var color = 'blue'; var n...
(3) odpowiedzi
2017-04-20 08:04 Filtering an array by using another array »
Array1 = [ name1, name2]; Array2 = [ { name: name1 , id: 1, location: xyz, address: 123 }, { name: name2 , id: 2, location: abc, address: 4...
(3) odpowiedzi
2017-04-19 14:04 Better way to define an array for timeline which can be more generic »
I have one array of string how can I define it better than current? It is working for me but kind of looks weird. var arrTimelineEntry = ["12 am", "1...
(2) odpowiedzi
2017-04-19 09:04 How to fetch data based on multiple key pair in Postgresql + Rails4 »
I have a table XYZ which has few columns in which, I need to filter out resultset based on Two columns (col1, col2) requested params Request params l...
(1) odpowiedzi
2017-04-19 01:04 How to add data to returned ActiveRecord query records »
I'm doing a simple query to a database table to send off to an external service, but I need to add an element to each of the returned records before I...
(1) odpowiedzi
2017-04-18 20:04 C - Fastest way to sort a large 2D integer array »
I have a 2D array, where each row contains 6 integers that are already sorted in ascending order. Example: 1 2 3 4 5 6 6 8 9 10 13 15 1 4 5 ...
(1) odpowiedzi
2017-04-18 15:04 Using an array for functions in javascript »
I'm trying to create a program that uses an array of functions to cycle through the order of execution. I've included the program below, can somebody ...
(4) odpowiedzi
2017-04-18 14:04 why is java taking long time initializing two dimensional arrays starting with the first dimension having a big size number? »
I have noticed that initializing 2D array like this case 1 :- int ar [] [] = new int [10000001][10] ; taking more time than initializing it like...
(1) odpowiedzi
2017-04-18 09:04 Filter recursive array and only remove NULL value »
I want to remove all null or blank value but not false and 0 value from recursive array. function isNotNull($val) { if(is_array($val)) { ...
(4) odpowiedzi
2017-04-17 11:04 Sort an array in javascript based on another array »
I have an array of Mongoose ID's as follows: var ids =[ mongoose.Types.ObjectId('58c2871414cd3d209abf4fc1'), mongoose.Types.O...
(1) odpowiedzi
2017-04-17 08:04 How to finds the maximum sequence of characters at the end of this array that are the same as the beginning of the array »
I want to write a function that finds the maximum sequence of characters at the end of this array that are the same as the beginning of the array. Bu...
(2) odpowiedzi
2017-04-16 14:04 Find row indices of a small array in a bigger efficiency matlab »
I have an array of size 3072 x 2 and I want to find the row indices in 150000 x 2 array. For example if we have A = 2 3 7 1 ...
(2) odpowiedzi
2017-04-16 12:04 How can I change elements inside and array »
How can I get the "e" elements inside of "arr" to be replaced by change0? The arr array will be an input by the user and I need to change it there is...
(8) odpowiedzi
2017-04-16 01:04 How to map with different parameters - ruby »
I'm creating some tests and I would like to create an array of objects passing different parameters to the constructor, is there a smart way of doing ...
(3) odpowiedzi
2017-04-15 12:04 How to make a text file into a list of arrays (array-in-array) and remove spaces/newlines »
For example I have a txt file: 3 2 7 4 1 8 9 3 6 5 4 1 1 0 8 7 On every line there are 4 numbers and there are 4 lines. At end of lines there's \n ...
(3) odpowiedzi
2017-04-14 18:04 Java - Why declare an array as a type of Interface? »
This is from Professor Mark Weiss in his book Data Structures and Algorithm Analysis in Java public class BinaryHeap<AnyType extends Comparable&lt...
(1) odpowiedzi
2017-04-14 18:04 Find custom Object index in array »
I have an array of custom object called Service and in didSelectRow I populate my selected array of that object: func tableView(tableView: UITableVie...
(1) odpowiedzi
2017-04-14 15:04 Canvas onClick add to array »
I got this HTML5 canvas project I'm struggling with. Basically I'm trying to add a new particle on click. And the particles is pushed to the particles...
(0) odpowiedzi
2017-04-13 20:04 How to assign Array of values as keys to another array of values? »
What is the Best way to convert, { "columns":[ "name", "color" ], "values":[ [ "lion", "yellow" ],...
(3) odpowiedzi
2017-04-13 12:04 Angular Convert API JSON Response Object with Fields to Array »
Learning Angular and having been through the heroes tutorial I wanted to try a real world http request so I am hitting the MetOffice DataPoint API. A...
(2) odpowiedzi
2017-04-12 23:04 Concat object to array if object does not exits »
mycolumn is a jsonb type with a default value of an empty array. I would like to update this array if the new value is not already present. select q...
(3) odpowiedzi
2017-04-12 09:04 Best way to replace nils from array with elements of another array »
I have two arrays: a = [nil, 1, nil] b = [4, 5, 6] And i want to replace nil elements from first array with related elements from second array: [4...
(5) odpowiedzi
2017-04-12 08:04 How to remove duplicate key value array in multidimensional array »
I have this array I want to remove array if it value are same from others $appointments = array( array('1','Monday', '5:30 PM'...
(4) odpowiedzi
2017-04-11 09:04 Two arrays to one chunked »
I have a two arrays and need to get one from them. array_merge, array_map etc. Doesn't give right result. $array1 = [1,2,3,4,5]; $array2 = [a,b,c,d,e...
(2) odpowiedzi