elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Security Series.XSS. [Cross Site Scripting]


  Mostrar Mensajes
Páginas: 1 ... 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 [73] 74 75 76 77 78 79
721  Programación / Java / Re: REALIZAR LA COPIA DE UNA FOTO EN UN DIRECTORIO en: 16 Noviembre 2009, 03:35 am
 :huh: y esto que edad tienes? 5 o 4  
-escribes no preguntas no dices nada ni saludas escribe al menos que es un aporte o algo

Saludos
722  Programación / Java / Re: Problema con encriptador en: 15 Noviembre 2009, 16:23 pm
jajaj  ;D ;D como se te pudo olvidar eso :)

Saludos.
723  Programación / Java / Re: Problema con encriptador en: 15 Noviembre 2009, 16:03 pm
no que yo sepa! finaje que no estas mandando nada a la salida estandar y todos tus metodos estan retornando string
Código
  1.    public static void main(String args[]) {
  2.        encriptador encriptador = new encriptador();
  3.        String t = encriptador.codificar("Hola", "debci").trim();
  4.        System.out.println("Text Encrypt : "+t);
  5.        System.out.println("Descrypt: "+encriptador.decodificar(t));
  6.    }
724  Programación / Java / Re: Inicializar matriz? en: 15 Noviembre 2009, 15:52 pm
prueba este los ordena bien  menos a mayor y mayor a menor pero el promedio si no se si es asi.

