|
Mostrar Temas
|
Páginas: [1] 2 3
|
1
|
Comunicaciones / Redes / Problema de conexion entre el ISP y Data Center Turnkey
|
en: 14 Marzo 2017, 19:59 pm
|
El ISP es CANTV y se encuentra en Venezuela el data center Turnkey se encuentra en Australia. Mis Clientes Cuando van a realizar sus solicitudes al DNS llamado efactory.sytes.net tienen respuesta lenta. El paquete de datos comprado a Turnkey para el almacenamiento queda descartado, hay disponibilidad de sobra de RAM y CPU.
Cual podría ser entonces la causa del Problema?
|
|
|
2
|
Programación / Java / GridBagLayout no posiciona los componentes
|
en: 26 Octubre 2016, 16:01 pm
|
Dentro de la ventana Login los componentes se muestran totalmente desordenados, a pesar que estoy utilizando GridBagLayout package drone; import java.awt.*; import java.sql.*; import java.text.Collator; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.JOptionPane; import javax.swing.*; public class Login extends javax. swing. JFrame { //private JPanel panel1; public static boolean RIGHT_TO_LEFT = false; final static boolean shouldFill = true; final static boolean shouldWeightX = true; public Login() { initComponents(); this. setSize(Toolkit. getDefaultToolkit(). getScreenSize()); PnlFondo fondo = new PnlFondo(); //getContentPane().setLayout(null); //addComponentsToPane(pane); } public static void addComponentsToPane (Container pane ) { if (RIGHT_TO_LEFT) { } JLabel jLabel1,jLabel2,jLabel3 ; if (shouldFill) { //natural height, maximum width } if (shouldWeightX) { c.weightx = 0.5; } c.gridx = 200; c.gridy = 100; pane.add(jLabel1, c); c.weightx = 0.5; c.gridx = 200; c.gridy = 110; pane.add(jLabel2, c); c.weightx = 0.5; c.gridx = 2; c.gridy = 0; pane.add(jLabel3, c); c.ipady = 40; //make this component tall c.weightx = 0.0; c.gridwidth = 3; c.gridx = 0; c.gridy = 1; pane.add(usuario, c); c.ipady = 40; //make this component tall c.weightx = 0.0; c.gridwidth = 3; c.gridx = 0; c.gridy = 1; pane.add(contraseña, c); c.ipady = 0; //reset to default c.weighty = 1.0; //request any extra vertical space c. insets = new Insets(10, 0, 0, 0); //top padding c.gridx = 1; //aligned with button 2 c.gridwidth = 2; //2 columns wide c.gridy = 2; //third row pane.add(jButton2, c); } private static void createAndShowGUI() { //Create and set up the window. frame. setDefaultCloseOperation(JFrame. EXIT_ON_CLOSE); //Set up the content pane. addComponentsToPane(frame.getContentPane()); //Display the window. frame.pack(); frame.setVisible(true); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code"> private void initComponents() { jLabel1 = new javax. swing. JLabel(); jLabel2 = new javax. swing. JLabel(); jLabel3 = new javax. swing. JLabel(); jButton2 = new javax. swing. JButton(); jLabel1.setText("Iniciar Sesion"); jLabel2.setText("Usuario"); jLabel3.setText("Contraseña"); jButton2.setText("Aceptar"); public void actionPerformed (java. awt. event. ActionEvent evt ) { jButton2ActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() . addContainerGap(113, Short. MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(usuario, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addGap(20, 20, 20) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(169, 169, 169))) .addGroup(layout.createSequentialGroup() .addComponent(jLabel3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(contraseña, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(163, 163, 163)))) .addGroup(layout.createSequentialGroup() .addGap(148, 148, 148) .addComponent(jButton2) . addGap(0, 0, Short. MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() . addContainerGap(108, Short. MAX_VALUE) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel2) .addComponent(usuario, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(11, 11, 11) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3) .addComponent(contraseña, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton2) .addGap(107, 107, 107)) ); pack(); }// </editor-fold> private void jButton2ActionPerformed (java. awt. event. ActionEvent evt ) { String user =usuario. getText(); String pass =contraseña. getText(); if ((user.length()==0)||(pass.length()==0)){ JOptionPane. showMessageDialog(rootPane, "Campo usuario o contraseña vacio"); }else{ Conexion mysql= new Conexion(); /* if(conn!=null){ JOptionPane.showMessageDialog(rootPane, "Conexion con base de datos"); }*/ try { @SuppressWarnings("null") rs = sentencia.executeQuery("SELECT * FROM usuarios WHERE Usuario='"+user+"' && Contraseña='"+pass+"'"); comparador. setStrength(Collator. TERTIARY); String tem1 =rs. getString("Usuario"); String tem2 =rs. getString("Contraseña"); if(rs.next()&&comparador.equals(user,tem1)&&comparador.equals(pass,tem2)){ inicio.setVisible(true); } else{ JOptionPane. showMessageDialog(rootPane, "Los datos son incorrectos"); } Logger.getLogger(Login.class.getName()).log(Level.SEVERE, null, ex); } } //if (user.equals()&&pass.equals()); } /** * @param args the command line arguments */ public static void main (String args []) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { if ("Nimbus".equals(info.getName())) { javax. swing. UIManager. setLookAndFeel(info. getClassName()); break; } } java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ public void run() { createAndShowGUI(); new Login().setVisible(true); } }); } // Variables declaration - do not modify private javax. swing. JButton jButton2 ; private javax. swing. JLabel jLabel1 ; private javax. swing. JLabel jLabel2 ; private javax. swing. JLabel jLabel3 ; // End of variables declaration }
A quien pueda ayudar, gracias por adelentado
|
|
|
3
|
Programación / Java / Problema con la conexión a la BD
|
en: 11 Octubre 2016, 00:32 am
|
Esta es la clase que contiene el codigo para la conexion con la base de datos package drone; import java.sql.*; import javax.swing.*; public class Conexion { public String db = "prototipo"; public String url = "jdbc:mysql://localhost/"+db ; public Conexion() { } { try{ Class.forName("com.mysql.jdbc.Driver"); link =DriverManager. getConnection(this. url, this. user, this. pass); if(link!=null){ JOptionPane. showMessageDialog(null, "conexion establecida"); } /*if(link!=null){ st=link.createStatement(); }*/ } { } return link; } }
Esta es la clase Login que contiene el llamado al metodo conectar() de la clase Conexion, aqui tambien se genera el evento de boton package drone; import java.awt.BorderLayout; import java.awt.Toolkit; import java.sql.*; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.JOptionPane; import java.lang.*; public class Login extends javax. swing. JFrame { public Login() { initComponents(); this. setSize(Toolkit. getDefaultToolkit(). getScreenSize()); PnlFondo fondo = new PnlFondo(); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code"> private void initComponents() { jButton1 = new javax. swing. JButton(); jLabel1 = new javax. swing. JLabel(); jLabel2 = new javax. swing. JLabel(); jLabel3 = new javax. swing. JLabel(); jButton2 = new javax. swing. JButton(); jButton1.setText("Registrarse"); jLabel1.setText("Iniciar Sesion"); jLabel2.setText("Usuario"); jLabel3.setText("Contraseña"); jButton2.setText("Aceptar"); public void actionPerformed (java. awt. event. ActionEvent evt ) { jButton2ActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() . addContainerGap(javax. swing. GroupLayout. DEFAULT_SIZE, Short. MAX_VALUE) .addComponent(jButton1) .addGap(46, 46, 46)) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(89, 89, 89) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel3) .addComponent(jLabel2)) .addGap(75, 75, 75) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) . addComponent(usuario, javax. swing. GroupLayout. DEFAULT_SIZE, 64, Short. MAX_VALUE) .addComponent(contraseña))) .addGroup(layout.createSequentialGroup() .addGap(163, 163, 163) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jButton2) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)))) . addContainerGap(116, Short. MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(20, 20, 20) .addComponent(jButton1) .addGap(33, 33, 33) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jLabel2) . addPreferredGap(javax. swing. LayoutStyle. ComponentPlacement. UNRELATED, 27, Short. MAX_VALUE) .addComponent(jLabel3) .addGap(159, 159, 159)) .addGroup(layout.createSequentialGroup() .addComponent(usuario, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(contraseña, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(29, 29, 29) .addComponent(jButton2) . addContainerGap(javax. swing. GroupLayout. DEFAULT_SIZE, Short. MAX_VALUE)))) ); pack(); }// </editor-fold> private void jButton2ActionPerformed (java. awt. event. ActionEvent evt ) { String user =usuario. getText(); String pass =contraseña. getText(); if ((user.length()==0)||(pass.length()==0)){ JOptionPane. showMessageDialog(rootPane, "Campo usuario o contraseña vacio"); }else{ Conexion mysql= new Conexion(); if(conn!=null){ JOptionPane. showMessageDialog(rootPane, "Conexion con base de datos"); } try { rs = sentencia.executeQuery("SELECT * FROM usuarios WHERE Usuario="+user+" && Contraseña="+pass+""); int encontrado=rs.getRow(); if(encontrado==1){ inicio.setVisible(true); } else{ JOptionPane. showMessageDialog(rootPane, "Los datos son incorrectos"); } Logger.getLogger(Login.class.getName()).log(Level.SEVERE, null, ex); } } //if (user.equals()&&pass.equals()); } /** * @param args the command line arguments */ public static void main (String args []) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { if ("Nimbus".equals(info.getName())) { javax. swing. UIManager. setLookAndFeel(info. getClassName()); break; } } java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ public void run() { new Login().setVisible(true); } }); } // Variables declaration - do not modify private javax. swing. JButton jButton1 ; private javax. swing. JButton jButton2 ; private javax. swing. JLabel jLabel1 ; private javax. swing. JLabel jLabel2 ; private javax. swing. JLabel jLabel3 ; // End of variables declaration }
Gracias por adelantado quien me pueda ayudar
|
|
|
4
|
Programación / PHP / Problema con codeigniter
|
en: 12 Agosto 2016, 20:59 pm
|
My proyecto local con Xampp 1.8.1 and codeigniter 3.0.6 me da error 404 Page not Found ` RewriteEngine On # !IMPORTANT! Set your RewriteBase here and don't forget trailing and leading # slashes. # If your page resides at # http://www.example.com/mypage/test1 # then use # RewriteBase /mypage/test1/ RewriteBase /codeigniter RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L] # If we don't have mod_rewrite installed, all 404's # can be sent to index.php, and everything works as normal. # Submitted by: ElliotHaughin ErrorDocument 404 /index.php ` $config['base_url'] = 'http://localhost/codeigniter'; $config['index_page'] = ''; $active_group = 'default'; $query_builder = TRUE; 'dsn' => '', 'hostname' => 'localhost', 'username' => 'root', 'password' => '', 'database' => 'sistemaderiego', 'dbdriver' => 'mysqli', 'dbprefix' => '', 'pconnect' => TRUE, 'db_debug' => (ENVIRONMENT !== 'production'), 'cache_on' => FALSE, 'cachedir' => '', 'char_set' => 'utf8', 'dbcollat' => 'utf8_general_ci', 'swap_pre' => '', 'encrypt' => FALSE, 'compress' => FALSE, 'stricton' => FALSE, 'save_queries' => TRUE ); $route['default_controller'] = 'Prueba';
Alguna ayuda?
|
|
|
5
|
Programación / PHP / echo no imprime
|
en: 25 Enero 2016, 16:54 pm
|
<html> <head><title>php con html</title><head> <body> <? php echo "Hola mundo!"; echo "Fin"; ?> </body> </html>
He probado en chrome, opera, mozilla y el resultado es el mismo: El titulo "php con html" aparece en el borde del navegador pero no se imprime "Hola mundo". La URL no es el problema de lo contrario el title no apareceria.
|
|
|
6
|
Programación / Java / Orientación acerca de proyecto en Java
|
en: 17 Junio 2015, 17:13 pm
|
Debo realizar un proyecto llamado: Sistema de riego automatizado por goteo cuya aplicación voy a desarrollar utilizando Java, Dicho proyecto es un sistema de control, he leído que un sistema de este tipo requiere el manejo de los puertos seriales. Buscando en Internet no he encontrado ningún paquete que contenga las clases para manipular los puertos seriales, Cualquier opinión es Bienvenida.
|
|
|
7
|
Programación / Programación C/C++ / Compilador se reinicia
|
en: 1 Junio 2015, 23:49 pm
|
Funciona bien exepto que durante la ejecucion si pasa mucho tiempo sin introducir datos el compilador se reinicia #include<stdio.h> #include<stdlib.h> #include<conio.h> void ingresar(); void calcular(); void imprimir(); static int plana=400, rollo=250; int tiempo=0,tipo=0,metros=0; char nombre[10], apellido[10]; int des=0; int main(){ ingresar(); calcular(); imprimir(); } void ingresar(){ printf(" \t\t\t***EMPRESA MAYA***"); printf(" \n\nIngrese Nombre:"); printf(" \n Ingrese Apellido:"); printf(" \n Ingrese tiempo de cliente:"); printf(" \n Seleccione el tipo de maya:"); do{ printf(" \n 2..Maya en Rollo"); }while((tipo!=1) && (tipo!=2)); printf(" \n Cantidad de metros:"); } void calcular(){ int costo=0; if(tiempo==5 && tipo==1){ costo=plana*metros; des=costo*0.08; } if(tiempo>=6 && tipo==1){ costo=plana*metros; des=costo*0.06; } if(tiempo==5 && tipo==2){ costo=rollo*metros; des=costo*0.08; } if(tiempo>=6 && tipo==2){ costo=rollo*metros; des=costo*0.06; } } void imprimir(){ printf(" \n\nDescuento cliente"); printf(" \n\nNombre: %s\tApellido: %s", nombre ,apellido ); printf(" \n El descuento es: %d BsF",des ); }
|
|
|
8
|
Programación / Programación C/C++ / Duda con un while
|
en: 1 Junio 2015, 18:20 pm
|
Necesito validar que la variable tipo solo tome como valor el 1 o 2, para esto utilize un do-while pero el ciclo se repetia una y otra vez, ahora utilizo while y pasa lo mismo, donde podria estar el error? #include<stdio.h> #include<stdlib.h> #include<conio.h> #include<string.h> void ingresar(); void calcular(); int valor=0,tiempo=0,tipo=0,metros=0; float costo=0; char nombre[10], apellido[10]; int main(){ ingresar(); calcular(); } void ingresar(){ printf(" \n Ingrese Apellido:"); printf(" \n Ingrese tiempo de cliente:"); printf(" \n Seleccione el tipo de maya:"); printf(" \n 2..Maya en Rollo"); while(tipo!=1 || tipo!=2){ printf(" \n 2..Maya en Rollo"); } printf(" \n Cantidad de metros:"); } void calcular(){ if(tiempo<6 && tipo==1){ costo=(400*(8/100))*metros; } if(tiempo<6 && tipo==2){ costo=(250*(8/100))*metros; } printf(" \n costo: %d",costo ); }
|
|
|
9
|
Programación / Java / Flash player y Java
|
en: 22 Marzo 2015, 16:32 pm
|
Voy a crear una app en java que estara conectado a un circuito, dicho circuito quiero simularlo utilizando flash player, es decir al activar acciones desde la app se ejecute en el circuito simulado. Existe alguna forma de hacer esto?
|
|
|
10
|
Programación / Java / Fallo en inicializar matriz
|
en: 5 Junio 2014, 16:57 pm
|
package matriz; import java.util.Scanner; public class Matriz { public static void main (String[] args ) { Scanner x = new Scanner (System. in); int m = 0,n = 0, i=0,j=0,a=0,b=0, c=0, d=0; int multi; int M[][] = new int[m][n]; int N[][] = new int[a][b]; System. out. println(" DIMENSIONES DE LA MATRIZ 1 "); System. out. println(" FILAS M[*][]: "); m = x.nextInt(); System. out. println(" COLUMNAS M[][*]: "); n = x.nextInt(); System. out. println(" LLENADO DE LA MATRIZ 1: "); for (i=0 ; i<m;i++){ for(j=0;j<n;j++){ System. out. print(" Valor ["+(i +1)+"]["+(j +1)+"]: "); M[i][j]= x.nextInt(); } } System. out. println(" DIMENSIONES DE LA MATRIZ 2 "); System. out. println(" FILAS M[*][]: "); a = x.nextInt(); System. out. println(" COLUMNAS M[][*]: "); b = x.nextInt(); System. out. println(" LLENADO DE LA MATRIZ 2: "); for (c=0 ; c<a;c++){ for(d=0;d<b;d++){ System. out. println(" Valor ["+(c +1)+"]["+(d +1)+"]: "); N[c][d]= x.nextInt(); } } multi =M[i][j] * N[c][d]; System. out. println(" Multiplicacion de las matrices: "+multi ); } }
En esta linea M [j]= x.nextInt(); Netbeans me muestra el siguiente mensaje: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 Valor [1][1]: at matriz.Matriz.main(Matriz.java:25) Java Result: 1
|
|
|
|
|
|
|