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 Fn { | |
public static String strpadLeft ( String cadena, String caracter, int largo ) { | |
if ( cadena.length() < largo ) { | |
largo -= cadena.length(); | |
while ( largo-- > 0) { | |
cadena = caracter + cadena; | |
} | |
} | |
return cadena; |
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
var fn = { | |
validaEntero : function ( value ) { | |
var RegExPattern = /[0-9]+$/; | |
return RegExPattern.test( value ); | |
}, | |
formateaNumero : function ( value ) { | |
if ( fn.validaEntero ( value ) ) { | |
var retorno = ''; | |
value = value.toString().split('').reverse().join(''); |
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 java.io.File; | |
import java.io.FileOutputStream; | |
import java.util.ArrayList; | |
import java.util.Hashtable; | |
import java.util.List; | |
import java.util.Properties; | |
import com.sap.conn.jco.AbapException; | |
import com.sap.conn.jco.JCoDestination; | |
import com.sap.conn.jco.JCoDestinationManager; | |
import com.sap.conn.jco.JCoException; |
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
var Fn = { | |
// Valida el rut con su cadena completa "XXXXXXXX-X" | |
validaRut : function (rutCompleto) { | |
if (!/^[0-9]+[-|‐]{1}[0-9kK]{1}$/.test( rutCompleto )) | |
return false; | |
var tmp = rutCompleto.split('-'); | |
var digv = tmp[1]; | |
var rut = tmp[0]; | |
if ( digv == 'K' ) digv = 'k' ; | |
return (Fn.dv(rut) == digv ); |
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
class MyClass { | |
let nombre:String; | |
init ( nombre:String ) { | |
self.nombre = nombre; | |
} | |
} | |
// Nueva instancia de la clase MyClass | |
let yoMismo = MyClass( nombre:"Cesar Gonzalez" ); | |
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
// Actualizada a la version de Swift 3.0.2 | |
print("Lista doblemente enlazada") | |
print("=========================") | |
// clase del nodo | |
class Nodo { | |
// valor del nodo | |
var valor:Int32! | |
// puntero al nodo siguiente |
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
// haciendo la serie de Fibonacci | |
// valor inicial de la serie | |
var valorInit:Int = 1; | |
// valor del segundo elemento de la serie | |
var valorNext:Int = 1; | |
print("Serie de Fibonacci") | |
print("==================") |
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
// Código actualizado a Swift 3.0.1 | |
print("Esto es para estudio de estructura de datos \n") | |
print("===========================================\n") | |
// Lista enlazada simple | |
// Esto es un objeto para lista enlazada | |
class Nodo { | |
// valor numerico del nodo | |
var valor:Int32! |
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
// Valida la forma del email, no su existencia en un servidor | |
function validaEmail ( $var = '' ) { | |
return preg_match("/^([0-9a-zA-Z]+[-._+&])*[0-9a-zA-Z]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}$/", $var); | |
} | |
// Ejemplo de uso | |
echo validaEmail ('[email protected]') ? 'Veo que es un bonito e-mail' : 'Esto no es dirección de email!!!'; |
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
class Helper { | |
/** | |
* Función de validación de un rut basado en el algoritmo chileno | |
* el formato de entrada es ########-# en donde deben ser sólo | |
* números en la parte izquierda al guión y número o k en el | |
* dígito verificador | |
*/ | |
static function validaRut ( $rutCompleto ) { | |
if ( !preg_match("/^[0-9]+-[0-9kK]{1}/",$rutCompleto)) return false; |
OlderNewer