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
// | |
// By Jsn | |
// | |
// Retorna un entero sin numeros duplicados | |
// tomando en cuenta la eliminacion de los digitos de izquierda a derecha | |
private static int limpiarDuplicados(int n){ | |
int x = n, nx = 0; | |
int y = 0, ny = 0; | |
int t = 0, c = 0,r = 0; |
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
Abmbito del controlador | |
$scope | |
Directivas | |
Etiquetas html que llaman a Angular o corre o referenciar codigo javascript. | |
ng-app -- Carga un modulo | |
ng-controller -- Carga un controlador | |
ng-show -- Muestra el contenido de la etiqueta | |
ng-hide -- Oculta el contenido de la etiqueta |
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
<?php | |
// | |
// By Jsn | |
// | |
// Get file | |
function getFileData($file){ | |
$o = fopen($file,'r'); | |
$r = fread($o,filesize($file)); |
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
<?php | |
require('ImageToBase64.php'); | |
@$req = $_GET['req']; | |
switch ($req){ | |
case "test": | |
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
$.ajax({ | |
url: "req.php?req=test", | |
success: function(data) { | |
global['data'] = data; | |
console.log('descargo'); | |
i = new Image(); | |
i.src = data.imgList.imagen1; | |
} | |
}); |
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 int getPosition(int x,int n){ | |
int c = getCantidadDigitos(n); | |
if (x>c || x<1) return 0; | |
return (n/(int)Math.pow(10,c-x))%10; | |
} | |
public int getCantidadDigitos(int n){ | |
int c = 0; | |
while(n>0){ | |
c++; |
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 int EliminarDigitosRepetidos(int n){ | |
int c = getCantidadDigitos(n); | |
int r = 0; | |
while(c>1){ | |
int x = getPosition(1,n); | |
r = r * 10 + x; | |
int l = c; | |
int t = 0; |
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
/** | |
* Crear un objeto de tipo fecha | |
* @author IJsn | |
*/ | |
public class Fecha { | |
Calendar date; | |
/** | |
* Crean un objeto con la fecha actual del sistem |
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
private static void readFileLineByLine(String fileName){ | |
try{ | |
FileReader reader = new FileReader(fileName); | |
BufferedReader buffer = new BufferedReader(file); | |
String line; | |
while ( (line = buffer.readLine()) != null ){ | |
show(line); | |
} | |
buffer.close(); | |
}catch(Exception e){ |
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
private static void writeToFile(String fileName){ | |
try{ | |
FileWriter file = new FileWriter(fileName); | |
BufferedWriter buffer = new BufferedWriter(file); | |
String[] datos = new String[]{"Uno","Dos","Tres","Cuatro"}; | |
for(String dato : datos){ | |
buffer.append(dato); | |
buffer.newLine(); | |
} | |
buffer.close(); |
OlderNewer