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
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.Scanner; | |
public class ControleEstoque { | |
private static Map<String, Integer> estoque = new HashMap<>(); | |
public static void main(String[] args) { | |
Scanner scanner = new Scanner(System.in); |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Atualizar Usuário</title> | |
</head> | |
<body> | |
<h1>Atualizar Usuário</h1> | |
<form action="/usuarios/atualizar/<%= usuario.id %>" method="POST"> |
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
public class ExemploThread { | |
private static int sharedVariable = 0; | |
public static void main(String[] args) { | |
MyThread t1 = new MyThread(); | |
MyThread t2 = new MyThread(); | |
t1.val = 1; | |
t2.val = 2; | |
t1.start(); | |
t2.start(); |
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
/* | |
Exemplo de código que mostra passagem de parâmetro em Java. | |
https://www.devmedia.com.br/entenda-que-os-parametros-sao-passados-por-valor-e-nao-por-referencia/5015 | |
*/ | |
class Exemplo02 { | |
int var1; | |
String nome; | |
public static void main(String args[]) { | |
Exemplo02 e = new Exemplo02(); | |
e.nome = "Maria"; |
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
package br.edu.ifal.pweb01; | |
import java.io.IOException; | |
import java.io.PrintWriter; | |
import java.util.Optional; | |
import java.util.concurrent.ConcurrentHashMap; | |
import java.util.concurrent.ConcurrentMap; | |
import jakarta.servlet.ServletException; | |
import jakarta.servlet.annotation.WebServlet; |
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
package br.ufal.edge; | |
import static com.microsoft.playwright.assertions.PlaywrightAssertions.assertThat; | |
import static org.junit.Assert.assertEquals; | |
import static org.junit.Assert.assertTrue; | |
import org.junit.After; | |
import org.junit.AfterClass; | |
import org.junit.Before; | |
import org.junit.BeforeClass; |
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
const list = [ | |
{ | |
id: 1, | |
titulo: 'Livro do desassossego', | |
autor: 'Fernando Pessoa', | |
isbn: 8535908498, | |
resumo: 'O narrador principal (mas não exclusivo) das centenas de fragmentos que compõem este livro é o "semi-heterônimo" Bernardo Soares. Ajudante de guarda-livros na cidade de Lisboa...', | |
ano_lancamento: 2006 | |
}, | |
{ |
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
class StackClass { | |
private int[] stackRef; | |
private int maxLen, topIndex; | |
public StackClass() { // Um construtor | |
stackRef = new int [100]; | |
maxLen = 99; | |
topIndex = -1; | |
} |
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
<!DOCTYPE html> | |
<html lang="en" > | |
<head> | |
<meta charset="UTF-8"> | |
<title>Manipulando o DOM</title> | |
<link rel="stylesheet" href="./style.css"> | |
</head> | |
<body> | |
<!-- fonte --> |
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
import json | |
def escreve(newData): | |
with open('person.json', 'r') as json_file: | |
oldData = json.load(json_file) | |
with open('person.json', 'w') as json_file: | |
oldData.append(newData) | |
jsoned_data = json.dumps(oldData, indent=True) | |
json_file.write(jsoned_data) |
NewerOlder