Multithreading - Raytracer

I've finished my raytracer now but im trying to learn threads to optimize the render time. To represent each pixels of my window im using a int8_t * (4 int8_t / pixel for R/G/B/A). Here is a sample of what im trying to do : Number of threads set : 4...
more »

2017-04-18 23:04 (1) Answers

C language copying arrays - error in code

I am trying to copy elements from two arrays into a third. I can't understand why it doesn't work. I made sure that the two arrays are filled properly, but for some reason, the actual copying doesn't work- when I print the elements of the arr3, I get...
more »

2017-04-18 16:04 (2) Answers

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 please suggest what i have done wrong.I have created a set of traffic lights on HTML and im trying t...
more »

2017-04-18 15:04 (4) Answers

multi-numpy array from dataframe

I have 5 Pandas DataFrames, its 5 classes of objects in 80,00 images and the coordinates of the objects. Basically, there is more than one class in each image class 1: image_id x y image_0 4835 106 image_0 2609 309 image_0 ...
more »

2017-04-18 05:04 (1) Answers

R searching for information within column

I have two tables. Which have the kind of formatting shown below. One of it is table A as such: students|Test Score A | 100 B | 81 C | 92 D | 88 Another table B I have looks like this: Class | Students 1 | {A,D}...
more »

2017-04-17 23:04 (5) Answers

How to group same values?

If the user makes a reservation, new data is generated as much as the bicycle types. The database grows vertically. When the reservation is made, it produces a unique key and it is constant for that moment. For example: new reservation was made. 'Ran...
more »

2017-04-17 13:04 (1) Answers

Unusual behaviour with scanf

I am trying to scan a string, it needs to have a max length of 10. struct Person{ char name[MAX]; float score; date_t dafe; }; //MAX = 11 I am using a menu and when the string entered is less than 10 characters it wor...
more »

2017-04-17 13:04 (1) Answers

PDO PHP Array issue

function chkQuestions($info) { $query = $this->handle->prepare("SELECT * FROM tbltest"); $query->execute(); $rows = $query->fetchAll(); $getPost = $query->rowCount(); foreach($rows as $row...
more »

2017-04-17 02:04 (1) Answers

placing an interval in an array of pointers

I tried emailing my Professor for help with this and he was not very helpful. given an interval of size 50 starting at x as [x,x+50] (x and x+50 are included), find where to place this interval so that it has the maximum number of elements pointed b...
more »

2017-04-17 02:04 (1) Answers

Most frequent element in an array (bash 3.2)

In a shell script using bash i would like to find the most frequent occurrence of a number within an array and store the result in variable $result. The array could have any number of values. If multiple results are returned then I would like to sele...
more »

2017-04-16 20:04 (3) Answers

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 no way to predict which element will be "e". var arr = [ "a", "b", "c", "d", "e", "f", "g", "h", "...
more »

2017-04-16 12:04 (7) Answers

Array Rotation with $_session for All user

When a file is accessed it will appear 1, as refreshes appear 2, and in refrest reappeared 3, and so on. I use $_SESSION but when it's applied rotation different array in each user/browser, I want when user A accessing the php file appear 1, and...
more »

2017-04-16 05:04 (2) Answers

How to sort array based on the numbers in string?

Given this array = [ "3ab1", "2a0", "1abc2" ] How do I sort it to [ "1abc2", "3ab1", "2a0" ] (descending order of the last number) and return [ 1,3,2 ]. (the first numbers of each term) When the last number and the next last number is not consecu...
more »

2017-04-16 02:04 (4) Answers

Sorting Test in Java -

During the last months I created in Java some classes implementing data structures, more specifically Lists, Binary Search Trees and Binary Heaps. I decided to make a stress test by creating an Integer array of n values between 0 and 10*n, then sort...
more »

2017-04-15 20:04 (1) Answers

using threads to sort chunks of an array in java

So I need to make my program to use threads to sort the chunks of an array using the specific sorting method (insertion/bubble/quick/selection) that the user chose. then after those threads are done, create other threads that will merge the chunks ba...
more »

2017-04-15 20:04 (1) Answers