This file contains hidden or 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 Cinema { | |
public static int contador = 0; | |
public static double lhama(double tarifa,int idade ,boolean deficiencia ,boolean estudante ,boolean homem){ | |
if (deficiencia == true ){ | |
tarifa = tarifa*0; | |
} | |
else{ |
This file contains hidden or 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.Scanner; | |
public class Loja{ | |
static double calca = 100.00, camisa = 99.99, blusa = 75.10, sapato = 125.00, bermuda = 85.90, bone = 50.00, camiseta = 73.20; | |
static int codigoProduto; | |
static int [] listaCompra = new int [100]; | |
static int posicao = 0; | |
public static void Lista () { | |
System.out.println("\n \t menu \n" ); | |
System.out.println("1. Calca = R$ " + calca ); |
This file contains hidden or 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 MatrizEsp{ | |
public static void main(String[] args){ | |
int A [][] = new int [25][25]; | |
int cont = 1; | |
int sup = 0; | |
int dir = 0; | |
int inf = 0; | |
int esq = 0; | |
int metade = A.length / 2; | |
for(int passadas = 0; passadas < metade; passadas++) { |
This file contains hidden or 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 Teste{ | |
public static void main (String args[]) { | |
int linhas = 30; | |
//int pontos = 2*linhas+1; | |
//escreve as linhas | |
for (int i = 0;i<linhas;i++){ | |
int pontos = 2*i+1; | |
//escreve os epaços | |
for(int space=0;space<(linhas-(i+1))*2;space++){ | |
System.out.print(" "); |
This file contains hidden or 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.*; | |
public class PerceptronSimples{ | |
public static void main(String[] args){ | |
/** | |
* Dados correspondem ao problema AND | |
*/ |
This file contains hidden or 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="pt-br"> | |
<head> | |
<title> </title> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link rel="stylesheet" href="css/bootstrap.min.css"> | |
<link rel="stylesheet" href="css/index.css"> |
This file contains hidden or 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 AdapterName extends RecyclerView.Adapter<AdapterName.ViewHolder> { | |
private Contract contract; | |
private List<T> data; | |
public AdapterName(Contract contract, List<T> data) { | |
this.contract = contract; | |
this.data = data; | |
} |
This file contains hidden or 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
Observable.just("Will") | |
.observeOn(Schedulers.io()) | |
.flatMap({ name -> | |
updateUserName.execute(name) //returns another Observable<ApiResult> after calling the API | |
}) | |
.subscribe({ apiResult -> | |
//what if you want to use the name here again to update the local cache for example if | |
//everything goes right with the API? | |
}) |
This file contains hidden or 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
Observable.just("Will") | |
.observeOn(Schedulers.io()) | |
.flatMap({ name -> | |
updateUserName.execute(name) //returns another Observable<ApiResult> after calling the API | |
}, { | |
//this is executed after resolving the last observable emitted, so the result is ready. | |
name: String, apiResult: ApiResult -> Pair(name, apiResult) | |
}) | |
.subscribe({ result -> |
OlderNewer