Sorting integers into 3 equal (almost) groups

So I have this problem which I need to solve, I have a group of integers which I want to sort into 3 equal groups. The data which I need to sort is: 3169, 3063, 3061, 3054, 3018, 3013, 2979, 2943, 2833, 2824, 2794, 2759, 2722, 2701, 2602, 2594, 2...
more »

2017-12-02 20:12 (2) Answers

Homework Help - Reading code and counting integers

I need some assistance trying to grasp a concept that our teacher is trying to get across. This is a beginning VBA Access course and we have just coded our first simple project. Unfortunately, I am unsure if I am not grasping the concept because he's...
more »

2017-12-02 08:12 (1) Answers

What is 32-bit integer in Javascript?

I was doing some coding challenge and encountered something I am not too familiar with. I am more curious to learn what it is and why it is there. The prompt it pretty straightforward: Given a 32-bit signed integer, reverse digits of an integer. Ex...
more »

2017-12-01 20:12 (2) Answers

Convert RDD values in KVP to integers in PySpark

I am trying to convert the column[2] values in my RDD key-value pairs from strings to integers so that I am able to sum them up and calculate an average. I attempted to have column [2] automatically display as integers during the mapping phase but I...
more »

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

How do you change a specific element of a set?

In this code, I am trying to compare the value of a set that has been looped each time to a value passed (in this case a) in a parameter. What's interesting though is that it shows when I use a for each loop that each element is an integer. How do I ...
more »

2017-12-01 07:12 (3) Answers

How to add two columns in MATLAB?

I am trying to create a simple text file from a MATLAB script that is ordered in the following matter that illustrates a classroom's grade throughout the semester. There are 20 entries for the 20 students enrolled, with 5 homework entries, a midterm ...
more »

2017-12-01 05:12 (3) Answers

Extract int value and string from string

I would like to use string class, to extract some information from the string. Given the string: <12,Apple>,<20,Orange>,<49,iPhone> I would like to let 12, 20, 49 to a int array. that means a[0] = 12, a[1] = 20, a[2] = 49. And let Apple, O...
more »

2017-11-30 04:11 (1) Answers

Java - Adding up integers from a file

I'm having problems with adding integers that are in a file. The code works fine displaying the integers but as soon as I add "total += scanner.nextInt();" it skips every other integer (e.g if file contained - 10, 20, 30, 40, 50, it would only displa...
more »

2017-11-29 17:11 (2) Answers

Integer division in C with unsigned short

I feel like the bloodiest beginner - Why does the following not work: // declarations unsigned short currentAddr= 0x0000; unsigned short addr[20] = {1, 0}; // main addr[1] = (~currentAddr)/2+1; printf("addr[1] wert: %hu\n", addr[1]); // equals 1, ...
more »

2017-11-29 12:11 (4) Answers

convert a list of long to a list of int java 8

I have a method which takes a list of integer as parameter. I currently have a list of long and want to convert it to a list of integer so I wrote : List<Integer> student = .map(Integer::valueOf) .collect(Collecto...
more »

2017-11-29 02:11 (1) Answers

Remove line from JTextArea

I have a JTextArea that is filled with numbers with no duplicates. There is an add and remove button. I have programmed the add button, but I am struggling with programming the remove button. I know how to remove the number from the array, but I'm no...
more »

2017-11-29 02:11 (2) Answers

Converting an Integer to a Drawable

I have two Adapter classes and in the first one, i have an Array of Integers[] named mThumbIds which is initialized like this : // References to our images private Integer[] mThumbIds = { R.mipmap.beyondthe_ferocious_flash_majin_vegeta_i...
more »

2017-11-27 09:11 (1) Answers

Extend Int enum with comparison operators

Very often you have Int enums like this: enum Difficulty: Int { case Easy = 0 case Normal case Hard } Difficulty values have a certain meaning and we may want to introduce order for them. For example, somewhere we need to compare: let...
more »

2017-11-24 00:11 (0) Answers

Final Grade Calculator in java

This is a personal project, just trying to create a program to calculate my final grade and to the best of my knowledge I thought I did everything right, here is my entire program updated with working code: FinalGradeCalculator: import*; i...
more »

2017-11-21 20:11 (2) Answers

Why is my Integer.parseInt not working?

The assignment is to create an output that reads from a file and outputs the information that is stated in the program. It was working perfectly before I went back and added the patientNumber string and the first for loop that deals with patientNumbe...
more »

2017-11-21 19:11 (1) Answers