Categories
Mastering Development

error while calling method in another class

i am new to Java. i have a method public class Lovefruits{ public byte[] Eeee(String apple, String Banana, Map<String, byte[]> grapes, boolean orange){ ///body/// } } when i call this method in another class as such public class Allfruits{ private String apple; private String banana; private Map<String,byte[]> grapes; private boolean orange; // constructor // fruits […]

Categories
Mastering Development

Pivot table for non numerical data frame pandas

I am trying to create a chart from a large data set the structure is as below : sample data frame : df = pd.DataFrame({‘climate’:[‘hot’,’hot’,’hot’,’cold’,’cold’],0:[‘none’,’apple’,’apple’,’orange’,’grape’],1:[‘orange’,’none’,’grape’,’apple’,’banana’],2:[‘grape’,’kiwi’,’tomato’,’none’,’tomato’]}) need to plot how many from each fruit exist in different climate ,I need two chart both hot and cold separately. Pivot table and aggregation are not possible because no […]

Categories
Mastering Development

Is there a way to move every other row in a column into a new column in R?

Challenge: I have a column in which there are several rows. For eg., the first row is “Fruit name” and second row is “Fruit Color” and it repeats for another fruit. I want to grab the every second row (Fruit color) and create a new column. In the original column only the fruit names remain. […]

Categories
Mastering Development

jquery arrays comparison with substrings and case insensitive

Folks I have a jquery function requirement that will compare two arrays. listA = [‘ APPLE’, ‘banana’, ‘orange’] listB = [ ‘BANANA ‘,’appl’] ok so in above example, I need function to return “true”. Basically what I need is a way to Strip each word in both arrays to get rid of leading and trailing […]

Categories
Mastering Development

filter array in array of objects

i have this array: [ { “title”: “fruit”, “categories”: [ “apple”, “banana” ] }, { “title”: “city”, “categories”: [ “Brazil”, “EUA”, “China” ] }, { “title”: “name”, “categories”: [ “Ana” ] } ] i want to filter this by any terms that the users type i already got this, works only for title, but i […]

Categories
Mastering Development

How can I Google sheet multiple string in one cell

Basically, I am trying to gather all column 2 to show as different strings on excel: COLUMN 1 | COLUMN 2 Column 3 | Column 4 www.example.com | apple www.example.com | apple, coconut www.abc.com | apple Return www.abc.com |apple, banana, coconut www.hello.com | apple www.hello.com | apple, banana www.example.com | apple www.hello.com | banana www.abc.com […]

Categories
Mastering Development

what’s wrong with this for loop? weird error [duplicate]

I was learning about for loops and whenever I do this loop String[] fruits = {“Apple”, “Banana”, “Orange”}; for (int k = fruits.length;k > 0; k–) { System.out.println(fruits[k]); } and I get this error Exception in thread “main” java.lang.ArrayIndexOutOfBoundsException: 3 at helloworld.HelloWorld.main(HelloWorld.java:439) Java Result: 1 BUILD SUCCESSFUL (total time: 10 seconds) and I don’t want […]

Categories
Mastering Development

How do I perform an ‘every’ query in mongoose

Say I have a database with the a field of a document containing the following new Test({fruits: [ ‘apple’, ‘orange’, ‘banana’]}) I want to query the fruits array by another array, making sure that the array passed into the query contains every item in the fruit database. In plain JavaScript I would do the following: […]

Categories
Mastering Development

Send variable data from Post to Get express

Lets say that result is an object of different documents from the database. How would I then transfer that data from the POST request into the Get request? var opions = { ghost, banana, pepper, pepperoni } result = await Load.find(options); res.redirect(‘/displayFoodsSearch’);

Categories
Mastering Development

How to sort values in customized order

Guys I have final String of values which I am matching with values from DB. After matching I want string to appear in particular order, how can I customize this sort process or is there any other ways to achieve this. For more info please look into code below. Appreciated for help. public static final […]