Login
...or Sign up
Home
Search
Search Code Snippets
Search People
Code Snippets of
josino
class Complejo { public double real; public double imag; public Complejo(double re ,double im) { this.real=re; this.imag=im; } public Complejo Add(Complejo z) { return new Complejo(this.real + z.real , this.imag + z.imag); } } class hilo extends Thread { public hilo(Complejo n1,Complejo n2) { } public void run() { Complejo a = new Complejo(40,56); Complejo b = new Complejo(10,-10); Complejo c = a.Add(b); System.out.println("Parte real: " + c.real); System.out.println("Parte imaginaria: " + c.imag); } }
Hilo sumador
Uploaded on
8/6/2008 12:09:19 PM
0 comments
Programming Language:
java
hilo de ejecución
suma complejos
import java.net.*; public class DireccionesIP { public static void main(String[] args) { byte[] b; try{ //Si se pasa un argumento obtenemos la direccion IP if (args.length > 0){ String host_remoto = args[0]; InetAddress address = InetAddress.getByName(host_remoto); String IP_remota = address.getHostAddress(); System.out.println("Direccion IP de la maquina remota : " + IP_remota); } //Si no obtenemos la direccion IP de la maquina local else{ InetAddress direccion = InetAddress.getLocalHost(); String nombreDelHost = direccion.getHostName();//nombre host String IP_local = direccion.getHostAddress();//ip como String System.out.println("La IP de la maquina local es : " + IP_local); System.out.println("El nombre del host local es : " + nombreDelHost); } } catch(Exception e) { e.printStackTrace(); } } }
Obtención de la dirección IP de un host de la red local
Uploaded on
8/6/2008 12:00:25 PM
1 comment
Programming Language:
java
dirección IP
datobin xdata 30h uni_dec xdata 31h tcoche data 30h coches_hechos data 20h coches_teoricos data 21h panelt equ p0 panelh equ p2 org 0h jmp inicio org 03h jmp menu org 0bh jmp contarhechos org 013h jmp tiempo org 01bh jmp calcular_deberia org 100h inicio: mov ie,#8fh mov tmod,#17h mov tcon,#1h mov th0,#-1 mov tl0,#-1 call inic_v setb tr0 jmp $ bin2bcd: push acc mov dptr,#30h movx a,@dptr mov b,#10 div ab swap a add a,b mov dptr,#31h movx @dptr,a pop acc ret inic_v: mov coches_hechos,#00h mov coches_teoricos,#00h mov tcoche,#1 ret contarhechos: clr tr0 inc coches_hechos mov a,coches_hechos mov dptr,#30h movx @dptr,a call bin2bcd mov dptr,#31h movx a,@dptr mov a,panelh reti menu: call inic_v mov ip,#04h mov ie,#8eh jb p3.2,$ jnb p3.2,$ mov ie,#8fh mov ip,#0h mov r2,#tcoche mov r1,#60 mov r0,#100 mov th1,#high(-10000) mov tl1,#low(-10000) setb tr1 reti tiempo: mov r5,tcoche cjne r5,#10,sal mov r5,#1 jmp sal sal: inc r5 mov tcoche,r5 reti calcular_deberia: clr tr1 djnz r0,sal1 mov r0,#100 mov th1,#high(-10000) mov tl1,#low(-10000) djnz r1,sal1 mov r1,#60 mov r0,#100 mov th1,#high(-10000) mov tl1,#low(-10000) mov r4,tcoche djnz r4,sal1 inc coches_teoricos mov a,coches_teoricos mov dptr,#30h movx @dptr,a call bin2bcd mov dptr,#31h movx a,@dptr mov a,panelt mov r4,tcoche mov r1,#60 mov r0,#100 mov th1,#high(-10000) mov tl1,#low(-10000) sal1: setb tr1 reti end
Cálculo y visualización del número de coches que se fabrican en una empresa automovilística
Uploaded on
7/26/2008 11:07:57 AM
0 comments
Programming Language:
microcontrolador 8051
contador de coches producidos
practica 5 sdp1 telecomunicaciones uvigo
min data 20h seg data 21h v_min equ p1 v_seg equ p0 minu xdata 30h segu xdata 31h org 0 jmp inicio org 03h jmp ext0 org 0bh jmp temp0 org 013h jmp ext1 org 100h inicio: mov ie,#87h mov tmod,#2 mov ip,#2 mov th0,#-100 mov tl0,#-100 mov r0,#10 mov r1,#10 mov r2,#60 jmp $ ext0: setb tr0 mov min,#00h mov seg,#00h call visu_seg call visu_min reti ext1: clr tr0 call visu_seg mov a,min mov dptr,#30h movx @dptr,a call visu_min mov a,v_seg mov dptr,#31h movx @dptr,a mov v_min,#0ffh mov v_seg,#0ffh reti temp0: clr tr0 djnz r0,sal mov r0,#10 djnz r1,sal mov r0,#10 mov r1,#10 inc seg call visu_seg call visu_min djnz r2,sal mov r0,#10 mov r1,#10 mov r2,#60 inc min mov seg,#00h call visu_seg call visu_min sal: setb tr0 reti visu_seg: mov a,seg call bin2bcd mov v_seg,a ret visu_min: mov a,min call bin2bcd mov v_min,a ret bin2bcd: mov b,#10 div ab swap a add a,b ret end
Contador de tiempo de un teléfono móvil.
Uploaded on
7/26/2008 10:56:41 AM
0 comments
Programming Language:
microcontrolador 8051
8051
contador de duración de una llamada
practica 4 sdp1 telecomunicaciones uvigo
pul0 bit p2.0 pul1 bit p2.1 visu EQU p0 dato0 DATA 20h dato1 DATA 21h dato2 DATA 22h dato3 DATA 23h oper DATA 24h org 0h jmp inicio org 100h inicio: jb pul0,$ call lee_dt0 jnb pul0,$ jb pul0,$ call lee_dt1 jnb pul0,$ jb pul0,$ call lee_dt2 jnb pul0,$ jb pul0,$ call lee_dt3 jnb pul0,$ jb pul1,$ call op call bin2bcd call visual jmp inicio op: jb p1.5,md jb p1.4,r jnb p1.4,s md: jb p1.4,d call mult ret d: call divi ret s: call suma ret r: call resta ret suma: mov a,dato1 add a,dato3 ret resta: mov a,dato1 subb a,dato3 ret divi: mov a,dato1 mov b,dato3 div ab ret mult: mov a,dato3 mov b,dato1 mul ab ret visual: mov visu,a ret lee_dt0: mov dato0,p1 anl dato0,#0Fh ret lee_dt1: mov dato1,p1 anl dato1,#0Fh mov a,dato1 swap a mov dato1,a mov a,dato0 orl dato1,a ret lee_dt2: mov dato2,p1 anl dato2,#0Fh ret lee_dt3: mov dato3,p1 anl dato3,#0Fh mov a,dato3 swap a mov dato3,a mov a,dato2 orl dato3,a ret bin2bcd: mov b,#10 div ab swap a add a,b ret end
Diseño de una calculadora básica.
Uploaded on
7/22/2008 3:39:14 PM
0 comments
Programming Language:
microcontrolador 8051
calculadora en micro 8051
practica 2 sdp1 telecomunicaciones uvigo
1
2
3
4
...
Help
Help by email
What is Naslu?
|
About Naslu
|
Contact
|
Terms of Use
|
Downloads
|
Blog
|
Top
Select language:
Español
|
English
© 2007 naslu.com