{{ message }}

Instantly share code, notes, and snippets.

💻
Coding

# Luis Cabrera Benito parzibyte

💻
Coding
Created Jul 25, 2021
Averiguar host de petición HTTP con Go
View averiguar_host.go
 package main import ( "encoding/json" "flag" "fmt" "log" "net/http" "strings" )
Created Aug 24, 2020
View mcm.java
 public static int minimoComunMultiplo(int a, int b) { // Y ahora aplicamos la fórmula que dice: // MCM(a, b) = (a * b) / MCD(a, b) return (a * b) / maximoComunDivisor(a, b); }
Created Aug 24, 2020
View mcd.java
 public static int maximoComunDivisor(int a, int b) { int temporal;//Para no perder b while (b != 0) { temporal = b; b = a % b; a = temporal; } return a; }
Created Aug 24, 2020
View mcd.java
 public class Main { public static void main(String[] args) { int a = 50; int b = 120; int mcd = maximoComunDivisor(a, b); System.out.printf("El MCD de %d y %d es %d\n", a, b, mcd); int mcdRecursivo = maximoComunDivisorRecursivo(a, b); System.out.printf("El MCD de %d y %d (con recursividad) es %d\n", a, b, mcdRecursivo); }
Created Aug 24, 2020
View mcdRecursivo.java
 public static int maximoComunDivisorRecursivo(int a, int b) { if (b == 0) return a; return maximoComunDivisorRecursivo(b, a % b); }
Created Aug 24, 2020
View mcd.java
 public static int maximoComunDivisor(int a, int b) { int temporal;//Para no perder b while (b != 0) { temporal = b; b = a % b; a = temporal; } return a; }
Created Aug 21, 2020
View translator.java
 /* ____ _____ _ _ _ | _ \ | __ \ (_) | | | | |_) |_ _ | |__) |_ _ _ __ _____| |__ _ _| |_ ___ | _ <| | | | | ___/ _` | '__|_ / | '_ \| | | | __/ _ \ | |_) | |_| | | | | (_| | | / /| | |_) | |_| | || __/ |____/ \__, | |_| \__,_|_| /___|_|_.__/ \__, |\__\___| __/ | __/ | |___/ |___/
Created Aug 21, 2020
View use.java
 public static void main(String[] args) { String originalText = "parzibyte.me"; System.out.println("Original text: " + originalText); String translatedText = textToBinary(originalText); System.out.println("In binary, it is: " + translatedText); System.out.println("-----------------");
Created Aug 21, 2020
View binaryToText.java
 public static String binaryToText(String binaryText) { String[] binaryNumbers = binaryText.split(" "); String text = ""; for (String currentBinary : binaryNumbers) { int decimal = binaryToDecimal(currentBinary); char letra = (char) decimal; text += letra; }
Created Aug 21, 2020
View textToBinary.java
 public static String textToBinary(String originalText) { String binaryText = ""; for (int i = 0; i < originalText.length(); i++) { char currentChar = originalText.charAt(i); int ascii = (int) currentChar; String binary = decimalToBinary(ascii); binaryText += binary + " "; } return binaryText; }