Código
  1. import java.io.IOException;
  2. import java.util.Iterator;
  3. import java.util.Scanner;
  4. import java.util.SortedSet;
  5. import java.util.TreeSet;
  6.  
  7. class funciones {
  8. /**
  9. * Method llenar
  10. *
  11. */
  12. public static void llenar(int m[][],int nroRows) {
  13. int j,i,x=0;
  14. for (i=0; i<m.length; i++){
  15. for (j=0;j<nroRows;j++){
  16. m[i][j]= x;x++;
  17. }
  18. }
  19. }
  20. /**
  21. * Method promedio
  22. * @return
  23. */
  24. public static double promedio(int m[][], int tam1,int n) {
  25. int c=tam1;
  26.    int j,sum=0;
  27.    double promedio =0;
  28.     for (j=0;j<tam1;j++){
  29.     sum+=m[n][j];
  30.        promedio = sum/c;
  31.        return promedio;
  32.     }
  33. return promedio;
  34. }
  35. /**
  36. * Method ordenar1
  37. * @param b
  38. *
  39. *
  40. */
  41. public static void ordenar1(int m[][],int n, boolean b) {
  42. SortedSet<Integer> sortedSet = null;
  43. if(b){
  44. for(int index=0;index<m.length;index++){
  45. sortedSet = new TreeSet<Integer>();
  46. for(int j=0;j<n;j++){
  47. sortedSet.add(m[index][j]);
  48. }
  49. Iterator<Integer> s=sortedSet.iterator();
  50. int x=0;
  51. while(s.hasNext()){
  52. m[index][x]=s.next();
  53. x++;
  54. }sortedSet.clear();
  55.  
  56. }
  57. }else{
  58. for(int index=0;index<m.length;index++){
  59. sortedSet = new TreeSet<Integer>();
  60. for(int j=0;j<n;j++){
  61. sortedSet.add(m[index][j]);
  62. }
  63. Iterator<Integer> s = sortedSet.iterator();
  64. int ins[] = new int[n];
  65. int i=0;
  66. while(s.hasNext()){
  67. ins[i]= s.next();
  68. i++;
  69. }
  70. i=0;
  71. for(int y=n;y>0;y--){
  72. m[index][i]=ins[y-1];
  73. i++;
  74. }
  75.  
  76. }
  77. }
  78. }
  79.  
  80. /**
  81. * Method mostrar1
  82. *
  83. *
  84. */
  85. public static void mostrar1(int m[][],int tam1) {
  86. int i,j;
  87. for (i=0;i<m.length;i++){
  88. System.out.print("Columna: "+i+" Promedio= "+funciones.promedio(m, tam1, i)+" =  ");
  89.  
  90. for (j=0;j<tam1;j++){
  91. System.out.print (+m[i][j]+ ": ");
  92. }
  93. System.out.println("\n");
  94. }
  95. System.out.println("----------------------------");;
  96. }
  97. }
  98. public class mainmain {
  99.  
  100. /**
  101. * lee matriz
  102. * saca el promedio
  103. * ordena de menor a mayor
  104. * ordena de mayor a menor
  105. *
  106. *
  107. * @param args
  108. *
  109. */
  110. public static void main(String[] args) throws IOException {
  111. Scanner en = new Scanner(System.in);
  112. int [][]m;
  113.  
  114. int nroColumn =0;
  115. int nroRows   =0;
  116. System.out.println("----------------------------");
  117. System.out.print ("Inserte No. Columnas: ");
  118. nroColumn = en.nextInt();
  119. System.out.print ("Inserte Nro. Filas  : ");
  120. nroRows = en.nextInt();
  121. System.out.println("---------------------------");
  122. m = new int [nroColumn][nroRows];
  123. funciones.llenar (m,nroRows);
  124. // funciones.promedio (m,nroRows);
  125. System.out.println("Ordenar de Menor a Mayor S/N");
  126. String select = en.next();
  127. if(select.equals("S") || select.equals("s")){
  128. funciones.ordenar1 (m,nroRows,true);
  129. funciones.mostrar1(m, nroRows);
  130. }else{
  131. funciones.ordenar1 (m,nroRows,false);
  132. funciones.mostrar1 (m,nroRows);
  133. }
  134. }

725  Programación / Java / Re: Problema con encriptador en: 15 Noviembre 2009, 15:30 pm
Text Encript : blcadHeoi
Descript: Hola

Saludos
726  Programación / Java / Re: Problema con encriptador en: 15 Noviembre 2009, 15:06 pm
dices que no de muestra nada que raro por que a mi si me lo muestra y funciona bien :-\

Saludos.
727  Programación / Java / Re: Inicializar matriz? en: 15 Noviembre 2009, 07:39 am
que no te funciona?

-El motodo de ordenamiento de menor a mayor | mayor a menor?
-El promedio?

Saludos.
728  Programación / Java / Re: Inicializar matriz? en: 14 Noviembre 2009, 17:46 pm
utiliza el scanner en ves del BufferReader

Código
  1. Scanner scanner = new Scanner(System.in);

   
Código
  1. for(int  indexColumn=0; indexColumn<matriz.length; indexColumn++){
  2.                        //le colocas el numero de filas ejemplo: 2
  3. for(int indexRows=0;indexRows<2;indexRows++)
  4. matriz[ indexColumn][indexRows]= new Random().nextInt(10);
  5. }

Saludos y suerte
729  Programación / Java / Re: ayuda plis, quebrando me el coco buscando por que esta mal en: 14 Noviembre 2009, 17:26 pm
ME falto decir que me da este error

Validador.java:30: getPresupuestos() in alarcon_fierro.Archivo cannot be applied to (java.lang.String)
 this.presupuestos=this.archivo.getPresupuestos("Presupuestos");


Ese error es bastante claro... tienes declarado un método llamado getPresupuestos que NO recibe parámetros... pero le estás pasando un String.
¿ya lo resolviste?

Si le recibe fijate public Vector getPresupuestos(String nombre) throws FileNotFoundException, IOException{
pero al parecer ya lo resolvio

Saludos.
730  Programación / Java / Re: ayuda plis, quebrando me el coco buscando por que esta mal en: 14 Noviembre 2009, 15:55 pm
posiblemente estes tratanto de pasar un string invalido a integer o a la contraria el cual sakas del archivo presupuestos

Saludos.
Páginas: 1 ... 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 [73] 74 75 76 77 78 79
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines