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

 

 


Tema destacado: Introducción a Git (Primera Parte)


  Mostrar Mensajes
Páginas: [1] 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
1  Informática / Software / Re: ¿Conocen algun Software? en: 2 Octubre 2019, 18:28 pm
Yo utilizo este y genial:

https://www.elgrupoinformatico.com/elimina-carpetas-vacias-windows-t23795.html


Saludos
2  Programación / .NET (C#, VB.NET, ASP) / Re: Ingresar una oracion, toma cada palabra y contar sus vocales en: 29 Septiembre 2015, 20:05 pm
Hola, creo que tu código está muy rebuscado, que tal algo así para que te bases un poco:

Código
  1. Dim palabras() As String = txtOracion.Text.Split(" ")   'txtOracion es un textbox
  2. Dim contador = 0
  3. For i = 0 To palabras.Count() - 1
  4.    For j = 0 To palabras(i).Length - 1
  5.         If palabras(i)(j) = "a" Or palabras(i)(j) = "A" _
  6.             Or palabras(i)(j) = "e" Or palabras(i)(j) = "E" _
  7.             Or palabras(i)(j) = "i" Or palabras(i)(j) = "I" _
  8.             Or palabras(i)(j) = "o" Or palabras(i)(j) = "O" _
  9.             Or palabras(i)(j) = "u" Or palabras(i)(j) = "U" Then
  10.                    contador += 1
  11.           End If
  12.     Next
  13. Next
  14. lblVocales.Text = contador.ToString()    'lblVocales es un Label
  15.  

Esto te cuentas vocales de toda oración... ya te toca a ti separarlas por palabra si lo requieres.
3  Programación / Programación Visual Basic / Re: Duda Sobre Loop? en: 12 Julio 2015, 04:36 am
Olvídate del for...  esto es algo muy básico, pero te dará la idea del uso del timer

Código
  1. Private Sub Form_Load()
  2.    Timer1.Interval = 1000
  3.    Timer1.Enabled = True
  4. End Sub
  5.  
  6. Private Sub Timer1_Timer()
  7.    if mario1.visible = true
  8.         mario1.visible = false
  9.         luigi1.visible = true
  10.    else
  11.         mario1.visible = true
  12.         luigi1.visible = false
  13.    end if
  14. End Sub
4  Programación / Programación Visual Basic / Re: Comprobar si existe datos en mysql y si existe hacer update, si no hacer insert en: 15 Abril 2015, 20:56 pm
Pero claro que la hay... has una consulta "SELECT"  a los datos que deseas actualizar o insertar... si en el recordset te devuelve 1 o mas filas es que ya existen y debe hacer el UPDATE, si el recordset está vacío haces el INSERT.

Saludos
5  Sistemas Operativos / Windows / Re: Windows 1.0 en: 23 Marzo 2015, 07:44 am
Hola, yo te recomiendo que mejor uses una maquina virtual (virtualbox es la mejor opción para mi)... con el hardware de hoy en día es muy difícil que puedas configurar versiones tan antiguas y realmente no vale la pena...

Saludos
6  Sistemas Operativos / Windows / Re: Windows, numero de IP posibles en: 23 Marzo 2015, 07:37 am
La direccion IP no depende del equipo ni del sistema operativo, mas bien dependen de las interfaces de red que contenga dicho equipo.... así que para mi es la e)


Saludos
7  Programación / Java / Re: [Aporte] Desarrollo Videojuego Java [Muy Basico] en: 23 Febrero 2015, 22:02 pm
Hola, me pareció muy interesante el tutorial, me gustaría aprender un poco mas, nunca había hecho algo así en java (aunque si tengo algo de conocimiento del lenguaje). Aqui esta mi codigo modificado con las sugerencias que propones, suena que se está formando un interesante y minimalista juego de estrategia  :P

