Posts by Lucas Alcântara • 411 points
18 posts
-
8
votes2
answers213
viewsQ: Do I need to assign null to a variable after use?
There is a need to allocate null in the object after its use? In the example below just after using the list I have a method that takes a lot of time to run. I need to assign null to the list to…
-
0
votes1
answer477
viewsQ: How to adjust the Form according to the size of the Picturebox?
How do I resize my form according to the size of the Picturebox component? In this case, the images in the Boxes may have different sizes. So I would like my Form to fit the size of the Picturebox.…
-
1
votes1
answer1548
viewsQ: How do I Google a search with C#?
I need to search for any term in Google and get a list of the results of this search. I’m trying to do this using the Google Custom Search API but I’m not getting satisfactory results. For example,…
-
4
votes1
answer865
viewsQ: How to use natural language processing in Portuguese with C#?
I need to find names of people and organizations in the text. I found that I need to use natural language processing for this, but I was only able to implement it in English using Stanford NLP for .…
-
0
votes1
answer29
viewsA: How to update an array with Mongodb and Morphia?
After searching I managed to solve: @Override public void updateIngredient(Ingredient from, Ingredient to) throws Exception { UpdateOperations<Datasheet> ops; Query<Datasheet>…
-
0
votes1
answer29
viewsQ: How to update an array with Mongodb and Morphia?
I need to update a Ingredient in the ingredient list. So far I only know how to update the entire JSON. How do I update only one item of the array? { "_id" : ObjectId("573c721f75fe72149c4d9987"),…
-
0
votes1
answer53
viewsA: Variable gets another value even without assigning values to it
As discussed in the comments, the response of this post is found in another that is talking about passing by value and by reference.…
-
2
votes1
answer53
viewsQ: Variable gets another value even without assigning values to it
I call a Jframe passing as parameter my variable and there I assign it in another variable I declared in order to be able to do the necessary operations. But when I close the Jframe 2 my variable of…
-
0
votes2
answers515
viewsA: How to get duplicated records with mongoDB and Morphia?
I was able to solve the problem using Google’s GSON library. I just added the lib jar to use the methods. Follows the code: public List<Ingredient> listIngredients() throws Exception { // Para…
-
2
votes2
answers515
viewsQ: How to get duplicated records with mongoDB and Morphia?
How do I get mongoDB to return me a list of un-duplicated documents. In my case mongoDB returns a list of ingredients from all registered recipes, but I want these records without duplication…
-
0
votes1
answer108
viewsQ: Capture exceptions in swingworker execution
I’m using SwingWorker to execute a method that can throw exceptions. Even forcing, the exception is not captured by Try-catch. How can I solve this case? try { (new SwingWorker < Void, Void >…
-
3
votes3
answers5170
viewsQ: How do I leave a round image?
I need the image to be round as well as the contact images of Whatsapp. I have tried to do some forms, for example with the tag < Shape>, but I didn’t get the right result. How could I get…
-
1
votes1
answer87
viewsA: How to add a Progressbar to a Pageradapter?
I was able to solve it. In my class, Pageradapter, I did the following: @Override public Object instantiateItem(ViewGroup container, int position) { RelativeLayout relativeLayout = new…
-
1
votes1
answer87
viewsQ: How to add a Progressbar to a Pageradapter?
I have a Viewpager that uses a Pageradapter to make an image slide. In my class extending Pageradapter I have an Asynctask that loads images from the internet and plays in Imageview. How can I put a…
-
2
votes1
answer2244
viewsQ: How to check if there is a null attribute in the object?
I have a class Person and I want to check if there is any null attribute, any one because I can’t save a person null-attribute. I want to avoid a lot of if. Is there any way to do that? public void…
-
1
votes1
answer1165
viewsQ: How to make a simple image gallery for Android?
I need to create an image gallery where I swipe to move to the next image. I’ve been doing some research and I’ve found a lot of ways to do something similar to what I want, but I got very confused.…
-
2
votes1
answer464
viewsQ: Searching for documents with mongoDB
I am using mongoDB 3.2 with Java. You can save a mongoDB query to a list of objects in a class of mine? I want to save the query directly on a list of people. class Pessoa{ String nome; Date…
-
2
votes1
answer480
viewsQ: How to identify patterns in colors?
I have an image and loop through each pixel of it. I need to identify if the pixel color: - It is a light or dark color; - And the hue of it (for example if it is bluish or reddish, greenish,…