PREGUNTAS POR CONTESTAR - Otros Lenguajes

 Hay un total de 266 Preguntas.<<  >> 

    Pregunta:  67520 - AYUDA
Autor:  juan
que puedo tener malo ayuda en condicional nececito que este programa calcule velocidad y distancia y no se como

public class programa extends javax.swing.JFrame {
double x;//variable de posicion
double v;//variable de velocidad
double xo;//variable de posicion inicial
double vo;//variable de velocidad inicial
double t;//variable de tiempo
double a;//variable de aceleracion
double resultado;//variable de resultado
/**
* Creates new form programa
*/
public programa() {
initComponents();
}

/**
* 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() {

jInternalFrame1 = new javax.swing.JInternalFrame();
jLabel1 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
x = new javax.swing.JTextField();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
v = new javax.swing.JTextField();
a = new javax.swing.JTextField();
vo = new javax.swing.JTextField();
xo = new javax.swing.JTextField();
t = new javax.swing.JTextField();
jButton2 = new javax.swing.JButton();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

jInternalFrame1.setVisible(true);

jLabel1.setText("x");

jButton1.setText("calcular x");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});

x.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
xActionPerformed(evt);
}
});

jLabel2.setText("v");

jLabel3.setText("a");

jLabel4.setText("xo");

jLabel5.setText("vo");

jLabel6.setText("t");

v.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
vActionPerformed(evt);
}
});

a.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
aActionPerformed(evt);
}
});

vo.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
voActionPerformed(evt);
}
});

xo.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
xoActionPerformed(evt);
}
});

t.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
tActionPerformed(evt);
}
});

jButton2.setText("calcular v");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});

javax.swing.GroupLayout jInternalFrame1Layout = new javax.swing.GroupLayout(jInternalFrame1.getContentPane());
jInternalFrame1.getContentPane().setLayout(jInternalFrame1Layout);
jInternalFrame1Layout.setHorizontalGroup(
jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jInternalFrame1Layout.createSequentialGroup()
.addGap(22, 22, 22)
.addGroup(jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jInternalFrame1Layout.createSequentialGroup()
.addGroup(jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1)
.addComponent(jLabel2)
.addComponent(jLabel3))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(v, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(x, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(a, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel5, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel4, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel6, javax.swing.GroupLayout.Alignment.TRAILING))
.addGap(18, 18, 18)
.addGroup(jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(vo, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(t, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(xo, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(31, 31, 31))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jInternalFrame1Layout.createSequentialGroup()
.addComponent(jButton1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 28, Short.MAX_VALUE)
.addComponent(jButton2)
.addContainerGap())))
);
jInternalFrame1Layout.setVerticalGroup(
jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jInternalFrame1Layout.createSequentialGroup()
.addGap(29, 29, 29)
.addGroup(jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(jLabel4)
.addComponent(x, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(xo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(26, 26, 26)
.addGroup(jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(jLabel5)
.addComponent(v, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(vo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(30, 30, 30)
.addGroup(jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(jLabel6)
.addComponent(a, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(t, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(26, 26, 26)
.addGroup(jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton1)
.addComponent(jButton2))
.addContainerGap(52, Short.MAX_VALUE))
);

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(94, 94, 94)
.addComponent(jInternalFrame1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(96, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jInternalFrame1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(14, Short.MAX_VALUE))
);

pack();
}// </editor-fold>

private void vActionPerformed(java.awt.event.ActionEvent evt) {
v=(Double.parseDouble(String.valueOf(v.getText())));// capta informacion y combierte a texto y luego combierte a decimal


// TODO add your handling code here:
}

private void xActionPerformed(java.awt.event.ActionEvent evt) {
x=(Double.parseDouble(String.valueOf(x.getText())));// capta informacion y combierte a texto y luego combierte a decimal



// TODO add your handling code here:
}

private void xoActionPerformed(java.awt.event.ActionEvent evt) {
xo=(Double.parseDouble(String.valueOf(xo.getText())));// capta informacion y combierte a texto y luego combierte a decimal


// TODO add your handling code here:
}

private void voActionPerformed(java.awt.event.ActionEvent evt) {
vo=(Double.parseDouble(String.valueOf(vo.getText())));// capta informacion y combierte a texto y luego combierte a decimal


// TODO add your handling code here:
}

private void aActionPerformed(java.awt.event.ActionEvent evt) {
a=(Double.parseDouble(String.valueOf(a.getText())));// capta informacion y combierte a texto y luego combierte a decimal


// TODO add your handling code here:
}

private void tActionPerformed(java.awt.event.ActionEvent evt) {
t=(Double.parseDouble(String.valueOf(t.getText())));// capta informacion y combierte a texto y luego combierte a decimal


// TODO add your handling code here:
}

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
String pantalla1=this x.getText();


resultado nueva=new resultado(); //aqui creas el objeto
nueva.setVisible(true); // con setEnabled haces visible la ventana


// TODO add your handling code here:
}

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
resultado nueva=new resultado(); //aqui creas el objeto
nueva.setVisible(true); // con setEnabled haces visible la ventana
Contestar

    Pregunta:  67522 - SINCRONIZAR BD SQLITE EN MOVIL ANDROID CON UNA MYSQL REMOTA
Autor:  jose lobo
Hola a todos,
necesito ayuda para sincronizar datos desde sqlite a mysql, me explico.
suponiendo que tengo una aplicación corriendo en un android y que esta
aplicación almacene los datos correspondiente en sqlite y mediante
alguna opción que envíe los datos recopilado en sqlite a mysql que se
encuentra en un servidor dedicado.
Contestar

    Pregunta:  67546 - MOSTRAR EN UN AXIS LO QUE VE LA WEBCAM
Autor:  David Garcia Blázquez
Hola buenas a todos:
Mi pregunta es sencilla, ¿como puedo mostrar en un axis lo que la webcam ve en el momento de activar un botón?
Lo que me ocurre es que en vez de representármelo en un axis me lo representa en una ventana figure.

Gracias por vuestra atención.
Contestar

    Pregunta:  67617 - XML EN INFORMIX 4GL
Autor:  Armando cortez
Hola, haber si alguien con conocimiento en informix 4gl me pudiera apoyar, existe una tabla donde se almacena en un campo text, un archivo xml, me gustaria saber si hay alguna forma de extraer el archivo y hacer una busqueda en alguno de sus nodos. pero sin barrer el archivo como si fuera texto, si no por alguna rutina o algo ya existente en informix para el manejo de xml. gracias
Contestar

    Pregunta:  67618 - ZPL II
Autor:  emmanuel rosas bautista
ALGUIEN SABE COMO PUEDO PROGRAMAR EN LENGUAJE ZPL II Y CARGARLO A LA IMPRESORA, EN EL PROGRAMA ZBI DEVELOPER ES PARA EL DISEÑO DE UNA ETIQUETA
SI TIENEN ALGUN EJEMPLO SERIA DE MUCHA AYUDA
Contestar

    Pregunta:  67648 - AYUDA CONORDENAMIENTOS MENUS Y FUNCIONES
Autor:  Laura Vazval
Hola espero y me ayuden a corregir mi programa,
No se por que me marca error con algunas variables,
Tambien lo necesito pasar a menus pero no se como...
Ayuda , si me podrian decir en que estoy mal.....

#include <conio.h>
#include <stdio.h>
#define N 100

void entradaLista (int a[], int n);
void ordIntercambio (int a[], int n);
void ordSeleccion (int a[], int n);
void ordInsercion (int a[], int n);
void ordBurbuja (int a[], int n);
void ordenacionShell(int a[], int n);

int busquedaBin(int lista[], int n, int clave);
int Secuencial ( int x, int lista[], int n );
void imprimirLista (int a[], int n);

main()
{
int a[N], n = 0;
printf(" Cuantos elementos deseas leer: ");
scanf("%d", & n);

entradaLista (a, n);
printf(" Los elementos desordenados del vector son: ");
imprimirLista (a, n);
//ordIntercambio (a, n);
//ordSeleccion (a, n);
//ordInsercion (a, n);
ordBurbuja (a, n);
ordenacionShell(a, n);

busquedaBin(lista, n, clave);
Secuencial (x, lista, n );
printf(" Los elementos con ordenamiento por INTERCAMBIO son: ");
imprimirLista (a, n);
getch();
}

void entradaLista (int a[], int n)
{
int i;
for (i = 0; i < n; i++)
{
printf(" Dame un elemento para el vector: ");
scanf("%d", & a[i]);
}
return;
}

void ordIntercambio (int a[], int n)
{
int i = 0, j = 0, aux = 0;
/* se realizan n-1 pasadas */
/* a[o], ... , a[n-2] */
for (i = 0 ; i <= n-2 ; i++)
/* coloca mínimo de a[i+1]...a[n-1] en a[i] */
for (j = i+1 ; j <= n-1 ; j++)
if (a[i] > a[j])
{
aux;
aux = a[i];
a[i] = a[j];
a[j]= aux ;
}
}

void ordSeleccion (int a[], int n)
{
int indiceMenor = 0, i = 0, j = 0, aux = 0;
/* ordenar a[0]..a[n-2] y a[n-1] en cada pasada */
for (i = 0; i < (n-1); i++)
{
/* comienzo de la exploración en índice i */
indiceMenor = i;
/* j explora la sublista a[i+1]..a[n-1] */
for (j = i+1; j < n; j++)
if (a[j] < a[indiceMenor])
indiceMenor = j;
/* sitúa el elemento más pequeño en a[i] */
if (i != indiceMenor)
{
aux = a[i];
a[i] = a[indiceMenor];
a[indiceMenor] = aux ;
}
}
}

void ordInsercion (int a[], int n)
{
int i, j;
int aux;
for (i = 1; i < n; i++)
{
/* índice j explora la sublista a[i-1]..a[0] buscando la posición correcta del elemento destino, lo asigna a a[j] */
j = i;
aux = a[i];
/* se localiza el punto de inserción explorando hacia abajo */
while (j > 0 && aux < a[j-1])
{
/* desplazar elementos hacia arriba para hacer espacio */
a[j] = a[j-1];
j--;
}
a[j] = aux;
}
}

void ordBurbuja (int a[], int n)
{
int interruptor = 1, pasada = 0, j = 0, aux = 0;

for (pasada = 0; pasada < n-1 && interruptor; pasada++)
{
/* bucle externo controla la cantidad de pasadas */
interruptor = 0;
for (j = 0; j < n-pasada-1; j++)
if (a[j] > a[j+1])
{
/* elementos desordenados, es necesario intercambio */
interruptor = 1;
aux = a[j];
a[j] = a[j+1];
a[j+1] = aux;
}
}
}

void ordenacionShell(int a[], int n)
{
int intervalo = 0, i = 0, j = 0, k = 0, aux = 0;
intervalo = n / 2;
while (intervalo > 0)
{
for (i = intervalo; i < n; i++)
{
j = i - intervalo;
while (j >= 0)
{
k = j + intervalo;
if (a[j] <= a[k])
j = -1; /* así termina el bucle, par ordenado */
else
{
aux = a[j];
a[j] = a[k];
a[k] = aux;
j -= intervalo;
}
}
}
intervalo = intervalo / 2;
}
}



/*
búsqueda binaria.
devuelve el índice del elemento buscado, o bien -1 caso de fallo
*/
int busquedaBin(int lista[], int n, int clave)
{
int central, bajo, alto;
int valorCentral;
bajo = 0;
alto = n-1;
while (bajo <= alto)
{
central = (bajo + alto)/2; /* índice de elemento central */
valorCentral = lista[central]; /* valor del índice central */
if (clave == valorCentral)
return central; /* encontrado, devuelve posición */
else
if (clave < valorCentral)
alto = central -1; /* ir a sublista inferior */
else
bajo = central + 1; /* ir a sublista superior */
}
return -1; /* elemento no encontrado */
}

int Secuencial ( int x, int lista[], int n )
{
int j=0;
for( j=0; j < n; j++ )
if( x = = vect[j] )
return j;
return (-1);
}

void imprimirLista (int a[], int n)
{
int i;
for (i = 0; i < n; i++)
printf("%d ", a[i]);
return;
}
Contestar

    Pregunta:  67649 - AYUDA CON REPRODUCTOR DE VIDEO
Autor:  Marcello sanchez
hola que tal,

