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
property = [:algo, :face, :lo] | |
puts suffix_property_id = | |
property.inject { |memo, prop| "#{memo}_#{prop}"} | |
model = {algo: {otro: 'cantelas', face: {lo: 'lu'}}} | |
def unwrap model, property, index = 0 | |
if index < property.length - 1 | |
puts property[index] |
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
/* | |
* To change this template, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package standaloneexamples; | |
import java.util.*; | |
/** | |
* |
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 com.trabajo; | |
import javax.swing.JOptionPane; | |
public class Proyecto { | |
/** | |
* Metodo inicial. | |
*/ | |
public static void main(String[] args) { | |
try { |
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 javax.swing.JOptionPane; | |
public class paradigma { | |
public static void main(String[] args) { | |
int[] in = ingresar(); | |
sumar(in); | |
} | |
public static int[] ingresar() { | |
int arreglo[] = new int[10]; | |
for (int i = 0; i < 10; i++) { |
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 Trabajo; | |
public class SumarDecimal { | |
public static void main(String[] args) { | |
sumaDecimal(); | |
} | |
private static void sumaDecimal() { | |
String primerOperando = "5"; | |
String segundoOperando = "9"; |
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 com.trabajo; | |
import java.util.Arrays; | |
import javax.swing.JOptionPane; | |
public class SumaEnArrays { | |
public static void main(String[] args) { | |
String operando1 = JOptionPane.showInputDialog("Primer operando"); |
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 Trabajo; | |
public class DecimalAOctal { | |
public static void main(String[] args) { | |
octalADecimal("765"); | |
} | |
public static void octalADecimal(String base) { | |
String cadenaInver = ""; | |
int b = 0; | |
int c = 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
package trabajo; | |
import javax.swing.JOptionPane; | |
/** | |
* Clase principal del proyecto. | |
*/ | |
public class Proyecto { | |
/** |
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 Ensayo { | |
public static void main(String[] args) { | |
String inv = ""; | |
System.out.println(convertir("1234")); | |
} | |
public static String convertir(String num) { | |
String inv = ""; | |
for (int i = num.length() - 1; i >= 0; i--) { | |
inv += num.charAt(i); | |
} |
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 static int metodo() { | |
int mayor = 0; | |
for (int i = 1; i <= 5; i++) { | |
int entradaUsuario = Integer.parseInt(JOptionPane.showInputDialog("")); | |
if (entradaUsuario > mayor) { | |
mayor = entradaUsuario; | |
} | |
} | |