Posts by renanvm • 3,797 points
117 posts
-
1
votes2
answers725
viewsA: Graphic overlay on chartJS
Change the variable scope graficoTotalAlunosPorTurma to global, and before creating a new instance of Chart, delete the previous one if(this.graficoTotalAlunosPorTurma){…
-
0
votes4
answers2676
viewsA: Problem with Beans in spring : No Qualifying bean of type
Add the following annotation to the main class: @EnableJpaRepositories("br.gov.mpog.gestaoriscos.repositorio");
-
0
votes1
answer31
viewsA: How to add link along with alert
Cannot include a link in Alert, it accepts text only. An alternative would be the use of Jquery Dialog
-
1
votes3
answers293
viewsA: How to know if class instance inherits another class?
Do the following: typeof(B).IsSubclassOf(typeof(A)) See working on Coding Ground
-
10
votes4
answers1730
viewsA: How to maintain a project in 2 repositories?
Within your project’s local repository, add external repositories using the command git remote git remote add github https://github.com/usuario/repositorio git remote add bitbucket…
-
2
votes1
answer2219
viewsQ: AssertThat method and use of Matcher
To perform unit tests using the method assertThat in Junit, you need to pass an object Matcher as a parameter. public void assertThat(Object o, Matcher matcher){ ... } An example of using passing an…
-
1
votes2
answers417
viewsA: Jar does not perform
You need to add the main class in the file pom.xml. Browse the plugins tag and add the following: <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId>…
-
0
votes1
answer144
viewsA: Import js script and css file within a specific component
I believe css can be imported this way <style> @import './assets/styles/arquivo.css'; </style> The script can be like this <template> ... </template> <script> export…
-
23
votes4
answers1103
viewsQ: What is the Kubernetes?
By my understanding is a tool for managing containers in applications that demand variations in the production environment. From this, I raised the following questions regarding the use of the same…
-
2
votes4
answers2763
viewsA: Add array elements in Arraylist and print values
You can use the method addAll() of java.util.Collections. This method adds all elements in a specific collection. Example: Integer vetor[]={1,2,3,4,15}; ArrayList<Integer> myList = new…
-
1
votes4
answers300
viewsQ: Doubt about denial operator
Why is it not possible in Java to use the negation operator on an object like Javascript? Is this because Java is strongly typed or is there some other peculiarity? For in Javascript the negation…
-
0
votes1
answer66
viewsQ: Minimum date on Ionic Native Datepicker
I am using the Datepicker plugin to receive a date, I can get the date normally, the problem occurs when I use the property minDate, in my understanding, this would be a minimum date for selection,…
-
2
votes1
answer704
viewsA: Hiding Component in Angular 7
You need to work with communication between components. First you issue an event by app-header, after that, we will receive the value issued in the parent component (Appcomponent) and then send it…
-
1
votes2
answers41
viewsA: my textarea does not want to show content with you in my ngmodel
Try this way [ngModel]="produto?.descricao_b2w?.descricao" (ngModelChange)="produto.descricao_b2w.descricao = $event"
-
1
votes1
answer76
viewsA: Use Elvis Perator in conjunction with ngIf
The previous object may be null, try this way. <textarea *ngIf="produto.descricao_b2w !== null" rows="4" [(ngModel)]="produto.descricao_b2w.descricao" readonly type="text" name="descricaob2w"…
-
8
votes1
answer450
viewsQ: What is considered primitive in a programming language?
What is considered primitive in a programming language? Only the types or other language resources are also primitive?
-
2
votes1
answer395
viewsA: Pass data from one component to another in angular
At Angular we have the Injector which is responsible for creating the service and injecting it into the components. The whole service is a Singleton for the Injector. When you add the service in the…
-
1
votes1
answer124
viewsQ: Difference between using a Stream or Collection
I see that the use of stream Java 8 is recommended for large amount of data. If the data set is small, there is some gain from using only Collection?
-
6
votes1
answer138
viewsQ: Is it appropriate to use layers in an application using microservices?
Structuring a layered web application is used only in monolithic applications or also in microservices? Presentation layer Application layer Business Logic layer Data access layer…
-
0
votes2
answers689
viewsA: Send List + Parameter to Controller
Try changing the order of the Controller parameters @RequestMapping("/lista-receitas") @ResponseBody public String recebeLista(@RequestParam("nome") String nome, @RequestBody List<Receita>…
-
3
votes0
answers55
viewsQ: Access modifiers in Typescript
In an application that uses Typescript, what is the need to use access modifiers? Because at runtime modifiers do not make sense for Javascript.
-
3
votes1
answer304
viewsQ: Differences between Java and Scala
What are the main differences between Java and Scala? Both have these similarities: Both are object oriented Both compile to bytecode and run in the JVM They both have Amble (Java 8)…
-
3
votes1
answer556
viewsA: Change attribute of one component into another component at the angle
Create a service, add Subject and also a method to issue the value. alreadyClientChange: Subject<boolean> = new Subject<boolean>(); changeValue(){ this.alreadyClientChange.next(true); }…
-
13
votes3
answers871
viewsA: How to separate characters from a string to a Python list?
This way returns a list of characters in each position list(a) See working on Coding Ground
-
2
votes1
answer263
viewsQ: Typescript "private" access modifier
In most examples I find Typescript I see that the class attributes do not use the access modifier private. It is a matter of design or there is some difference in operation compared to Java? export…
-
-2
votes1
answer277
viewsQ: Ways to instantiate a Java String
What is the difference between these two ways of instantiating a Java String? String x = "y"; String x = new String("y");
-
2
votes1
answer187
viewsQ: Does Garbage Collector remove all objects or only those that have no reference?
In a Java application there are objects that are not being used, among these objects there are those that have no reference. Like the Garbage Collector deals with it? He removes all or only those…
-
0
votes3
answers3693
views -
1
votes4
answers278
viewsA: What is the Java command that returns the uppercase characters?
Simple example String nome = "Jorge Aragão Silva".toUpperCase(); String iniciais = ""; for (int i = 0; i < nome.length(); i++){ char caractere = nome.charAt(i); if(i == 0) iniciais+=caractere;…
-
0
votes2
answers3450
viewsA: Difference between Requestmapping and Postmapping
Both do the same job. The difference is that @PostMapping is part of a predefined group of compound annotations that internally use @RequestMapping. These annotations serve as shortcuts to simplify…
-
0
votes2
answers1604
viewsA: Redirect to html with Spring Boot
Make the following change to your endpoint @RequestMapping("/") public String index() { return "login"; }
-
1
votes2
answers795
viewsQ: Difference between Comparator and Comparable
In Java, what is the difference between these two interfaces, Comparator and Comparable? When to use one or the other?
-
4
votes3
answers61
viewsA: Doubt with Localstorage -
To save before closing the page window.onbeforeunload = function(count) { localStorage.setItem('count', count); } How to recover from localstorage var count = localStorage.getItem('count');…
-
8
votes1
answer725
viewsQ: Difference between Hashmap and Treemap
What are the main differences between HashMap and TreeMap? Regarding use, in which situations it is recommended to use each one?
-
0
votes2
answers588
views -
0
votes1
answer88
viewsA: Service in Jboss does not log and does not work properly
Add this to your web.xml <context-param> <param-name>resteasy.servlet.mapping.prefix</param-name> <param-value>/myapp</param-value> </context-param>…
-
2
votes2
answers186
viewsQ: Remove item from a collection
Why is it considered incorrect to remove an object from a collection in this way? And why the exception launch ConcurrentModificationException? for(String item: list) { list.remove(item); }…
-
0
votes1
answer325
viewsQ: Use Arraylist or Linkedlist
The interface List has several implementations, among them ArrayList and LinkedList. Usually I have been using only ArrayList, but would like to know in which scenarios it is recommended to use the…
-
2
votes1
answer200
viewsQ: Array to Arraylist conversion difference with "asList" and constructor
What is the difference between these two ways of converting a array? If there is any difference, the same impact on performance? List<String> list = Arrays.asList(meuArray);…
-
3
votes2
answers169
viewsQ: When to use Stringbuilder and Stringbuffer instead of concatenating with "+" operator in Java?
What are the benefits of concatenating a string using StringBuilder or StringBuffer instead of simply using the operator +?
-
3
votes2
answers4482
viewsA: What are refresh token, access tokens and Grant type?
Access tokens are credentials used to access protected resources. Refresh tokens are credentials used to get a new token access. Grant type is used when the client wants to receive access token…
-
4
votes5
answers1237
viewsA: What is the difference between substr and substring?
The second parameter of substring() is to terminate the string and not include in the case the specified position character. The second parameter of substr() specifies the maximum size to be…
-
2
votes1
answer384
viewsQ: What happens internally when running a Spring Boot application?
Recently I have been studying Spring Boot, I wanted to know what happens internally when an application is started, because every project has a main class that is always noted with…
-
3
votes2
answers653
viewsA: Add object in Localstorage [Object Object]
Try so, convert the object to a string JSON and then perform parse to retrieve it localStorage.setItem('userData', JSON.stringify(this.user)); userData = JSON.parse(localStorage.getItem('userData');…
-
-1
votes1
answer233
views -
0
votes1
answer127
viewsA: ng-change with dynamic object
Try it like this, change the Binding to[ngModel] and use the event (ngModelChange) <input type=text class="insert" id="input' + data.id + '" [ngModel]="input" (ngModelChange)="myFunction($event)"…
-
2
votes1
answer1879
viewsA: Angular 6 CLI command to create a Component in a specific folder
Try it like this ng g component minha-pasta/component --flat The flat parameter serves to generate the files without creating a new folder
-
1
votes2
answers104
viewsA: Sending Servlet attributes to more than one JSP?
If you added the attribute in the session, you can recover it as follows. Servlet request.getSession(false).getAttribute("Login") JSP <%= session.getAttribute("Login") %> Remembering that…
-
2
votes2
answers54
viewsA: Error creating directory with php even using file_exists
Try this mkdir($dir, 0777, true);
-
0
votes1
answer79
viewsA: What happens internally when we use request.getRequestDispatcher?
The entire process takes place internally without involving the client or browser. Visually we do not see the forwarded address, but an internal request occurs.