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
'fsutil file createnew <NOMBRE_ARCHIVO> <TAMAÑO EN BYTES> | |
'Para el cálculo de bytes https://es.calcuworld.com/informatica/calculadora-de-bytes/ | |
fsutil file createnew archivo_3_megas.pdf 3145728 |
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
function limpiaParametros( $param ) { | |
$cross_site_scripting = array ( '@<script[^>]*?>.*?</script>@si', // Remover javascript | |
'@<[\/\!]*?[^<>]*?>@si' ); // Remover etiquetas HTML | |
$inyeccion_sql = array ( '/\bAND\b/i', '/\bOR\b/i', '/\bSELECT\b/i', | |
'/\bFROM\b/i', '/\bWHERE\b/i', '/\bUPDATE\b/i', | |
'/\bDELETE\b/i', '/\b\*\b/i', '/\bCREATE\b/i' ); | |
$retorno = preg_replace ( $inyeccion_sql, "", $param ); | |
$retorno = preg_replace ( $cross_site_scripting, "", $retorno ); | |
$retorno = htmlentities( $retorno, ENT_QUOTES ); // Acá es importante verificar la codificación (ISO o UTF-8) | |
return trim( $retorno ); |
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.util.concurrent.ThreadLocalRandom; | |
class Helper { | |
static int[] lista_generica_valores ( int largo_cadena ) { | |
int [] arreglo_base = new int[largo_cadena]; | |
for ( int n =0; n<largo_cadena;n++ ) { | |
arreglo_base[n] = ThreadLocalRandom.current().nextInt(0, 100000 + 1); | |
} | |
return arreglo_base; |
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 BubleSort { | |
BubleSort (int ... array) { | |
long time_start, time_end; | |
time_start = System.currentTimeMillis(); | |
for(int i = 0; i < array.length; i++) { | |
for(int j = i + 1; j < array.length; j++) { | |
if(array[j] < array[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
-- Lista de tablas | |
SELECT * FROM INFORMATION_SCHEMA.TABLES | |
-- Lista de SP's | |
SELECT * FROM INFORMATION_SCHEMA.routines where routine_type = 'PROCEDURE' | |
-- Lista de tablas con las columnas y sus descripciones | |
SELECT sys.objects.name AS TableName, | |
sys.columns.name AS ColumnName, | |
ep.value AS Description |
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
-- Obtención de un objeto DATETIME desde una cadena de texto | |
SELECT CAST('20200101' AS DATETIME) AS fecha | |
-- resultado | |
-- 01/01/2020 0:00:00 | |
-- Resta de un mes a la fecha obtenida desde una cadena de texto |
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
CREATE TABLE #tabla_temporal ( | |
id_tabla BIGINT | |
,cd_columna_01 BIGINT | |
,gl_columna_02 | |
) | |
CREATE NONCLUSTERED INDEX idx_tabla_temporal ON #tabla_temporal ([id_tabla]) | |
-- Otras formas de definir indices |
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
$(document).ready(function(){ | |
/** | |
* Setea e inicializa la tabla con datos | |
*/ | |
$("#tbl_ajax").DataTable({ | |
"ajax" : URL_SERVICIO, | |
"columns" : [ | |
{"data" : "col1" }, | |
{"data" : "col2"}, |
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
-- Lista de claves foraneas, solo información | |
SELECT name AS 'Constraint', | |
OBJECT_NAME(parent_object_id) AS 'Table', | |
OBJECT_NAME(referenced_object_id) AS 'Referenced Table', | |
is_disabled, | |
is_not_trusted | |
FROM sys.foreign_keys; | |