Posts by MauroAlmeida • 836 points
37 posts
-
5
votes2
answers401
viewsA: How to disable emoji rendering inside an HTML tag
I made here a mini example how to remove emojis using regex. To test you can enter the emojis and click the button Clique para retirar emojis and you will see that in the second text box emojis do…
-
0
votes4
answers712
viewsA: How to access only the first position of each row in an array of arrays (matrix / multidimensional array) using foreach?
To access the first array uses multiArray[0], the second uses multiArray[1] and thus using indexing as if it were a array of only one dimension. To access the first index within each sub array uses…
-
1
votes1
answer128
viewsA: Apply to everyone with checkbox
See if this helps to reach a solution: $('#aplicaTodos').on('click', function(){ var values = carregaDadosDia('dia1'); atribuiDadosDias(['dia2', 'dia3'], values.checkedValues, values.textValues); })…
-
0
votes1
answer12
viewsA: Angularjs conferring variable on a conditional can give problem without specifying?
I will follow your example: var num = undefined; // resultado será 3 var num = null; // resultado será 3 var num = 1; // resultado será 2 var num = 0; // resultado será 3 if (num) { resultado = 2; }…
angularjsanswered MauroAlmeida 836 -
0
votes1
answer42
viewsA: How to get the amount of multiple properties on a list?
By the statement I gave an example to show the answer and be clearer. Existing class: public class RelatorioDisciplinasDto{ public int CodigoNivelEnsino { get; set; } public string NivelEnsino {…
-
1
votes2
answers71
viewsA: Swap the image with one click on multiple records
What I did was create two arrays with the following functionalities: A array checked which maintains the state of checked or unchecked using a boolean value. This value will allow you to place the…
-
0
votes1
answer149
viewsA: How to insert xml tag within a sql server table
You can do it like this: DROP TABLE ##yourTable CREATE TABLE ##yourTable (XMLCol XMl); Insert into ##yourTable VALUES( N'<datetime2>2019-05-06T17:53:27</datetime2>…
-
1
votes1
answer221
viewsA: Parse de Json in C#
An example of a structure in C# to use the information in that file format Json, performed this example using this website public class Guild { public string name { get; set; } public string rank {…
-
0
votes2
answers55
viewsA: Method returning Nullpointerexception (JAVA)
Your problem, as I described in comment is in the non instantiation of the field motoristaAtual and later attempt to assign a name to that driver, but as this driver is not instantiated it has the…
-
0
votes1
answer82
viewsA: Completablefuture - How to use?
CompletableFuture<Stream<String>> getMostPopularTeamNames(int maxResults){ CompletableFuture<Stream<String>> mostPopularTeamNames;…
-
-1
votes2
answers115
viewsA: Insert an option in select in a particular Window
How to insert an option into a Select widget: // referência para elemento select var sel = document.getElementById('selectChannelCam'); // criar um elemento opção var opt =…
-
3
votes3
answers231
viewsA: How to crop a String and convert to int in Java?
Here is an example of what the user places. In this example the field year allows to put years since the year 0. import java.util.Scanner; class Main { public static void main(String[] args) {…
-
0
votes1
answer333
viewsA: Calculate subtotal and total with javascript
Thus? var atualizaCarrinho = function(){ var carrinhos = $('.carrinho'); carrinhos.each(function(){ var carrinhoAtual = $(this); var valorItem = carrinhoAtual.find('.item-total:visible'); var…
-
4
votes2
answers283
viewsA: Count numbers drawn on a lottery table
This answer ignores the fact that the value 20 cannot be repeated since it is one of the business rules this value cannot be repeated in several columns of the same draw. SET @valor = 20; select…
-
0
votes1
answer458
viewsA: Java field with numbers only
See if this is what you want : String input; int crm; do { input = JOptionPane.showInputDialog("Digite o CRM do Médico: "); if (input.matches("^[0-9]+$")) { crm = Integer.parseInt(input);…
-
0
votes1
answer480
viewsA: How to read and save an object to a java file
Your error has to do with the way you wrote objects to the file. There can be no append of objects in a stream opened after the first stream for the stream will be corrupt. Is writing Client and…
-
1
votes3
answers97
viewsA: Search By Entity with EF
Without your whole data model and possible business rules, I think this is for the total expenses of a given Rubric: public double DespesaTotalPorRubrica(int idRubrica){ var total = db.Despesas…
-
0
votes1
answer46
viewsA: Type and search in Combobox
Thinking his database might change after the first population, the best way to do what you want is whenever someone enters some character in your combobox will be made a request to the server and…
-
1
votes1
answer29
viewsA: How to iterate a url in Javascript
I don’t quite understand your purpose. Example: var indexes = [1, 2, 3, 4]; function myFunction() { x = document.getElementById("images") x.innerHTML = indexes.map((currentValue, index) => { var…
-
3
votes1
answer325
viewsA: How to switch between tabs inside a modal bootstrap?
I don’t know what version of Bootstrap is using, in the example the version is the 4.3.1 It has two tabs, one of Upload and another of Browse. <!doctype html> <html lang="en">…
-
1
votes2
answers124
viewsA: Junction of 2 Linq Queries
From what you described I think that’s it: var teste = (from q in db.Questoes join op in db.Opcoes on q.Id equals op.QuestoesId orderby rnd.Next() select q) .Take(2)…
-
1
votes1
answer2081
viewsA: Error instantiating System class.Nullreferenceexception: Undefined object reference for an instance of an object
Debug and see which instance should be instantiated and is not. If you are making this exception then it is because you are trying to use an object that is not instantiated. For example String s =…
c#answered MauroAlmeida 836 -
2
votes1
answer330
viewsA: Is it possible to delete a repository on Github using Git codes?
Yes, it is possible. First you have to delete your commits locally: This command deletes the last commit git reset --hard HEAD~1 Then run this command to apply the changes to the remote repository:…
-
1
votes3
answers455
viewsA: What is Google One Tap?
The Google as well as other identity providers (Facebook, Microsoft, etc.. ), allow other applications to use their registration as user identity, this way the information used by the application…
-
-1
votes1
answer73
viewsA: How to create parallelism in a specific multithreading?
In the run method of the Facet class failed to break the switch case. switch(this.name) { case "faucetA": System.out.println("TORNEIRA DE ENCHER ABERTA.. ENCHENDO O TANQUE!"); break; case "faucetB":…
-
1
votes1
answer150
viewsA: Create a multidimensional array in Java table format?
Initializing the multidimensional array: int[][] a = { {1, 2, 3}, {4, 5, 6, 9}, {7}, };…
-
0
votes2
answers59
viewsA: Table Receives 2 foreign keys - Relational Model
The best thing you have to do is create a table that is the parent table of residente and of funcionário, then the table Qr-code just has a relationship with this parent table. You need to see if…
-
0
votes2
answers68
viewsA: Foreign Key (foreign key) referencing utility in the database
Rodrigo, foreign keys are useful to prevent actions that destroy the links between tables and also prevent invalid data from being inserted in a foreign key, because the value entered has to be an…
-
-1
votes3
answers182
viewsA: Factor function passed with reference
Implementation of factorial in C: int factorial(int n) { if (n >= 1) return n*factorial(n-1); else return 1; } The error you have is because you are passing an int parameter and you need to pass…
-
3
votes1
answer59
viewsA: Doubt about how to put two different things in the same view
Example source Customerdisplayviewmodel.Cs using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Web.Mvc; namespace BlipDrop.ViewModels { public class…
c#answered MauroAlmeida 836 -
2
votes2
answers41
viewsA: How to position DIV in text
Here’s an example using your code. <html> <head> <style> div { display: inline-block; width: 10px; height: 10px; border: 1px solid black; padding: 2px; margin: 10px; }…
-
1
votes2
answers39
viewsA: The addeventlistener event is not listened to
Run and see that the event is being called correctly. The difference between my code and yours is that I have not entered the initial script tags. window.addEventListener('DOMContentLoaded', ()…
javascriptanswered MauroAlmeida 836 -
1
votes2
answers837
viewsA: Changing the class of a button with Javascript
First you have an error because you are declaring the variable value and it is already passed as argument of Function, I do not understand what you wanted in this case. Second, I ran your code and…
javascriptanswered MauroAlmeida 836 -
0
votes3
answers1015
viewsA: The sum of all non-prime odd numbers that precede an integer?
Something like this: num = 10; soma = 0; for(int i = 2; i < num; i++){ if(!isEven(i) && !isPrime(i)){ soma += soma; } } List of some prime numbers: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31,…
canswered MauroAlmeida 836 -
0
votes1
answer33
viewsA: Structuring a database
Yes, it is possible, it is not mandatory to have a primary key, but with the primary key you can identify which specific row of the table you want. Example: CREATE TABLE [dbo].People( ID int NOT…
sqlanswered MauroAlmeida 836 -
2
votes2
answers180
viewsA: Error while running program using "args"
The error is in the indexing of the array, if it has 5 1 0 4 9 32 4, the length is equal to 7. And gone is using the stopping condition i<=l, what will happen is numbers[7], as there is no number…
-
0
votes0
answers116
viewsQ: Having Stream<Stream> how can we get the Stream that contains more elements in the other Stream
I have 3 interfaces public interface IGhOrg { int getId(); String getLogin(); String getName(); String getLocation(); Stream<IGhRepo> getRepos(); } public interface IGhRepo { int getId(); int…