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

 

 


Tema destacado: Rompecabezas de Bitcoin, Medio millón USD en premios


  Mostrar Mensajes
Páginas: 1 2 3 4 5 [6] 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ... 79
51  Programación / Java / Re: Ayuda con problema UDP en: 20 Diciembre 2011, 19:37 pm
Archivos? en enunciado no te dice eso. deberias mejorar la forma en que lo estas haciendo :-\

Código
  1. case '1':
  2.    String parrafo=null;
  3.    BufferedReader inv = new BufferedReader(isr);  
  4. do{
  5.    System.out.println("\tIntroduzca el texto a enviar al servidor:\n");
  6.    parrafo = inv.readLine();
  7.    System.out.println("Introduzca la IP destinataria del mensaje: \n");
  8.    String ip;
  9.    ip = inv.readLine();
  10.    ejercicio53cliente cl = new ejercicio53cliente(2000);
  11.    byte data[]=parrafo.getBytes();
  12.    InetAddress destino = InetAddress.getByName(ip);
  13.    p=new DatagramPacket(data,data.length,destino,3000);
  14.    cl.socket.send(p);
  15.    cl.socket.close();
  16. }while(!parrafo.equalsIgnoreCase("fin"));break;
52  Programación / Java / Re: Ayuda con problema UDP en: 20 Diciembre 2011, 17:34 pm
primero lo primero

Código
  1. String parrafo;
  2.  
  3.        parrafo = inv.readLine();
  4.  
  5.    //inv.close(); /// no puedes leer si lo estas cerrado xD
  6.    System.out.println("Introduzca la IP destinataria del mensaje: \n");
  7.    String ip;
  8.    ip = inv.readLine();
53  Programación / Desarrollo Web / Re: submit hacer click en div en: 20 Diciembre 2011, 15:24 pm
Código
  1. <div name="button" id="xbutton" class="customButton" onClick="javascript:document.form[0].submit();">
54  Programación / Java / Re: Grabar Imagen a SQL en JAVA en: 20 Diciembre 2011, 14:45 pm
puedes pasarla a bytes de la siguiente forma:

Código
  1. BufferedImage bufferedImage = new BufferedImage(image.getWidth(null), image.getHeight(null), BufferedImage.TYPE_INT_ARGB);  
  2. Graphics2D graphics2d = bufferedImage.createGraphics();  
  3. graphics2d.drawImage(image, 0, 0, null);  
  4. ByteArrayOutputStream byteArrayOutputStream=new ByteArrayOutputStream();
  5. try {
  6. ImageIO.write(bufferedImage, "png", byteArrayOutputStream);
  7. byte bytes[]=byteArrayOutputStream.toByteArray();
  8. } catch (FileNotFoundException e) {
  9. // TODO Auto-generated catch block
  10. e.printStackTrace();
  11. } catch (IOException e) {
  12. // TODO Auto-generated catch block
  13. e.printStackTrace();
  14. }
  15.  
55  Sistemas Operativos / GNU/Linux / instalando sip-4.13 asm/errno.h: No such file or directory en: 9 Diciembre 2011, 23:20 pm
Hola gente, veran tengo un problema he estado intentando instalarme PyQT, cuando lo voy a instalar me pide que instale SIP ok, lo descargo lo intento instalar y me muestra el siguiente error:

Código:
root@leyer-AO532h:/home/leyer/sip-4.13# python configure.py
This is SIP 4.13 for Python 2.6.5 on linux2.
The SIP code generator will be installed in /usr/bin.
The sip module will be installed in /usr/lib/python2.6/dist-packages.
The sip.h header file will be installed in /usr/include/python2.6.
The default directory to install .sip files in is /usr/share/sip.
The platform/compiler configuration is linux-g++.
Creating siplib/sip.h...
Creating siplib/siplib.c...
Creating siplib/siplib.sbf...
Creating sipconfig.py...
Creating top level Makefile...
Creating sip code generator Makefile...
Creating sip module Makefile...
root@leyer-AO532h:/home/leyer/sip-4.13# make
make[1]: Entering directory `/home/leyer/sip-4.13/sipgen'
gcc -c -pipe -O2 -w -DNDEBUG -I. -o main.o main.c
gcc -c -pipe -O2 -w -DNDEBUG -I. -o transform.o transform.c
gcc -c -pipe -O2 -w -DNDEBUG -I. -o gencode.o gencode.c
In file included from /usr/include/bits/errno.h:25,
                 from /usr/include/errno.h:36,
                 from gencode.c:22:
/usr/include/linux/errno.h:4:23: error: asm/errno.h: No such file or directory
make[1]: *** [gencode.o] Error 1
make[1]: Leaving directory `/home/leyer/sip-4.13/sipgen'
make: *** [all] Error 2

alguna idea de como solucionarlo?

un saludo.
56  Programación / Java / Re: Postear en un foro SMF desde Java en: 5 Diciembre 2011, 18:27 pm
Lee el codigo fuente y buscas el formulario asi sabras que parametros colocar

como topic,message,icon,subject, etc... no olvides los  hidden
57  Programación / Java / Re: Postear en un foro SMF desde Java en: 5 Diciembre 2011, 13:35 pm
Una vez logueado tienes que usar GetMethod para moverte por las secciones del foro y para hacer un post usas postMethod
58  Sistemas Operativos / GNU/Linux / Re: ¿Qué sistema operativo instalar en un netbook?. en: 5 Diciembre 2011, 06:58 am
Mint o Fedora con LXDE son muy buenos :)
59  Programación / Java / Re: ayuda con ficheros en: 5 Diciembre 2011, 05:07 am
Código
  1. for (int j=0; j<5;j++){
  2.                    pw.print(" "+ boleto[j][i]);
  3.             }
  4.             pw.print("     estrellas:");
  5.             for (int s=5; s<7; s++){
  6.                pw.print(" "+boleto[s][i]);
  7.             }
:huh:

   
Código
  1. public static void fichero(int [][]boleto)throws IOException{
  2.        FileWriter fichero = null;
  3.        PrintWriter pw = null;
  4.        try{
  5.            fichero = new FileWriter("ep.txt");
  6.            pw = new PrintWriter(fichero);
  7.            pw.println(" ");
  8.            pw.println(" ");
  9.            pw.println(" ");
  10.            for (int i = 0; i < boleto.length; i++){
  11.             pw.println();
  12.             pw.print("Apuesta"+(i+1));
  13.             pw.print("     números:");
  14.             String nr="";
  15.             for (int j=0; j<5;j++){
  16.             nr+=boleto[i][j]+" ";
  17.                    pw.print(" "+ boleto[i][j]);
  18.             }
  19.             nr=nr.substring(0,nr.lastIndexOf(" "));
  20.             for(int spc=nr.length();spc<14;spc++)pw.print(" ");
  21.             pw.print("     estrellas:");
  22.             for (int s=5; s<7; s++)
  23.                pw.print(" "+boleto[i][s]);
  24.            }
  25.            pw.println("         --------------------           ");
  26.        }finally{
  27.         pw.close();
  28.        }
  29.    }

60  Programación / Java / MOVIDO: ME PRESENTO Y PIDO ORIENTACION en: 5 Diciembre 2011, 03:27 am
Lo siento me he equivocado  :xD

El tema ha sido movido a Ejercicios.

http://foro.elhacker.net/index.php?topic=346789.0
Páginas: 1 2 3 4 5 [6] 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ... 79
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines