Questions tagged [toarray]

toarray, to convert from arraylist to array this method can be used. Being language specific for e.g. in Java its its available with ArrayList and in C# its used with List. Use this tag for toarray related questions.

toArray() Returns an array containing all of the elements in this list in the correct order.

Resource

147 questions
0
votes
4 answers

C# Deserialize a JSON File to Array

How can i Deserialize a JSON to Array in C#, i would like to create Images with JSON Attributes. My current JSON File looks like this... { "test":[ { "url":"150.png", "width":"300", "height":"300" }, { …
user11332792
  • 23
  • 1
  • 4
0
votes
3 answers

How to implement toArray() within a linked list?

I've created a sorted linked list class, and the only part I'm struggling with is implementing the toArray() method properly. public class SortedLinkedList> implements ListInterface { // container class private…
suicuned
  • 37
  • 5
0
votes
1 answer

Android Unchecked assignment

I am using location services in my app, and where I am setting the permissions, I have this warning: Unchecked assignment: 'java.util.ArrayList' to 'java.util.ArrayList Code: permissions.add(Manifest.permission.ACCESS_FINE_LOCATION); …
Darksymphony
  • 2,155
  • 30
  • 54
0
votes
2 answers

Datagridview to array missing one row

I have a DataGridView with a CheckBox first column. I use the following Linq to get all the checked rows. DataGridViewRow[] drs = dgvMain.Rows.Cast().Where(x =>(!Convert.IsDBNull(x.Cells[0].Value) &&…
PiggyChu001
  • 440
  • 6
  • 20
0
votes
2 answers

rxjs - observable emits nothing (not completing?)

I have an angular 6 app and I originally set up my backend with a rest api, but i'm starting to convert parts to use socket.io. When I return the data from my rest api the following works: this.http.get(api_url + '/versions/entity/' +…
Michael B
  • 153
  • 4
  • 15
0
votes
1 answer

mongodb nodejs find toarray not showing nested object results

so i have a simple mongodb query which successfully populates results but it does not show results of the arrays of the documents. The Results are shown below and as you can see it is showing [Objects]. Please help. MongoClient.connect(atlas, {…
greyfish
  • 23
  • 4
0
votes
1 answer

[Ljava.lang.Object; cannot be cast to [Ljava.lang.String;

The following code (run in netbeans) always gives me a ClassCastException in the last line: private void GetModules() throws SQLException { stm = conn.prepareStatement("SELECT * FROM module"); Rs = stm.executeQuery(); Lliste.clear(); …
0
votes
2 answers

Passing an array that contains data to toArray method of List

I have some code like this : String[] colors = {"black", "blue", "yellow", "red", "pink", "green", "cyan"}; String[] alphabets = {"A", "B", "C", "D", "E", "F", "G", "H", "I"}; LinkedList links = new…
Amin
  • 138
  • 7
0
votes
2 answers

Observable switchMap filter toArray

I'm trying to filter episodes with switchMap & filter : this.getEpisodesForStoryEvents() .switchMap(episodes => Observable.from(episodes)) .filter((episode: Episode) => { return episode.ref.startsWith('SE/8'); }) .toArray() …
Menencia
  • 1,289
  • 1
  • 12
  • 23
0
votes
1 answer

C# - List.ToArray() taking several ms for a single element

I have the following code and for some reason the ToArray() method takes 7ms for a single element. The application has several worker threads in which this happens and I have also profiled the application with JetBrains dotTrace which shows that the…
0
votes
0 answers

toArray doesn't copy when destination array is of smaller size

I was working with an implementation of the toArray() in ArrayList and came across a scenario which looks like it's an issue (after checking the behaviour from the apidocs). When we copy an arraylist to an array of smaller size, and then print out…
0
votes
1 answer

java.lang.OutOfMemoryError: Java heap space on stream.mapToInt()/ArrayLists

ArrayList digitList = new ArrayList(); ArrayList newBase = new ArrayList(); public void toX(int base, int oNum) { while(base > 0) { digitList.add(base % 10); base /= 10; } int[] digits…
0
votes
1 answer

Fatal error: Call to undefined method MongoCursor::toArray()

I want to convert a cursor to array so i see cursor result, for this when i used toArray of mongodb then this error shown "Fatal error: Call to undefined method MongoCursor::toArray()" Here is my code: $getting_started_collection =…
Muhammad Arif
  • 1,014
  • 3
  • 22
  • 56
0
votes
1 answer

angular.filter groupBy and toArray and fuzzy

I'm utilizing the following library in AngularJS... angular.filter and I'm trying to ng-repeat on the following structure. When I combine all three directives... groupBy, toArray: true, and fuzzy: search I get the following screen shot... If I use…
redeemefy
  • 4,521
  • 6
  • 36
  • 51
0
votes
3 answers

finding the prime numbers of an arraylist with toArray, prints wrong

I have a method for finding the prime number from a list of numbers using ArrayList and toArray. The majority of the code works, except for the fact that when I'm printing the parameters 1 and 10, it prints 1,2,3,5,7. So it prints the prime numbers…
jaja fine
  • 15
  • 3