This file contains hidden or 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
// Programa para separar los digitos de un número dado | |
import java.util.Scanner; | |
public class Separador { | |
public static void main(String[] args) { | |
Scanner input = new Scanner(System.in); |
This file contains hidden or 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
function contar() { | |
var checkboxes = document.getElementById("test").checkbox; // Array de checkboxes | |
var cont = 0; // Checkboxes marcados, por defecto empieza la cuenta en 0 | |
for (var i = 0; i < checkboxes.length; i++) { | |
if (checkboxes[i].checked) { | |
cont = cont++; | |
} | |
} | |
var porcen = (cont/checkboxes.length) * 100; // Porcentaje de checboxes marcados |
This file contains hidden or 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
function cambiar(obj) { | |
var img = obj.id; // Obtenemos la ID del objeto | |
var img_dos = document.getElementById(img).src // Obtenemos la ruta del objeto con ID obtenida atrás | |
document.getElementById('pic').src = img_dos; // Cambiamos la ruta de la imagen por la obtenida antes | |
} |
This file contains hidden or 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
<div id="imagen" align="center"> | |
<img src="./imagenes/3.jpg" alt="Imagen" id="pic" width="400" height="400" /><br/><br/> | |
Al pasar sobre cada imagen, esta se colocará arriba<br/> | |
<img src="./imagenes/1.png" alt "Imagen" id="1" width="100" height="100" onMouseOver="cambiar(this);" /> | |
<img src="./imagenes/2.jpg" alt "Imagen" id="2" width="100" height="100" onMouseOver="cambiar(this);" /> | |
<img src="./imagenes/3.jpg" alt "Imagen" id="3" width="100" height="100" onMouseOver="cambiar(this);" /> | |
</div> |
This file contains hidden or 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 rollingDices; | |
import java.io.*; | |
public class RollingDices { | |
String[] dice_one = {"Action 1", "Action 2", "Action 3", "Action 4", "Action 5", "Action 6"}; // Primer dado | |
String[] dice_two = {"Action 1", "Action 2", "Action 3", "Action 4", "Action 5", "Action 6"}; // Segundo dado | |
public String diceOne() { // Tira el primer dado y devuelve el resultado | |
int rolling_one = (int)(Math.random() * 6); | |
return dice_one[rolling_one]; |
This file contains hidden or 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.io.*; | |
public class ObjectWriter { | |
public static void añadirContacto() { | |
Objeto nuevoObjeto = new Objeto(parametro_1, parametro_2, parametro_3); | |
try { | |
ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("/home/USUARIO/registro.txt", true)); | |
oos.writeObject(nuevoObjeto); | |
oos.close(); | |
System.out.println("Objeto escrito correctamente"); |
This file contains hidden or 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.io.*; | |
public class ObjectReader { | |
public static void leerRegistro() { | |
try { | |
try (FileInputStream fis = new FileInputStream("/home/USER/registro.txt")) { | |
ObjectInputStream ois = new ObjectInputStream(fis); | |
while (fis.available() > 0) { | |
Objeto registro = (Objeto)ois.readObject(); | |
System.out.println(registro.toString() + "\n"); |
This file contains hidden or 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
html { | |
background: url(background.jpg) no-repeat fixed center; | |
-webkit-background-size: cover; | |
-moz-background-size: cover; | |
-o-background-size: cover; | |
background-size: cover; | |
} |
This file contains hidden or 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
<script type="text/javascript" src="http://your-tumblr-blog/js?num=5"></script> | |
<script type="text/javascript"> | |
//try to remove img and iframe src asap to avoid image loading | |
$('.tumblr_posts .tumblr_photo_post img, .tumblr_posts .html_photoset iframe').each(function(index, element) | |
{ | |
$(element).attr('data-src', $(element).attr('src')) | |
$(element).removeAttr('src').addClass('superload') | |
}) | |
//load src when the page is loaded |
This file contains hidden or 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
# Conky config | |
# Por Juanjo Salvador (http://juanjosalvador.github.io/) | |
background no | |
use_xft yes | |
xftfont Sans:size=8 | |
xftalpha 1 | |
update_interval 1 | |
total_run_times 0 | |
own_window yes |
OlderNewer