Skip to content

Instantly share code, notes, and snippets.

View rhynl's full-sized avatar

Rhay Parra rhynl

View GitHub Profile
package programa;
import java.util.Stack;
import java.util.StringTokenizer;
public class Programa {
public static void main(String[] args) {
String sTexto = "En todo caso había un solo túnel oscuro y solitario el mío el túnel en que había transcurrido mi infancia mi juventud toda mi vida";
System.out.println(inversion(sTexto));
package programa;
import java.util.Stack;
public class Programa {
public static void main(String[] args) {
String cadena_no_valida = "**(Cadena no equilibrada en paréntesis(()()()))))";
if (verificarBalanceoDeSimbolos(cadena_no_valida, '*', '*')) {
@rhynl
rhynl / promedio.java
Created September 28, 2017 23:00
Promedio de notas de estudiantes
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package javaapplication21;
/**
*
* @author alumno
package javaapplication5;
import java.util.Scanner;
public class JavaApplication5 {
static Scanner keyboard = new Scanner(System.in);
public static void main(String[] args) {
@rhynl
rhynl / isPrime.java
Created August 22, 2017 00:52
Algoritmo para determinar si un numero es primo o no (implementación en Java).
import java.util.Scanner;
public class Main {
static Scanner keyboard = new Scanner(System.in);
public static void main(String[] args) {
int number, divisor = 2;
boolean isPrime = true;
@rhynl
rhynl / cloudSettings
Last active April 14, 2020 12:59
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-08-10T19:49:52.197Z","extensionVersion":"v3.4.1"}
Carro.prototype.numeroDeRuedas = function(numero) {
if (typeof numero) {
this._numeroDeRuedas = parseInt(numero, 4);
}
return this._numeroDeRuedas;
}
//setter
this.numeroDeRuedas(4);
@rhynl
rhynl / Herencia en ES5.js
Created January 5, 2016 15:41
Clases y Herencia en JavaScript
var Carro = function Carro (nombre, tipo) {
Vehiculo.call(this, name, tipo);
this.encender(encender);
this.combustible = '';
};
Carro.prototype = Object.create(Vehiculo.prototype);
Carro.prototype.constructor = Carro;
Carro.prototype.default = function () {
return new Carro('miCarro','sedan');
var Vehiculo = function Vehiculo(nombre, tipo) {
this._name(name || '');
this._tipo = tipo;
}
@rhynl
rhynl / example.json
Created November 20, 2015 16:11
json vs xml
{"menu": {
"header": "SVG Viewer",
"items": [
{"id": "Open"},
{"id": "OpenNew", "label": "Open New"},
null,
{"id": "ZoomIn", "label": "Zoom In"},
{"id": "ZoomOut", "label": "Zoom Out"},
{"id": "OriginalView", "label": "Original View"},
null,