Posts by Marciano Machado • 2,154 points
91 posts
-
2
votes2
answers235
viewsA: Chess board css
I did a validation and class marking for odd lines and pairs: casas = 4 for (i = 0; i < casas; i++) { for (j = 0; j < casas; j++) { if(i%2==0){ tabuleiro.innerHTML += "<div…
cssanswered Marciano Machado 2,154 -
1
votes3
answers1491
viewsA: ORDER BY ASC and DESC at the same time
Run the query below where a column was created just for sorting that turns the value of the competence in sorting negative by reaching the desired result. SELECT mc.competencia, CASE WHEN…
-
0
votes2
answers65
viewsA: How to APPEND a automatically created component, not finding the element ID
Add $( document ).ready(function() in your code, because at the time of javascript execution the html document may not have been fully loaded yet, see documentation…
-
3
votes1
answer144
viewsA: How to reverse Rotate with javascript?
In the method gira, where it always increased 1, I changed so that when it is greater than 500 decrease 1. <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8">…
-
1
votes4
answers307
viewsA: Div hover change color in other elements
Do as below, remove the > because he says that the elements have to be first hierarchy children of the element that received Hover: .icone_verde { background:green; padding:25px 40px; color:#fff…
-
1
votes1
answer241
viewsA: Addclass and Removeclass do not perform as expected
Hi there, get $(document).ready(function(){ to wait for the code to be rendered to run html. and add the event $('#inputs_socios').on("change", function(){ so that when every time select is changed…
-
4
votes2
answers173
viewsA: sql record in tables and return the table name
See this querie using sub query select t.idMembro, t.nomeTabela from ( SELECT idMembro as idMembro, 'pastores' as nomeTabela FROM pastores union SELECT idLider as idMembro, 'redes' as nomeTabela…
-
3
votes2
answers49
viewsA: How to simplify this Consultation?
This consultation is already quite simple, another way of doing it is: SELECT * FROM membros WHERE idMembro NOT IN ( SELECT idMembro FROM pastores union SELECT idResponsavel FROM redes union SELECT…
-
2
votes1
answer24
viewsA: Trace under the page
One option is to take the url with Location and split (split) it by "/" and take the last part and compare with the fields: var url = window.location.href; var urlSplit = url.split("/"); var pagina…
-
1
votes3
answers24130
viewsA: HTML button go to link
You can redirect using window.Location in onclick confome below: function HabiDsabi() { if (document.getElementById('habi').checked == true) { document.getElementById('envia').disabled = "" } if…
-
0
votes1
answer94
viewsA: Remove class from a div with a specific ID
Concatene the class the id in the selector: $('.remove#6').remove(); Which means you should remove every element that has the "remove" class and the id "6"; Remembering that the id should be unique…
-
1
votes1
answer336
viewsA: Wildfly server is not running
In the error you are saying that you already have a program using this address/port "localhost/127.0.0.1:9990". Probably already have a wildifly startado, finish all wildifly processes and try…
java-eeanswered Marciano Machado 2,154 -
1
votes2
answers1678
viewsQ: Observable, when to use?
Why and when should I use the Observable, what are its advantages and disadvantages and its difference compared to Promisses?
-
3
votes2
answers320
viewsA: How you use the keyup in a specific input
In the selector use the class or id: $('input#senha').on('keyup', function() { or just $('#senha').on('keyup', function() {
-
1
votes1
answer254
viewsA: Capture the value of a table cell and save to a variable via jQuery
Since the element used in the selector is not an element of a form, you cannot take value with the . val(). Use jQuery('#teste').text() See in the code below: console.log(jQuery("#teste").text());…
-
0
votes4
answers177
viewsA: Count(*) returning null
having functions as a kind of Where for the group elements, in which case there is no record with count equal to 4 respecting the grouping. one way to do this would be by using sub-consumption:…
-
2
votes3
answers138
viewsA: How to store various information in JS properly?
It would be better to group everything into a JSON object. To delete you can use the javascript splice method; To make it easier, I’ve split into functions. See the example below. let filaDeEspera =…
javascriptanswered Marciano Machado 2,154 -
12
votes2
answers2907
viewsA: What is Jakarta EE?
JCP (Java Community Process - https://www.jcp.org/) - is an Oracle standardization group composed of more than 800 companies that define the technology. Remembering that Java is not only a language,…
-
1
votes1
answer307
viewsA: How to get an html element value via Javascript
You can use the function querySelector javascript, as below var a = document.querySelector(".pageNav-page>a"); var textoDeA = a.innerText; console.log(textoDeA); <li class="pageNav-page">…
-
0
votes2
answers36
viewsA: Display number of comments from a single user table
Select COUNT(ID) from usuario WHERE posted_by = 'joao'
phpanswered Marciano Machado 2,154 -
2
votes3
answers227
viewsA: What is the pattern represented by this class called?
DAO ( Data Access Object ) :It is a standard for data persistence that allows you to separate business rules from database access rules. In other words, this should contain all database manipulation…
-
0
votes1
answer260
viewsA: Validate fields in a form made with jQuery-Steps
In Validation the value is coming empty and not null, change to if(nota == null || nota ==''){ See in the code below: $(function(){ $("#form-total").steps({ headerTag: "h2", bodyTag: "section",…
-
0
votes1
answer31
viewsA: Compare id of two tables and insert value when id does not exist
Hello you can run the query below to know who was deleted: select * from tabela1 t1 where not exists(select * from tabela2 t2 where t2.id = t1.id ) And to update the status you can run only the…
-
1
votes1
answer87
viewsA: How to implement Junit deletion with Spring Boot?
The error is giving because it is not finding in the database a record with an id 4 for deletion. You have probably already run the test once and have deleted the record. A solution to this type of…
-
3
votes3
answers881
viewsA: How to calculate difference of dates that are a previous row with MYSQL?
In the query below it relates to the smallest ID that is larger than the current SELECT A.id, A.created_at, TIMESTAMPDIFF(SECOND,A.created_at,B.created_at) AS timedifference FROM…
-
1
votes1
answer49
viewsA: Data manipulation in the programming or database
What is right or wrong always depends a lot on viewpoints. What I recommend is that the data be stored in the database, and the entire business rule be made in code. 'Cause if you ever need to…
-
3
votes3
answers800
viewsA: Spring Data JPA does not recognize the SQL 'Limit' command?
Hello, spring, uses JPA, which in turn uses the JPQL language for queries, which is a language similar to SQL only that uses the object-relational approach. JPQL does not implement the limit…
-
1
votes2
answers163
viewsA: Loading Bar
Use the library Jqueryblockui, see below the implementation. $(document).ajaxStart($.blockUI({ message: ' Carregando... ' })).ajaxStop($.unblockUI); $.ajax({ url: "https://httpbin.org/get", success:…
-
0
votes1
answer41
viewsA: Excel - Insert values within text
You can use the formula CONCATENATE as below =CONCATENAR ("UPDATE public_ads SET ads_price = [";F12;"] WHERE ads_reference = [";H12;"];")
excelanswered Marciano Machado 2,154 -
0
votes1
answer77
viewsA: Insert data, convert Int to String
The conversion can be done as below: Integer.valueOf(Txt_Email.getText()) If the value is of primitive type Voce can do: Integer.valueOf(Txt_Email.getText()).intValue() In your case I’d be:…
javaanswered Marciano Machado 2,154 -
1
votes3
answers3153
viewsA: Alert in an html boot
Your button is right, you just need to change the oneclick to onclick. See the code below: function cadastro(){ alert('ok'); } <input type="submit" class="btn btn-primary" id="btn_cadastro"…
-
1
votes2
answers69
viewsA: String containing only numbers
See regex in the code below: var regex = /[0-9]/g; var valor1 = "12312312"; var valor2 = "asdfad"; if(regex.test(valor1)){ console.log("valor válido"); }else { console.log("valor inválido"); }…
-
1
votes3
answers48
viewsA: compare sql tables displaying different result
The query below returns all entries that do not exist record in the release table: SELECT cadastro.id FROM cadastro WHERE NOT EXISTS ( SELECT * FROM liberar where liberar.aluno = cadastro.id ) GROUP…
-
1
votes1
answer98
viewsA: Mount Query with JOINS
In JPQL it is only possible to do the Inner Join the way you are trying when the class is related (Ex. Fat Detro has an Efat type attribute). Alternatively you can do the querie as follows. SELECT f…
-
1
votes3
answers54
viewsA: Use of property Nth:Child()
Change the lines as below: .grade:nth-child(3n+1) { background-color: #009ADE; /*AZUL*/ } .grade:nth-child(3n+2) { background-color: #EC0080; /*ROSA*/ } .grade:nth-child(3n+3) { background-color:…
css3answered Marciano Machado 2,154 -
0
votes1
answer416
viewsA: Intersection between same table, auto relationship, mysql with INNER JOIN
See the querie below, it connects user 1’s friendships with user 2’s and only brings users back from intersections: select u.* from amizade a1, amizade a2 , usuario u where a1.idUsuario2 =…
-
1
votes2
answers6537
viewsA: Remove Oracle Special Characters
You can do using REGEX REGEXP_REPLACE ('"Teste"', '^("|'')|("|'')$', '') where it replaces single or double quotes at the beginning and/or end of its field.…
-
0
votes1
answer410
viewsA: How to make multiple HTTP requests inside a loop with JS
A solution I use are callback functions, which are only executed after the request is successful, see the code below as it would look. function get_id(nome, callback) { $.ajax({ /* sua configuracao…
-
1
votes3
answers635
viewsA: Add data from array
Use the reduce function as code below; Documentation https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce let dados = [ {"peso":"1", "valor":"4"},…
-
0
votes1
answer703
viewsA: Make Application Work on Local Network Only - Localhost
Instead of localhost:8070, use the ip of your application 192.168.0.142:8070 to access both the url and the services within your application. If your services are the same as your application I…
-
0
votes1
answer147
viewsA: validation of fields with javascript?
The function mascara_phone puts the mask to the phones according to the regex, validating phones and mobiles with or without ddd. This function is applied to the onkyup event. For the validation of…