jueves, 21 de octubre de 2010

POR FIN UN EJEMPLO EN INTERNET

ASI ES........ ESTE ES EL UNICO EJEMPLO QUE ENCONTRARAN EN LA RED DE UNA CALCULADORA SENCILLA HECHA EN JAVASCRIPT PERO........ CON UNA LISTA!!!........
PASE VARIAS HORAS BUSCANDO UN EJEMPLO , PERO TODAS LAS QUE  ENCONTRE FUNCIONABAN CON BOTONES. POR ESO ME PUSE A SOLUCIONARLO Y ESTO ES LO QUE RESULTO ......

  • DOS CAMPOS DE TEXTO PARA EL INGRESO DE VALORES
  • LA LISTA CON LAS OPERACIONES
  • UN BOTON PARA BORRAR
  • Y EL CAMPO DONDE SE MUESTRA EL RESULTADO






EN ESTA IMAGEN SE PUEDEN VER LAS OPCIONES PARA SELECCIONAR LAS OPERACIONES BASICAS, CON SOLO SELECCIONARLA SE EJECUTA NO NECESITA UN BOTON.
BUENO ESO ES TODO NO HAY MAS EXPLICACION LES DEJO EL CODIGO PARA QUE LO ESTUDIEN NO ES MUY DIFICIL CUATRO FUNCIONES Y LISTO........




CODIGO HTML Y JAVASCRIPT






lunes, 4 de octubre de 2010

UNA MATRIZ EN JAVA CON SCANNER


ESTA ES UNA SENCILLA AYUDA PARA QUIEN QUIERA EN JAVA LLENAR Y MOSTAR UNA MATRIZ, ADEMAS UTILIZO UN SCANNER PARA LEER DESDE LA CONSOLA.
PUEDEN CORTAR Y PEGAR EN SU PACKAGE Y FUNCIONARA SIN PROBLEMAS.
public class Main {
    public static Scanner EN = new Scanner(System.in);
    public static int i,j;
    public static void main(String[] args) {
        int M, N;
        System.out.println("inserte la cantidad de filas");
        M = EN.nextInt();//CON SCANNER JAVA  LEEMOS
        System.out.println("inserte la cantidad de columnas");
        N = EN.nextInt();//CON SCANNER JAVA  LEEMOS

        System.out.println("inserte los datos");

        int mat[][] = new int[M][N];//DECLARAMOS E INICIALIZAMOS UNA MATRIZ EN JAVA

        llenar(mat);//LLAMAMOS AL METODO LLENAR Y LE PASAMOS UNA MATRIZ EN JAVA
System.out.println("La Matriz queda asi!!");

        mostrar(mat);//LLAMAMOS AL METODO MOSTRAR Y LE PASAMOS UNA MATRIZ
    } 
//EL METODO EN JAVA PARA LLENAR
    private static void llenar(int[][] mat) {
       for ( i = 0; i < mat.length; i++) {
            for ( j = 0; j < mat.length; j++) {
                mat[i][j] = EN.nextInt();//EL OBJETO DE TIPO SCANNER LEE
            }
        }
    }
//EL METODO EN JAVA PARA MOSTRAR
    private static void mostrar(int[][] mat) {
        for ( i = 0; i < mat.length; i++) {
            for ( j = 0; j < mat.length; j++) {
                System.out.print(mat[i][j] + " ");
            }
            System.out.println();
        }
    }   
}
LUEGO DE INGRESAR LAS CANTIDADES PARA FILA Y COLUMNA, PEDIRA LOS DATOS
DE LA MATRIZ A LLENAR , POR ULTIMO MOSTRARA EN ORDEN Y EN FORMATO DE MATRIZ.
LA SALIDA POR CONSOLA DEBERA SER ASI:

miércoles, 22 de septiembre de 2010

EJERCICIO DE PROGRAMACION III

AQUI LES DEJO EL MAIN EL EJERCICIO DE PROGRAMACION III
OBVIO QUE USTEDES HABRAN HECHO LOS MODELOS
ESTO ES SOLO PARA GUIA.
package ormjpa;

import controlador.GestorPersona;
import java.util.ArrayList;
import java.util.List;
import modelo.Articulo;
import modelo.Direccion;
import modelo.Cliente;
import modelo.Factura;
import modelo.FacturaDetalle;
import modelo.TipoArticulo;

/**
 *
 * @author guillermo garcia huidobro
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
       
        try {
            GestorPersona gp = new GestorPersona();

            TipoArticulo f = new TipoArticulo();
            Articulo g = new Articulo();
            FacturaDetalle h = new FacturaDetalle();
            Listlistafdetalle = new ArrayList();

            Cliente p = new Cliente();
            Direccion d = new Direccion();                                                                      
            Factura a = new Factura();
            List listafactura = new ArrayList();

            //set cliente
            p.setNombre("guillermo");
            p.setApellido("garcia");
            p.setCuil("92814690");
            //set direccion
            d.setNombrecalle("reta");
            d.setNumero(45);
            //set factura
            a.setTotal("1000");
            a.setNoFactura("1235");
            a.setFecha("17/25/65");
            //guardo en factura
            listafactura.add(a);

            //guardo en direccion
           p.setDireccion(d);
            //guardo en factura
            p.setListaFactura(listafactura);

           
            f.setDenominacion("procesador");//tipoarticulo
            g.setDenominacion("doble nucleo");//articulo
            g.setPrecio("$250");//articulo
            g.setTipoarticulo(f);//guardo un tipoarticulo
            h.setCantidad("10");//facturadetalle
            h.setSubtotal("$2500");//facturadetalle
            h.setArticulo(g);//guardo un articulo
            h.setFactura(a);//guardo una factura
            listafdetalle.add(h);//guardo un facturadetalle
                      
            gp.guardar(p);
            gp.guardar(h);
                        
        } catch (Exception e) {
            e.printStackTrace();
        }      
    }
}

viernes, 30 de julio de 2010

EJEMPLO DE ARRAYLIST

Creamos una clase con sus atributos privados
public class Producto{
private String nombre;
private int cantidad;
Cada uno con sus get and set
      private void setnombre (String nom){
            nombre=nom;
      }
     private void setnombre (int cant){
            cantidad=cant;

      }
     private String getnombre(){
            return nombre;
     }
      private String getnombre(){
            return nombre;
                                                                           }
Creamos los constructores el vacio y el sobrecargado
     public Producto{
     }
      public Producto(String nom,int cant){
              nombre=nom;
              canidad=cant;
     }
  }

En el Main hacemos lo siguiente

public class Main{                                          
     public void class main(String[] args){
Creamos 2 instancias de la clase Producto         
     Producto a = new Producto ("disco duro", 33256);
     Producto b = new Producto ("cable sata", 11656);
Creamos un ArrayList
      ArrayList lista = new ArrayList();
Insertamos los objetos
      lista.add(a);
      lista.add(b);
Creamos un metodo para mostrar
     mostrar(lista);


     }
Metodo para mostrar el ArrayList
      private void mostrar(List lista){
           for(iterator it = lista.iterator().hasNext()){
           Producto x = (Producto)it.Next();
           sout(x.getName+":"+x.getcantidad);
          }
      }

viernes, 9 de julio de 2010

QUE ES .NET?

DESCARGAR
.NET podría considerarse una respuesta de Microsoft al creciente mercado de los negocios en entornos Web, como competencia a la plataforma Java de Sun Microsystems y a los diversos framework de desarrollo web basados en PHP.

Su propuesta es ofrecer una manera rápida y económica, a la vez que segura y robusta, de desarrollar aplicaciones –o como la misma plataforma las denomina, soluciones– permitiendo una integración más rápida y ágil entre empresas y un acceso más simple y universal a todo tipo de información desde cualquier tipo de dispositivo.
La plataforma .NET de Microsoft es un componente de software que puede ser añadido al sistema operativo Windows. Provee un extenso conjunto de soluciones predefinidas para necesidades generales de la programación de aplicaciones, y administra la ejecución de los programas escritos específicamente con la plataforma. Esta solución es el producto principal en la oferta de Microsoft, y pretende ser utilizada por la mayoría de las aplicaciones creadas para la plataforma Windows.

.NET Framework se incluye en Windows Server 2008, Windows Vista y Windows 7. De igual manera, la versión actual de dicho componente puede ser instalada en Windows XP, y en la familia de sistemas operativos Windows Server 2003. Una versión "reducida" de .NET Framework está disponible para la plataforma Windows Mobile, incluyendo teléfonos inteligentes.
.NET Framework 3.5 agrega de forma incremental las nuevas características de .NET Framework 3.0. Por ejemplo, los conjuntos de características de Windows Workflow Foundation (WF), Windows Communication Foundation (WCF), Windows Presentation Foundation (WPF) y Windows CardSpace. Además, .NET Framework 3.5 contiene una serie de características nuevas en distintas áreas tecnológicas que se han agregado como nuevos ensamblados para evitar cambios destacados. Algunas de estas características son:

  • Integración total de LINQ (Language Integrated Query) y del reconocimiento de los datos. Esta nueva característica le permitirá escribir código en idiomas habilitados para LINQ para filtrar, enumerar y crear proyecciones de varios tipos de datos SQL, colecciones, XML y conjuntos de datos usando la misma sintaxis.
  • ASP.NET AJAX le permite crear experiencias web más eficaces, más interactivas y con un gran índice de personalización que funcionan con los exploradores más usados.
  • Nueva compatibilidad con el protocolo web para generar servicios WCF, como por ejemplo AJAX, JSON, REST, POX, RSS, ATOM y distintos estándares WS-* nuevos.
  • Compatibilidad total con las herramientas de Visual Studio 2008 para WF, WCF y WPF, incluida la nueva tecnología de servicios habilitados para flujos de trabajo.
  • Nuevas clases en la biblioteca de clases base (BCL) de .NET Framework 3.5 que tratan numerosas solicitudes de cliente comunes.

COMO PODEMOS OBSERVAR HAY QUE INVESTIGAR Y ESTUDIAR MUCHO SI QUEREMOS ESTAR A LA ALTURA DE UN BUEN DESARROLLO, NO NOS PODEMOS QUEDAR CON UN PAR DE ARQUITECTURAS SOLAMENTE,  ESTO ES SOLO UNA INTRODUCCION YA MAS ADELANTE PREPARAREMOS UN PAR DE EJEMPLOS SENCILLOS EN LAS DISTINTAS APLICACIONES DEL PAQUETE.
Y SI SE ANIMAN A DARLE DE LLENO LES DEJO EL ENLACE DE DESCARGA!!

OJO CON SILVERLIGHT QUE TAMBIEN ES UNA BUENA HERRAMIENTA!!!
EN OTRO BLOG HABLO DE SUN Y SU JAVAFX.................. 

/*===============medicion============================*/