Category "arrays"

Show rotation of tweets using current day of month

I'm trying to create something that will check the date and produce a different variable result depending on the date today. This is my current code: <?php

Accessing values inside Objects

I am trying to print a 2d array of a schedule that is inputted to me via object. When it prints, it is not giving me the values I want. Any idea what i doing wr

Calculating Median of an array in PHP

I'm trying to figure out how to calculate the median of an array of randomly generated numbers. I have the array all set up, but I'm having trouble putting toge

How to group array or column based data by a specific item's/column's value while summing-up the values of another?

We are building an integration in a SAAS product which exports data from a table and writes it to a CSV file. Tool allows JavaScript (Which i am not very famili

Nested if statements vs &&(or) operator

I've been trying to solve this https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/profile-lookup/ with the following code

Multiply each value in array using array_map function

I'm trying to multiply each value from array_module_rate array. The result should be: $array_module_rate[0] = 25 $array_module_rate[1] = 15 $array_module_rate

Sum column values from multiple arrays

I have an arrays with dynamic name. My array could be more than 3, depends and array variable should be unique $loopThrice = 3; $getSum = 0; $total = array();

Sort HTML elements by data-attribute [duplicate]

I have the following markup: <ul> <li class="category-item" data-category-group="jeans">Bottoms</li> <li class="cate

How to declare string array[] of unknown size (JAVA)

I want my String[] array; to be static but I still don't know it's size. Is there any way to declare string array of unknown size? As much as possible I don't

Json_Encode not returning html even i try to encode JSON_HEX_QUOT | JSON_HEX_TAG

I want to return HTML from PHP. I found a solution from StackOverflow which is insert JSON_HEX_QUOT | JSON_HEX_TAG after array in json_encode but it does not wo

How to get max values for each unique value in a different column in Google Sheets?

I have two columns, the first column (A) has names and the second column (B) has values. A B apple 10 orange 12 orange 14 apple 8 Is there a way to get only r

How to append a tuple to a numpy array without it being preformed element-wise?

If I try x = np.append(x, (2,3)) the tuple (2,3) does not get appended to the end of the array, rather 2 and 3 get appended individually, even if I originall

Distribute array row data to make multiple new rows

I have below the data [ { "price_in_dollar": 1000, "price_in_euro": 1000, "price_in_pound": 1000, "price_in_rupee": 1000,

javascript merge sort and recursion

I am trying to understand how JavaScript merge sort function work. And I struggle understanding how the recursive function work. This is the code: const mergeSo

Swift Array extension for standard deviation

I am frequently needing to calculate mean and standard deviation for numeric arrays. So I've written a small protocol and extensions for numeric types that seem

How to parse a string to array in js

I have an a string like the following, var x = "[{"k":"1"}]"; console.log(x[0].K); I ant hange this string sine I am getting from the server.Its out of my co

Resizing an array by a non-constant, continually

I’d like to perform amortized analysis of a dynamic array: When we perform a sequence of n insertions, whenever an array of size k fills up, we reallocate

Creating an Array from a Range in VBA

I'm having a seemingly basic problem but can't find any resources addressing it. Simply put, I just want to load the contents of a Range of cells (all one colu

Find the Max value of an Array column and find associated value in another Array with in the dataframe

I have a csv file with below data. Id Subject Marks 1 M,P,C 10,8,6 2 M,P,C 5,7,9 3 M,P,C 6,7,4 I Need to find out Max value in the Marks column for each Id an

check that a word is an isogram with pure javascript

How do i check that a given word is an isogram with pure javascript, using a function. the function must return true or false. An isogram is a word with a repe