quisiera que alguien me ayude a que me de el código HTML de este reproductor de esta pagina, para poder insertarlo en mi web

pagina:

http://www.malosotv.com/2011/08/ver-fox-channel-en-vivo-gratis.html

gracias
Contestar

    Pregunta:  67650 - PROGRAMACIÓN LOGIC CLASS
Autor:  Cesar Riera
Buenas,

Estoy haciendo modificaciones sobre el programa de gestión SAGE MURANO y me encuentro con problemas a la hora de usar una de sus instrucciones. Se trata del comando:

Ret = Procesa("LogicControlGener2P.GenFunctions","GenerarParte",....

Siempre me indica un error de sintaxi, y no parece una falta de parámetros. En la ayuda del propio programa te indica muy bien lo que va en cada campo, pero ni aun asi me libro del error. La programación algo se parece al Visual Basic, pero esta instruccion es propia de ellos y no consigo usarla.

Algun comentario?

Gracias.

Cesar.
Contestar

    Pregunta:  67656 - ERRORES AL COMPILAR CODIGO FORTRAN EN UNIX
Autor:  Katteryne Villarroel
Hola estoy tratando de compilar el programa zplot en una maquina sun con solaris 9 al tratar de hacerlo me aparecen los siguientes errores:

f77 -O -c -O main.f
main.f: In program `main':
main.f:276:
write(*,*, fmt="(/
^
Invalid form for WRITE statement at (^)
main.f:288:
write(*,*, fmt="(/'*** npick > npickw ***'/)")
^
Invalid form for WRITE statement at (^)
main.f:507:
write(*,*, fmt="
^
Invalid form for WRITE statement at (^)
main.f:736:
write(*,*, fmt="(/
^
Invalid form for WRITE statement at (^)
main.f:744:
write(*,*, fmt="
^
Invalid form for WRITE statement at (^)
main.f:923:
write(*,*, fmt="(/'sf = ',e12.5,
^
Invalid form for WRITE statement at (^)
main.f:1216: warning:
+ 'enter parameter number to change value (0 if done) : '$)
^
Missing comma in FORMAT statement at (^)
main.f:1256: warning:
+ 'enter new parameter value: '$)
^
Missing comma in FORMAT statement at (^)
main.f:1262: warning:
+ 'enter new title: '$)
^
Missing comma in FORMAT statement at (^)
main.f:1271: warning:
+ 'enter new parameter values: '$)
^
Missing comma in FORMAT statement at (^)
main.f:1270:
+ 'current parameter values: ',<npick>i4/
^
Variable-expression FORMAT specifier at (^) -- unsupported
main.f:1277: warning:
+ 'enter new parameter values: '$)
^
Missing comma in FORMAT statement at (^)
main.f:1379:
+'pick times: ',<npick>f9.3/
^
Variable-expression FORMAT specifier at (^) -- unsupported
main.f:1380:
+'reduced pick times: ',<npick>f9.3/)
^
Variable-expression FORMAT specifier at (^) -- unsupported
main.f:2227:
write(*,*, fmt="
^
Invalid form for WRITE statement at (^)
main.f:2250:
if(iscreen.eq.1) write(*,*, fmt="(' ')")
^
Invalid form for WRITE statement at (^)
main.f:2287:
if(iroute.eq.1) write(*,*, fmt="(/
^
Invalid form for WRITE statement at (^)
make: *** [main.o] Error 1

PD: Como no se de fortran quisiera saber si es que hace falta alguna libreria o hay que modificar algo en el codigo. Por fa cualquier ayuda se los agradeceria mucho..
Contestar

    Pregunta:  67673 - COMO CONVERTIR LA LETRA Ñ EN UN FILE TRANSFER DE AS400
Autor:  José De Jesus
Hola a todos,

Estoy trabajando en un equipo AS/400 V5R4, al enviar un archivo de texto via file transfer de Client Access a una tabla del AS/400, la letra Ñ la deja como un caracter raro y no lo conserva.

Hay manera de que respete la Ñ a la hora de enviar la información¿?

Gracias anticipadas de su ayuda!

Saludos,
José De Jesús.
Contestar

|<  <<  15 16 17 18 19 20 21 22 23 24 25  >>  >|