This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<>>> Xampp não inicia o MySQL 'Attempting to start MySQL service'. | |
Executar dois serviços MySQL ao mesmo tempo (com nome e porta diferentes): | |
Edite seu arquivo “my.ini” em c:\xampp\mysql\bin\ Altere todas as entradas de porta 3306 para 3308. | |
Edite seu “php.ini” em c:\xampp\php e substitua 3306 por 3308. | |
Crie a entrada de serviço no CMD do Windows: | |
sc.exe create "mysqlweb" binPath= "C:\xampp\mysql\bin\mysqld.exe --defaults-file=c:\xampp\mysql\bin\my.ini mysqlweb" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function teste(){ | |
console.log("teste"); | |
} | |
addEventListener("click", teste()); | |
***************************************************** | |
SOLUÇÃO: | |
addEventListener deve receber uma função (ou um EventListener) no segundo parâmetro. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function removeElementsWithDuplicatedIds(id) { | |
var ids = document.querySelectorAll('#' + id), // Get a collection of elements with same id | |
len = ids.length, | |
n; | |
if (len < 2) {return;} // Quit. No duplicated ids | |
for (n = 1; n < len; n++) { // Iterate through the collection | |
if (ids[n]) { // Check if the element exists | |
ids[n].parentElement.removeChild(ids[n]); // If the wanted id is found, remove the child |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Eliminar os exclusivos idem uma matriz | |
arr.filter((v,i,a)=>a.findIndex(t=>(t.id === v.id))===i) | |
// Eliminar por várias propriedades ( placee name) | |
arr.filter((v,i,a)=>a.findIndex(t=>(t.place === v.place && t.name===v.name))===i) | |
// Eliminar por todas as propriedades (isso será lento para matrizes grandes) | |
arr.filter((v,i,a)=>a.findIndex(t=>(JSON.stringify(t) === JSON.stringify(v)))===i) | |
// Manter a última ocorrência |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT c.conname AS constraint_name, | |
c.contype AS constraint_type, | |
sch.nspname AS "self_schema", | |
tbl.relname AS "self_table", | |
ARRAY_AGG(col.attname ORDER BY u.attposition) AS "self_columns", | |
f_sch.nspname AS "foreign_schema", | |
f_tbl.relname AS "foreign_table", | |
ARRAY_AGG(f_col.attname ORDER BY f_u.attposition) AS "foreign_columns", | |
pg_get_constraintdef(c.oid) AS definition | |
FROM pg_constraint c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Adicionar ao final do C:/eclipse/eclipse.ini: | |
--illegal-access=warn | |
--add-opens java.base/java.lang=ALL-UNNAMED |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@GetMapping(value = "/foo") | |
@ResponseBody | |
public ResponseEntity<List<YourEnum>> listYourEnum() { | |
return new ResponseEntity<List<YourEnum>>(Arrays.asList(YourEnum.values()), HttpStatus.OK); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
items => { | |
items.sort((a, b) => a.id < b.id ? -1 : a.id === b.id ? 0 : 1); | |
// If you need your sort to work with accented characters use: | |
a.nome.localeCompare(b.nome) | |
// instead of | |
a.nome < b.nome ? // ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// for each 1 | |
for(Mensagem mensagem : mensagens){ | |
System.out.println(mensagem); | |
} | |
// for each 2 - Utilizando função | |
mensagens.forEach(mensagem -> { | |
System.out.println(mensagem); | |
}); | |
// for each 3 | |
mensagens.forEach(System.out::println); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input type="text" class="form-control" th:value="${#dates.format(#dates.createNow() , 'yyyy/MMM/dd_HH-mm-ss')}"> |
NewerOlder