Posts by Bruno Brito • 2,850 points
46 posts
-
0
votes2
answers106
viewsQ: AWS lambda - cannot connect to RDS database, only locally
I am trying to connect to a RDS instance from a lambda. I made and tested the lambda locally, it worked perfectly. However, when I deploy to AWS the code is normally executed until the part where…
-
1
votes4
answers84
viewsQ: How to do a sequential for with nodejs version 8?
The nodejs version is: V8.10.0 I don’t know much about Ode. In this specific case I need the next iteration to be executed only after the previous iteration has been completed. Also, I need that…
-
1
votes2
answers152
viewsQ: Regex to match in citation title
I’m trying to capture all citation titles in scientific articles, my regex is like this: (([A-ZÁÀÃÂÉÈÊÍÌÎÙÛÓÒÇ]{3,10}, ([A-Za-záàããâéèêêíìîúùóòõç- . ]. ( ){0,1}){1,3})(et al.){0,1}([Oo]rg.…
-
1
votes1
answer170
viewsQ: Access in the view the last values entered in the database
I am trying to access the last "Books" inserted in the bank, and display in the view. This controller function returns the view with the recovered values from the database. public function index(){…
-
2
votes1
answer36
viewsQ: Improve banking of related entities?
I have in the database the tables User, Professional and Address. The foreign key of User is in Professional and foreign key of Professional is in Address. I need to register a professional, who is…
-
0
votes0
answers255
viewsQ: Java + postegre connection problem in Heroku
Trying to connect java to the Heroku database (postgre), I have checked the url several times and there are no errors. I am not using Hibernate. By pgadmin I can enter it into the database normally.…
-
0
votes0
answers212
viewsQ: Error deploying to Heroku
Trying to deploy to Heroku with Tomcat 7 and Hibernate and this error appears: [ERROR] Failed to execute org.apache.Maven.plugins:Maven-Compiler-plugin:3.1:Compile (default-Compile) on project…
-
1
votes1
answer1159
viewsQ: Draw lines in binary tree graphical representation
I’m trying to draw a binary tree using swing and awt in java. I can already show the knots of the tree but I’m not able to draw the lines of a parent knot to your children. I have the Node, Treegui,…
-
8
votes2
answers168
viewsQ: What makes an object eligible to be allocated in the stack?
Article link: http://www.vogella.com/tutorials/JavaPerformance/article.html#Escape%20Analysis "The Programming language(Java) does not Offer the possibility to Let the Programmer decides if an…
-
0
votes1
answer371
viewsQ: View videos in <video> tag using Angularjs
View: <div class="list card" ng-repeat="x in content.spells"> .... <video width="320" height="240" ng-src="{{(getIdVideo(content.id) | trusted )}}" controls> Seu navegador não suporta o…
-
1
votes1
answer1716
viewsQ: Error using php Curl ssl certificate
I’m trying to use Curl. The problem is that in some pages it works normally, in others I have as output the following error: SSL certificate problem: unable to get local issuer certificate Here is…
phpasked Bruno Brito 2,850 -
2
votes1
answer462
viewsA: Replace in Angularjs
One of the ways is by using a filter that converts HTML to text: app.filter('htmlToText', function(){ return function(html){ return angular.element('<div>').append(html || '').text(); }; });…
-
1
votes1
answer462
viewsQ: Replace in Angularjs
<br><br>This powerful creation - forged in the image of a gargoyle - the kept<br><br> safe on his journeys, allowing him perform their important work without fear of…
-
3
votes1
answer197
viewsQ: What is the difference between . data() and Jquery.data()?
I was reading the jquery documentation and did not understand very well what the main difference between two already that both serve to store data from an html tag.
-
3
votes1
answer907
viewsQ: How to list the name of the files that are in the directory?
The output of the following method is: C: Users Desktop User files filename.jpg How can I get just the filename.jpg in String format? I tried to use FileUtils but as a way out I got this: ����.…
-
4
votes5
answers5903
viewsQ: Capture filename in directory
The following method takes the name of the files of a given directory and displays them on the screen, the problem is that the .listfiles() returns the number of bytes and not the number of files,…
-
0
votes1
answer564
viewsQ: Save fields from one page to another
I have these two pages each with a form, I would like to be able to send in an email the information of the two forms. How do I save field values nome and numero and send only on page 2 along with…
-
3
votes1
answer120
viewsQ: Are methods and builders the same?
Some sources say that constructor is a special type of method, while others say constructors are not methods. Some say, too, that although they are different the JVM treats them the same way. After…
-
5
votes1
answer312
viewsQ: Capture image by url
I have the following url: http://ddragon.leagueoflegends.com/cdn/6.3.1/img/champion/{{name}}. png Replacing the word nome by a specific name and navigating to the page in question the site shows an…
-
3
votes2
answers139
viewsQ: Doubt Angularjs with array
How do I catch just the id and key? { "type": "champion", "version": "6.3.1", "data": { "1": { "id": 1, "key": "Annie", "name": "Annie", "title": "a Criança Sombria", "info": { "attack": 2,…
-
3
votes2
answers510
viewsQ: Why does the main method receive parameters?
public static void main(String[] args) What does this String array that is passed as a parameter mean? How these parameters can be useful to the developer?
javaasked Bruno Brito 2,850 -
5
votes3
answers5080
viewsQ: Clear C buffer with fflush() or __fpurge()
Studying strings in C I came across the following phrase: "Clearing the buffer, for example, is not always desirable, and for more professional and secure programming it is not recommended to use…
-
17
votes3
answers1862
viewsQ: Specification and Implementation
I usually see the words "specification" and "implementation", but I don’t know the difference between one and the other. For example: It is possible to have control over the garbage collector, this…
-
8
votes3
answers8112
viewsQ: Is there any way to pass methods as a parameter?
In Java, I can pass methods as parameters? Example: public class Teste { public String metodoA(){ //faz alguma coisa } public void metodoB(double numero){ //faz alguma coisa } public void…
-
3
votes2
answers3006
viewsA: How to capture the first letter of a String name and if the letter is 'C' save the name in an array?
Try to use the method charAt, this method returns the char of the String according to the specified index, in this case the index 0 which is the first letter of the name. public static void…
javaanswered Bruno Brito 2,850 -
1
votes2
answers100
viewsA: I am not managing to modify the value of the Book class that is a Book
If the value is not being added up try this: public double getTaxaImpressao(Livro livro){ return livro.getValor() + 5.0; } } Or public double getTaxaImpressao(Livro livro){ Double valor =…
-
1
votes2
answers243
viewsA: How can I associate 3 authors to just one book?
If I understood correctly you could make a constructror in the Book class that receives 3 arguments where each one would be an author. This is if you always want to associate 1 author or 3 authors…
-
17
votes3
answers959
viewsQ: Why does calling System.gc not guarantee running the Garbage Collector?
Why the developer does not have full control over the Garbage Collector? I understand that the role of GC is to automatically manage the memory but why even using some method like the System.gc…
-
5
votes1
answer80
viewsQ: View recursive calls in eclipse
Is there an eclipse tool that shows recursive calls like in this image? Where I can see the details of preference graphically?…
-
82
votes1
answer9485
viewsQ: How is a compiler made?
A compiler is programmed in what language? All compilers of a language are equal or one may exist better than another?
-
11
votes1
answer1648
viewsQ: Difference between method and constructor?
Reading a friend’s notes I came across the following statement: "method does not allocate space in memory". This statement is correct? It may not be the main difference between them, but it is…
-
2
votes1
answer796
viewsA: Validate jFormattedTextField with Mascara
else if(ftCPF.getText().trim().length() < 14) { JOptionPane.showMessageDialog(null, "Por favor, informar campo CPF", "Informação", JOptionPane.INFORMATION_MESSAGE); ftCPF.requestFocusInWindow();…
javaanswered Bruno Brito 2,850 -
0
votes1
answer38
viewsQ: Doubt about getSource() instanceof
Instanceof is a binary operator that tests whether an object is the subtype of a certain type. Ex: Object fonte = e.getSource(); if (fonte instanceof JButton){ ... } If getSource() returned…
-
3
votes2
answers993
viewsA: Operation of variables by reference
When you create an Animal object for example, with the command new Animal(); the object of this class is being created at this time, but to manipulate the information of the "Animal" you need a…
-
1
votes1
answer146
viewsA: Return Connection as Boolean?
Try this public class Conectardb { private static Connection con = null; public static boolean getConexao() { // Drive do PostGreSQL try { Class.forName("org.postgresql.Driver"); } catch…
-
2
votes2
answers119
viewsQ: How to get the type of component clicked?
The getSource() method returns the event source, there is some method that returns the event source type, whether it was a jlabel, or jbutton, something like?
-
1
votes1
answer917
viewsQ: Convert Bufferedimage to File?
I need to convert a BufferedImage for a File. I tried it this way, but it didn’t work: File file = null; ImageIO.write(image, "jpg", file); image is the type BufferedImage. That was the mistake:…
-
4
votes2
answers1419
viewsQ: Is there any way to know when a record was added to the bank?
I would like to know the time a record was added to the bank. I will use this information to show the time a contact was added to my schedule.
-
1
votes1
answer150
viewsQ: Question about updating Jlabel in Jframe
Why can’t I update my labelHora in the Frame? Using a print after the line labelHora.setText(x); I realized that the content of lip changes, but on the screen continues the pattern, which in the…
-
2
votes1
answer838
viewsQ: Shoot event by clicking on day in Jcalendar?
How do I place an event in each Jcalendar day? My intention is to click on a day and create a kind of reminder that is related to the day, in a way that when the user clicks on the day again he sees…
-
31
votes3
answers1472
viewsQ: How does an SQL Injection happen?
Why creating parameters for each field that will be updated helps prevent SQL Injection? Example: SqlCommand comm = new SqlCommand("UPDATE Contatos Set Telefone = @Telefone, " + "Cidade = @Cidade, "…
-
3
votes2
answers37
viewsQ: Doubt with sql command in c#
SqlCommand comm = new SqlCommand("UPDATE Contatos Set Telefone=" + " ' " + txtTelefone.Text + " ' " + ",Cidade=" + " ' " + txtCidade.Text + " ' " + ",Email=" + " ' " + txtEmail.Text + " ' " +…
-
2
votes1
answer1392
viewsQ: Get item value in focus on a Jlist?
I have a Jlist and would like to take the value of the item that is in focus on it, not want to capture this value with click or with some button, but rather just changing the focus(by clicking on…
-
11
votes4
answers2951
viewsQ: What ways to measure the performance of an algorithm?
If I have, for example, some sorting algorithms (Merge Sort, Quick Sort, Bubble Sort...) in which way(s) I can know the efficiency of each one?
-
1
votes1
answer152
viewsQ: Return method with throw
This method has the type of return Connection, however in the blocks catch there is no return conn and still there is no compilation or execution error. I believe it is by throws and throw but I…
-
3
votes1
answer2641
viewsQ: What makes it explode() better than split() in php?
I know the function split is obsolete and there is the function explode which replaces it, but what exactly causes the explode be better?
phpasked Bruno Brito 2,850