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 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 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 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 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 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 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 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 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 FormActivity: AppCompatActivity { | |
onCreate(...){...} | |
fun sendFormAndGoBack(name: String) { | |
// if you want to send any type of data back, such as an object, string, int etc | |
// you have to create an intent and use this bit of code | |
// otherwise you can just use setResult(Activity.RESULT_OK) and finish() | |
val resultIntent = Intent() |
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 ListActivity: AppCompatActivity { | |
private val REQUEST_FORM = 1 | |
onCreate(...){...} | |
fun startFormActivity() { | |
val intent = Intent(this, FormActivity::class.java) | |
startActivityForResult(intent, REQUEST_FORM) | |
} |
OlderNewer