Código
  1. import java.awt.Color;
  2. import java.awt.Dimension;
  3. import java.awt.Graphics;
  4. import java.awt.Rectangle;
  5. import java.awt.event.KeyEvent;
  6. import java.awt.event.KeyListener;
  7. import javax.swing.JPanel;
  8.  
  9. public class GamePanel extends JPanel implements Runnable, KeyListener {
  10.  
  11. public static final int GAME_WIDTH = 640;
  12. public static final int GAME_HEIGHT = 480;
  13.  
  14. private int expectedFps = 60;
  15. private Thread gameThread;
  16.  
  17. private final Rectangle rectangle = new Rectangle(0, 0, 32, 32);
  18. private final Rectangle rectangle2 = new Rectangle(0, GAME_HEIGHT - 32, 32, 32);
  19.  
  20. private boolean existenCuadros = false;
  21.  
  22. public GamePanel() {
  23. this.setPreferredSize(new Dimension(GAME_WIDTH, GAME_HEIGHT));
  24. this.gameThread = new Thread(this);
  25. }
  26.  
  27. @Override
  28. public void run() {
  29. long start;
  30. long elapsed;
  31. long wait;
  32. while(true) {
  33. start = System.nanoTime();
  34. this.repaint();
  35. elapsed = System.nanoTime();
  36. wait = 1000/expectedFps - (elapsed-start)/1000000;
  37. wait = (wait < 0) ? 0 : wait;
  38. try {
  39. Thread.sleep(wait);
  40. } catch(InterruptedException ex) {
  41.  
  42. }
  43. }
  44. }
  45.  
  46. private void init() {
  47. this.gameThread.start();
  48. this.addKeyListener(this);
  49. this.setFocusable(true);
  50. this.requestFocus();
  51. }
  52.  
  53. @Override
  54. public void addNotify() {
  55. super.addNotify();
  56. init();
  57. }
  58.  
  59. private void dibujaCuadros(Graphics g) {
  60.  
  61. }
  62.  
  63. @Override
  64. public void paintComponent(Graphics g) {
  65. g.setColor(Color.DARK_GRAY);
  66. g.fillRect(0, 0, GAME_WIDTH, GAME_HEIGHT);
  67. g.setColor(Color.WHITE);
  68. g.fillRect(rectangle.x, rectangle.y, rectangle.width, rectangle.height);
  69. g.setColor(Color.CYAN);
  70. g.fillRect(rectangle2.x, rectangle2.y, rectangle2.width, rectangle2.height);
  71.  
  72. for(int i=1; i<=20; i++) {
  73. if(existenCuadros)
  74. g.setColor(Color.YELLOW);
  75. else
  76. g.setColor(Color.DARK_GRAY);
  77. g.drawLine(0, i*rectangle.height, GAME_WIDTH, i*rectangle.height);
  78. g.drawLine(i*rectangle.width, 0, i*rectangle.width, GAME_HEIGHT);
  79. }
  80.  
  81. }
  82.  
  83. @Override
  84. public void keyTyped(KeyEvent e) {
  85.  
  86. }
  87.  
  88. @Override
  89. public void keyPressed(KeyEvent e) {
  90. switch(e.getExtendedKeyCode()) {
  91. case KeyEvent.VK_LEFT:
  92. rectangle.x -= 32;
  93. if(rectangle.x < 0) rectangle.x = 0;
  94. break;
  95. case KeyEvent.VK_RIGHT:
  96. rectangle.x += 32;
  97. if(rectangle.x >= GAME_WIDTH) rectangle.x = GAME_WIDTH - rectangle.width;
  98. break;
  99. case KeyEvent.VK_UP:
  100. rectangle.y -= 32;
  101. if(rectangle.y < 0) rectangle.y = 0;
  102. break;
  103. case KeyEvent.VK_DOWN:
  104. rectangle.y += 32;
  105. if(rectangle.y >= GAME_HEIGHT) rectangle.y = GAME_HEIGHT - rectangle.height;
  106. break;
  107.  
  108. case KeyEvent.VK_A:
  109. rectangle2.x -= 32;
  110. if(rectangle2.x < 0) rectangle2.x = 0;
  111. break;
  112. case KeyEvent.VK_D:
  113. rectangle2.x += 32;
  114. if(rectangle2.x >= GAME_WIDTH) rectangle2.x = GAME_WIDTH - rectangle2.width;
  115. break;
  116. case KeyEvent.VK_W:
  117. rectangle2.y -= 32;
  118. if(rectangle2.y < 0) rectangle2.y = 0;
  119. break;
  120. case KeyEvent.VK_S:
  121. rectangle2.y += 32;
  122. if(rectangle2.y >= GAME_HEIGHT) rectangle2.y = GAME_HEIGHT - rectangle2.height;
  123. break;
  124.  
  125. case KeyEvent.VK_C:
  126. existenCuadros = !existenCuadros;
  127. break;
  128.  
  129. }
  130. }
  131.  
  132. @Override
  133. public void keyReleased(KeyEvent e) {
  134.  
  135. }
  136.  
  137. }
