Skip to content

Instantly share code, notes, and snippets.

View sanrodari's full-sized avatar

Santiago Rodriguez sanrodari

View GitHub Profile
@sanrodari
sanrodari / UnwrapProps.rb
Created July 3, 2012 02:23 — forked from anonymous/ruby_fiddle.rb
Unwrap Props
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]
@sanrodari
sanrodari / StandaloneExamples.java
Created June 19, 2012 14:34
Ordenamiento con comparator
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package standaloneexamples;
import java.util.*;
/**
*
package com.trabajo;
import javax.swing.JOptionPane;
public class Proyecto {
/**
* Metodo inicial.
*/
public static void main(String[] args) {
try {
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++) {
package Trabajo;
public class SumarDecimal {
public static void main(String[] args) {
sumaDecimal();
}
private static void sumaDecimal() {
String primerOperando = "5";
String segundoOperando = "9";
@sanrodari
sanrodari / SumarArreglos.java
Created June 10, 2012 01:54
SumarArreglos.java
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");
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;
package trabajo;
import javax.swing.JOptionPane;
/**
* Clase principal del proyecto.
*/
public class Proyecto {
/**
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);
}
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;
}
}