Skip to content

Instantly share code, notes, and snippets.

View douglasiacovelli's full-sized avatar

Douglas Iacovelli douglasiacovelli

  • @contratadome
  • Bertioga
View GitHub Profile
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{
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 );
@douglasiacovelli
douglasiacovelli / MatrizEsp
Created May 13, 2012 04:39
Matriz Espiral
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++) {
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(" ");
/*
Fernanda Moraes, Yuri M., Anselmo S., Marcos P..
* Definir uma maneira de indicar o estado inicial dos navios dos jogadores;
* Exibir todos os movimentos dos jogadores, informando se os ataques foram bem sucedidos ou não;
* Informar quando um navio é atingido e quando ele é afundado;
* Exibir ao final do jogo um mapa final do posicionamento final dos navios dos jogadores.*/
import java.util.*;
public class PerceptronSimples{
public static void main(String[] args){
/**
* Dados correspondem ao problema AND
*/
@douglasiacovelli
douglasiacovelli / index.html
Created January 10, 2014 17:32
HTML: Template
<!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">
@douglasiacovelli
douglasiacovelli / BasicAdapter.java
Last active April 13, 2017 17:45
Basic Adapter with dataBinding
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;
}
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?
})
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 ->