8  Programación / Programación C/C++ / Re: [Solucionado] Problema para escribir en C++ en: 29 Agosto 2014, 17:59 pm
Hola amigo, el texto si se imprime, solo que como la consola se desplaza pues no lo muestra, para verlo mueve el scrollbar vertical hacia arriba.

Saludos
9  Programación / Programación Visual Basic / Re: [RETO] Determinar Número Perfecto en: 8 Noviembre 2013, 02:24 am
Aui va mi función, es muy rapida  :rolleyes:
Código
  1. Private Function esNumeroPerfecto(ByVal numero As Double) As Boolean
  2.        Dim aux(7) As Double
  3.        Dim i As Integer
  4.        aux(0) = 6
  5.        aux(1) = 28
  6.        aux(2) = 496
  7.        aux(3) = 8128
  8.        aux(4) = 33550336
  9.        aux(5) = 8589869056
  10.        aux(6) = 137438691328
  11.        aux(7) = 2305843008139952128
  12.  
  13.        For i = 0 To 7
  14.            If numero = aux(i) Then
  15.                Return True
  16.            End If
  17.        Next
  18.        Return False
  19. End Function


Jaja fuera bromas, esto es lo que pude hacer, aunque con numeros muy grandes tarda una eternidad  :-\
Código
  1. Este se tarda una eternidad en comprobar los ultimos 2 numeros de la lista
  2. Private Function esNumeroPerfecto(ByVal numero As Double) As Boolean
  3.        Dim aux As Double = 1
  4.        Dim aux2 As Double = 0
  5.        Dim sum As Double = 0
  6.        While aux <= (numero / 2)
  7.            aux2 = numero Mod aux
  8.            If aux2 = 0 Then
  9.                sum += aux
  10.            End If
  11.            aux += 1
  12.        End While
  13.        Return (sum = numero)
  14.    End Function

Saludos
10  Seguridad Informática / Análisis y Diseño de Malware / Re: Crear un gusano en C en: 9 Abril 2013, 21:52 pm
No se si sea como el CONFICKER pero te dejo el codigo de un gusano muy mono:

Código
  1. #include  <stdio.h>
  2.  
  3. int main()
  4. {
  5.   printf("         /");
  6.  printf("      ()");
  7.  printf("     ||");
  8.  printf("     ||");
  9.  printf("  __  \\");
  10.  printf(" /  >   \\");
  11.  printf(" ||` .-"||".");
  12.  printf("  \\/  _//. `\");
  13.  printf("   (  (-'  \  \");
  14.  printf("    \  )   |  |");
  15.  printf("     `"   /  /");
  16.  printf("         /  /");
  17.  printf("        |  (       _");
  18.  printf("         \  `.-.-.'o`\");
  19.  printf("          '.( ( ( .--'");
  20.  printf("            `"`"'`");
  21.  return 0;
  22. }

Saludos  ;D
Páginas: [1] 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines