Posts by renanvm • 3,797 points
117 posts
-
4
votes1
answer388
viewsA: What is the difference between ngOnInit and Constructor
The problem I came across was this: I needed to validate one token when the page was started if the token was then validated would be visible a second Forms if not only the first Forms where would I…
-
7
votes1
answer202
viewsQ: What is a convention on configuration?
Currently I see that some frameworks, libraries and systems use the concept of convention on configuration, from which I raised the following questions What is a configuration convention? What are…
-
6
votes2
answers219
viewsA: Why do we use a "get" before declaring a function in Angular?
Why do we use a get before declaring a function in Angular or Javascript? We use to associate the property of an object to a function. The function is called when the property is accessed. That’s an…
-
14
votes1
answer466
viewsA: Why, at Angular, do we use interrogation?
The ? is a operator Angular protecting property against null and undefined values. In your case, without the use of the operator and the object listaxpto being null would be released an exception…
-
0
votes1
answer81
viewsA: Save Date to a mysql database using Java
Try it this way: pstm.setDate(2, new java.sql.Date(date.getTime()); The method gets a java.sql.Date as parameter and not java.util.Date…
-
3
votes2
answers253
viewsA: Abnormal behavior when taking data from a Formgroup with Angular
Remove the form control from the input, as we will get the value explicitly <form [formGroup]="dataForm" (ngSubmit)="ngSubmit()"> <div class="input-field"> <input id="my_data"…
-
4
votes2
answers113
viewsA: Generic types in Java method call
As said in reply previous, the term could be generic parameterization. The <I, O> in the signature means that the method can handle these two generic types, this is not the return. For…
-
1
votes1
answer79
viewsA: How to store data sent from an API into a variable in IONIC 4?
This is because you are performing an operation asynchronous. The code outside the subscribe is executed before, so the undefined on console output. A solution would be to create a method to…
-
1
votes1
answer89
viewsA: swap the text of a label with values of a java array
You can use the method append class StringBuilder to concatenate new characters, and then at the end set the complete string in the label. Example: StringBuilder senha = new StringBuilder(); //…
-
3
votes2
answers284
viewsA: How do I scan a Date type data?
Cannot read the object Date using Scanner. Only String, BigInteger, BigDecimal and primitive types. An alternative is to receive the date as String and convert for Date. Example: String data =…
-
2
votes2
answers72
viewsA: Using Database in Production Postgres - Not Accepted Using Table with Camelcase
Spring JPA by default uses underscore to split names into Camel case. Change the naming Strategy on application.properties spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.EJB3NamingStrategy…
-
2
votes2
answers171
viewsA: How to show values of an Array in a single message?
You can use the method deepToString of Arrays. This method transforms multidimensional arrays into strings. Example: String numeroConta = Arrays.deepToString(numero_conta);…
-
2
votes3
answers177
viewsA: Why does the this(6) command inside a constructor initialize the class array?
Because Lista l = new Lista() refers to the call of the manufacturer Lista(). Inside this builder, there’s the builder Lista(int i) that is being called as follows this(6) When the second…
-
1
votes2
answers146
viewsA: How to install Provider ?? Ionic 4
Unlike Ionic 3, Ionic 4 uses service and not Provider Here’s an example of how to create a service using Angular CLI ionic generate service user…
-
1
votes1
answer198
viewsA: Angular 8 - Difficulty recovering headers
Try to add the following header in the answer. By default it is not exposed. Access-Control-Expose-Headers: Authorization Example: @POST public Response login(@Context HttpHeaders headers) {…
-
1
votes1
answer56
viewsA: How to make a request that changes the values according to the return of the api
You can use the operator interval and define an issue period getWalletFinancialInformation() { return interval(5000).pipe( switchMap(() => this.http.get('minhaUrlSecreta')));…
-
0
votes1
answer144
viewsQ: Does Angular use the MVVM?
I have some doubts about the design of framework Angular The framework actually uses MVVM in full or only a few principles? Component is entirely a Viewmodel?…
-
1
votes1
answer60
viewsA: I’m a beginner in Angular, would anyone know how to solve a dependency problem . map of the following code?
Import the operator map import 'rxjs/add/operator/map' or import 'rxjs/Rx'; https://stackoverflow.com/a/37208814/5360385…
-
2
votes2
answers223
viewsA: Are parameters with vectors in Java always by reference?
When passing a vector as a parameter in a method I will be changing the vector itself or generating a copy? It will change the array itself. The method takes as parameter the address of the array in…
-
1
votes2
answers143
viewsA: Clone a list in Java
Try it this way LinkedList segundaLista = new LinkedList(); segundaLista = (LinkedList) listAcidentes.clone();
-
2
votes1
answer274
viewsQ: Align label to right of icon
I have the following list of ion-item with some ion-label misaligned <ion-list id="sidenav"> <ion-item> <ion-icon name="home" item-left></ion-icon>…
-
3
votes3
answers464
viewsA: Deleting files on Github after push
Do the following: Comment the file line on .gitignore Remove it from the local directory, copy to another folder Update the index -> git add Perform the commit Perform the push to the remote…
-
2
votes1
answer869
viewsA: How to get back to the start menu of my program
Add the break at the end of each case, except in the case 5. This command is used to interrupt the switch and pass the execution flow to first instruction after the switch, which in your case is…
-
2
votes1
answer199
viewsA: Convert a file path to String
Try it this way path = Paths.get(nomeArq).toAbsolutePath().toString();
-
1
votes1
answer43
viewsA: How to get information from a TCP server and send to the java client
You can use the ConcurretHashMap to store the list of connected clients ConcurrentHashMap<String, Socket> clientesAtivos = new ConcurrentHashMap<String, Socket>();…
-
1
votes2
answers104
viewsA: How to return an integer when accessing an end-point?
Probably your Accept request header asks for a JSON and your end-point is not returning this, so status 406. The string answer works because JSON is essentially a string. In the case of the integer,…
-
1
votes1
answer56
viewsA: First ion-tabs tab does not show data
After obtaining the data via API, pass them to the tab via publish() this.events.publish("paramsChart:changed", paramsChart); In the first tab, sign up, and wait for the event response…
-
0
votes1
answer56
viewsQ: First ion-tabs tab does not show data
I have the following template with two tabs <ion-tabs tabsPlacement="top" color="primary" #entradaSaidaTabs > <ion-tab [root]="tabReceber" [rootParams]="paramsChart"…
-
3
votes1
answer484
viewsA: Change source branch
Try it this way: Create a new branch from branch B, we’ll call him branch D Go back to the branch you have To as origin (Is the branch that you’ve worked on, we’ll call it C) is a reset specifying…
-
1
votes2
answers778
viewsA: Switch to next input automatically
Create a common class for inputs, capture the active input input, set a condition to go to the next input, after validating the condition, take the next input and call the Focus event.…
-
6
votes2
answers820
viewsQ: Difference between non-relational database models
When it comes to non-relational databases, we have some options, such as the Document database and Graph database. Regarding the two, what are the main differences and benefits of using each?…
-
4
votes3
answers1706
viewsA: Hibernate and JPA are the same thing?
JPA is just a specification, there is no implementation. Think of JPA as a set of guidelines that should be followed in the implementation. Hibernate is one of the implementations that follows these…
-
0
votes1
answer184
viewsA: multiples Thread client, server using socket
Install more than one in the main method public static void main(String args[]){ new CliThread(); // cliente 1 new CliThread(); // cliente 2 }
-
4
votes2
answers8696
viewsA: Error when pushing to Github
A possible solution would be to authenticate via http and not ssh. Example: On your repository page, do the following, select https and copy the url. After copying, update the url from the remote…
-
11
votes7
answers620
viewsA: How to access a circular array?
The following function returns the item subsequent to each call var arr = ["A", "B", "C"]; function getItem(arr) { arr.push(arr.shift()); return arr[arr.length - 1]; } console.log(getItem(arr));…
-
1
votes2
answers84
viewsA: JAVA + HIBERNATE
You can define some restrictions through the annotations of framework, one of them is the note @Transient that allows you to ignore the field mapping in the table.
-
15
votes1
answer605
viewsQ: Questions about analysis and structured and object-oriented design
Software process, involves various activities, among them, analysis and design. Among the options of methods to perform these activities, we have the structured and object-oriented. Regarding both,…
-
9
votes1
answer1662
viewsA: How do I commit a specific file in git?
First add the specified file of the second line in the staging area, in case it is the context.xml: git add proj/WebContent/META-INF/context.xml After adding it, run the commit git commit -m…
-
1
votes2
answers197
viewsA: Why window.innerheight/ window.innerWindow does not work with Document.getelementsbytagname('canvas');
When you use the querySelector, it returns the first corresponding element, so you can change the properties, in the first case, as mentioned in the other answer, it returns a list of elements, and…
-
1
votes2
answers71
viewsA: Alert when scroll reaches top of page
Try it like this: $('#messages').scroll(function() { if ($(this).scrollTop() == 0) { alert('a rolagem chegou ao inicio, fazer algo aqui.'); } });
-
12
votes1
answer2286
viewsA: What is the difference between "git push" and "git Sync"?
git push: Upload the contents from the local repository to the remote git sync: First executes a git pull that downloads the contents of the remote repository and updates the location, after which…
-
0
votes1
answer33
viewsA: Accessing resources with spring
Try this way: registry.addResourceHandler("/resources/**") .addResourceLocations("/resources/");
-
0
votes1
answer77
viewsA: Problem in configuring Datasource with Postgres!
Add this to the application.properties file spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true Reference…
-
1
votes1
answer40
viewsA: Difference in Declaration of a @Generatedvalue Class
Table is normally created without the annotation @GeneratedValue, but when entering a record, the value of the field that corresponds to the primary key must be manually assigned, because when you…
-
0
votes2
answers294
viewsA: Httpinterceptor null token (Angular 7)
Refresh the chunk that adds the token in the header Try Bearer ${tokenInfo} instead of Bearer ${tokenInfo.token}
-
4
votes2
answers422
viewsQ: Omit passing of parameter
I have the following method that contains the second declared parameter post(path:string, body: Object = {}){ ... } And here the call of the same with the omission of the second parameter…
typescriptasked renanvm 3,797 -
0
votes2
answers213
viewsA: Java JSP return of age
Import the Age class into your jsp file <%@ page import ="package.Idade" %> Substitute package by way of the package containing the Age class.…
-
4
votes3
answers209
viewsA: Can the "main()" method be overwritten or overwritten?
Yes, it can be overloaded, but only the original method is called by the JVM. As for the superscript, it cannot because it is static. References: Superscript and Overload…
-
2
votes2
answers2327
viewsA: In Ionic, the President is now Service?
In Ionic, at least in version 3, the Provider, but both are the same thing. That’s just a convention used in framework. So much Provider as Service use the same developer for dependency injection.…
-
18
votes2
answers1713
viewsQ: What is a scalable code?
Scalability is linked to growth, in the context of code, I have some pertinent doubts. What is a scalable code? The scalability of code involves more than one aspect or only performance or design? A…