C# save time for later checks on a list

as always i need your help! Inside a foreach of a string array (containing cryptocurrency ticker names like "XRP", "SC", "XMR" and so on) i have a statement where i need to test if the value of a decimal is above 100. If this is true then i need to ...
more »

2017-09-18 01:09 (1) Answers

Storing string in arrays in ruby

I am attempting to write a method that changes one string to another one letter at a time. However, I never noticed in ruby that if you push a string variable to an array it seems to push the address of the string variable and not the string. def mu...
more »

2017-09-17 21:09 (2) Answers

Codility: longest set within array

I took a test for a company recently in Codility which really puzzeled me, I would like to hear your ideas about it, the statement is the following: A zero- indexed array A consisting of N different integers is given. The array contains all integers...
more »

2017-09-17 19:09 (1) Answers

C# actionresult filter using array or list

I feel like I am either close or way way off. Stumbling though MVC5 C# webapp, have read some great help given however I just can't seem to find the exact syntax that gets me a result. In my controller I am trying to filter my results based on a co...
more »

2017-09-17 12:09 (1) Answers

Ruby: iterate and nest hashes on condition

I have two arrays of hashes like this: h1=[{id:1, item:1, from: DateTime.new(2017,9,4,6,0,0,'+0300'), to: DateTime.new(2017,9,4,17,59,59,'+0300'), value:10}, {id:1, item:2, from: DateTime.new(2017,9,4,18,0,0,'+0300'), to: DateTime.new(2017,9,4,2...
more »

2017-09-17 06:09 (1) Answers

return matrix on C

Here is my code below. #include <stdio.h> #define _USE_MATH_DEFINES #include <math.h> void rot(int angle); static double R[3][3]={0}; int main(void) { int angle = 30; rot(angle); int i, j = 0; for (i = 0; i < 3;i++) ...
more »

2017-09-16 08:09 (2) Answers

Grouping objects inside nested javascript arrays

I have the following array, which has an object holding nested arrays that in turn have objects of their own: var list = [{ one: [{key: 1, value: 'eng1'}, {key: 2, value: 'eng2'}], two: [{key: 1, value: 'esp1'}, {key: 2, value: 'esp2'}] }]; ...
more »

2017-09-16 02:09 (2) Answers

Generating a LOT of unique tokens in Ruby

I needed to generate a lot of unique codes, for two lists of codes, that cannot match with each other and be unique codes. It has to be seven characters in length. BUT I'm not satisfied with my final solution, that I had to let run all night. I wo...
more »

2017-09-15 09:09 (2) Answers

Find wrapped array entry that is not empty

I´m new with spark. My problem is that I have to find in a list, these which are not empty. When I use the filter function is not null, than I get also every row. My program code looks like that: ... val csc=new CassandraSQLContext(sc) val rdd...
more »

2017-09-15 08:09 (2) Answers