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
.data | |
# primeiro numero | |
valorA: .asciiz "\nDigite Multiplicalicando: " | |
# segundo numero | |
valorB: .asciiz "Digite Multiplicalicador: " | |
# resposta | |
resposta: .asciiz "Resposta da Multiplicalicacao: " | |
# pula uma linha a cada saida na tela | |
.text |
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
.data | |
# entrada | |
printEntrada: .asciiz "\nInforme um numero: " | |
# saida par | |
pritPar: .asciiz " eh Par!" | |
# saida impar | |
printImpar: .asciiz " eh Impar!" | |
.text |
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.facape.eventosAcad.converter; | |
import javax.faces.component.UIComponent; | |
import javax.faces.context.FacesContext; | |
import javax.faces.convert.Converter; | |
import javax.faces.convert.FacesConverter; | |
@FacesConverter("phoneConverter") | |
public class PhoneConverter implements Converter { |
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
// Vamos comparar duas strings ignorando os acentos. | |
String st1 = "Gisele da Conceição Zózima Bündchen"; | |
String st2 = "Gisele da Conceicao Zozima Bundchen"; | |
String st3 = "GISELE DA CONCEICAO ZÓZIMA BUNDCHEN"; | |
String st4 = "Gisele da Conceicao Zozimo Bundchen"; // note que esta string é diferente | |
Collator collator = Collator.getInstance (new Locale ("pt", "BR")); | |
collator.setStrength(Collator.PRIMARY); // importante! | |
if (collator.compare (st1, st2) == 0) { |
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
// Linguagem C | |
// funcao recursiva para expoente | |
int expoente(int e) | |
{ | |
if(e == 0) { | |
return 0; | |
} else { | |
return 1 + expoente (e/10); | |
} |
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
// promise example | |
function get(url) { | |
// Return a new promise. | |
return new Promise(function(resolve, reject) { | |
// Do the usual XHR stuff | |
var req = new XMLHttpRequest(); | |
req.open('GET', url); | |
req.onload = function() { | |
// This is called even on 404 etc |
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 CPF 546.471.429-49 | |
Tutorial no link: https://www.devmedia.com.br/validando-o-cpf-em-uma-aplicacao-java/22097 | |
--} | |
module Util.CpfValidator where | |
import Data.Char | |
{-- |
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
private final List<com.google.android.libraries.places.api.model.Place.Field> placeFields = Arrays.asList( | |
com.google.android.libraries.places.api.model.Place.Field.ID, | |
com.google.android.libraries.places.api.model.Place.Field.NAME, | |
com.google.android.libraries.places.api.model.Place.Field.ADDRESS, | |
com.google.android.libraries.places.api.model.Place.Field.LAT_LNG | |
); | |
FindCurrentPlaceRequest request = FindCurrentPlaceRequest.builder(placeFields).build(); | |
Task<FindCurrentPlaceResponse> placeResponse = placesClient.findCurrentPlace(request); |
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 Queue extends Array { | |
enqueue(val) { | |
this.push(val); | |
} | |
dequeue() { | |
return this.shift(); | |
} | |
peek() { |
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> | |
<head> | |
<title></title> | |
</head> | |
<body> | |
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.0/socket.io.js"></script> | |
<script type="text/javascript"> | |
var socket = io.connect('http://localhost:3000/api/v1', { | |
query: new URLSearchParams({token: 'asdad', room: '123'}).toString() |
OlderNewer