Posts

Showing posts with the label Coding

JAVA: Program to check working of OPERATORS

Programming languages typically support a set of operators: constructs which behave generally like functions, but which differ syntactically or semantically from usual functions. Common simple examples include arithmetic (addition with +), comparison (with >), and logical operations (such as AND or &&). More involved examples include assignment (usually = or :=), field access in a record or object (usually .), and the scope resolution operator (often ::). Languages usually define a set of built-in operators, and in some cases allow user-defined operators. ref. google Click to download

JAVA: Program to check if a string is a PALINDROME

Palindrome:- a word, phrase, or sequence that reads the same backward as forward, e.g.,  madam  or  nurses run. Click to Download

JAVA: Program to reverse a String by words

Input:-  The quick brown fox jumped over the lazy dog! Output:-  dog! lazy the over jumped fox brown quick The Click to Download

JAVA: Program to remove comments from String

IP:- //this is a comment OP:- this is a comment Click to Download

JAVA: program to calculate Factorial

the product of an integer and all the integers below it; e.g., factorial four ( 4! ) is equal to 24. Click to Download

JAVA: Program to print FIBONACCI Sequence

a series of numbers in which each number ( Fibonacci number ) is the sum of the two preceding numbers. The simplest is the series 1, 1, 2, 3, 5, 8, etc. ref.google Click to Download

How to transfer and received file beagle bone to FTP server in fedora

 How to transfer and received file beagle bone to FTP server in        fedora Server Side: Step 1:In vsftpd.conf file (/etc/vsftpd/vsftpd.conf) editthis lines.  anon_other_write_enable=YES dirmessage_enable=YES dirlist_enable=YES no_anon_password=YES file_open_mode=0777 guest_enable=YES anon_upload_enable=YES Step 2 : start service vsftpd (service vsftpd start) Step 3: stop firewall (systemctl stop firewalld.service) step 4: mount --bind /default directory/ /var/ftp Client side:  Step 1: stop firewall service from ftplib import FTP import os flag = True while(flag):         os.system("ifconfig eth0 192.168.5.2")         ftps = FTP('172.16.1.176')         ftps.login('apcoer','12345678')         print "Select an option for transfering files:\n1.Machine to BBB\n2. BB...

How to connect beaglebone

Image
1) [apcoer@localhost-localdomain ~]$ ssh root@192.168.7.2 The authenticity of host '192.168.7.2 (192.168.7.2)' can't be established. ECDSA key fingerprint is c0:81:1a:f4:58:b9:51:15:00:df:ee:71:c4:d9:fd:54. Are you sure you want to continue connecting (yes/no)? y Please type 'yes' or 'no': y Please type 'yes' or 'no': yes Warning: Permanently added '192.168.7.2' (ECDSA) to the list of known hosts. Debian GNU/Linux 7 BeagleBoard.org BeagleBone Debian Image 2014-04-23 Support/FAQ: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian Last login: Wed Apr 23 20:27:40 2014 from 192.168.7.1 root@beaglebone:~# vnc -bash: vnc: command not found root@beaglebone:~# vncserver New 'X' desktop is beaglebone:1 Starting applications specified in /root/.vnc/xstartup Log file is /root/.vnc/beaglebone:1.log root@beaglebone:~# 2) open remote desktop

MITL: Assignment-1

section .data tname db "tnx for using code from parazhar.blogspot.com",10 lname equ $-tname tcnt db "how many numbers do you wanna add? :-" lcnt equ $-tcnt tnum db "Enter number:-" lnum equ $-tnum tsum db "the addition of numbers is:-" lsum equ $-tsum ;________________________________________________________________________ section .bss numcnt resb 2 number resb 17 sum resq 1 ;reserve quadword for storing 64 bit result %macro write 2 mov rax,1 mov rdi,1 mov rsi,%1 mov rdx,%2 syscall %endmacro %macro read 2 mov rax,0 mov rdi,0 mov rsi,%1 mov rdx,%2 syscall %endmacro ;________________________________________________________________________ section .text global _start: _start: write tname,lname ;displays name write tcnt,lcnt ;disp enter count read numcnt,2 ;accepts numcnt mov qword[sum],0 ;initialize val of sum to 0 ;____________________________________________________________________ ;nu...

MA: (hello world alike) 64-bit

section .data:     input:db'Parashar',10     inputLen: equ $-input section .text     global _start     _start:         mov rax,1     mov rdi,1     mov rsi,input     mov rdx,inputLen     syscall     mov rax,60                ; The system call for exit (sys_exit)      mov rbx,0                ; Exit with return code of 0 (no error)      syscall   [apcoer@localhost ~]$ nasm -f elf64 parashar.asm [apcoer@localhost ~]$ ld -o parashar parashar.o [apcoer@localhost ~]$ ./parashar Parashar

MA: hello world(32 bit)

section .data     hello:db'Hello World',10     hellolen:equ $-hello section .text     global _start     _start:     mov eax,4;     mov ebx,1;     mov ecx,hello     mov edx,hellolen;     int 80h     mov     ebx,0               ;first syscall argument: exit code        mov     eax,1               ;system call number (sys_exit)         int     80h                ;call kernel [apcoer@localhost ~]$ nasm -f elf64 hellwrld.asm [apcoer@localhost ~]$ ld -o hellwrld hellwrld.o [apcoer@localhost ~]$ ./h...

MA: addition of 2 numbers

section .data     input:db 'enter the number',10   ;        inputLen:  equ $-input           ;                                   ;     display:db 'entered number is:',10   ;        displayLen:  equ $-display       ;     addition:db 'addtion of number is',10;     additionLen: equ $-addition;                                   ; section .bss a resb 3   b resb 3 r resb 3 section .text     global _start ...

MA: Instruction set for 80386

AAA ASCII Adjust after Addition AAD ASCII Adjust AX before Division AAM ASCII Adjust AX after Multiply AAS ASCII Adjust AL after Subtraction ADC Add with Carry ADD Add AND Logical AND ARPL Adjust RPL Field of Selector BOUND Check Array Index Against Bounds BSF Bit Scan Forward BSR Bit Scan Reverse BT Bit Test BTC Bit Test and Complement BTR Bit Test and Reset BTS Bit Test and Set CALL Call Procedure CBW/CWDE Convert Byte to Word/Convert Word to Doubleword CLC Clear Carry Flag CLD Clear Direction Flag CLI Clear Interrupt Flag CLTS Clear Task-Switched Flag in CR0 CMC Complement Carry Flag CMP Compare Two Operands CMPS/CMPSB/CMPSW/CMPSD Compare String Operands CWD/CDQ Convert Word to Doubleword/Convert Doubleword to Quadword DAA Decimal Adjust AL after Addition DAS Decimal Adjust AL after Subtraction DEC Decrement by 1 DIV Unsigned Divide ENTER Make Stack Frame for Procedu...

NASM: addition of 3 numbers(for sum less than 10)

section .data     input:db 'enter the number',10   ;         inputLen:  equ $-input           ;                                   ;     display:db 'entered number is:',10   ;         displayLen:  equ $-display       ;        addition:db 'addtion of number is',10;     additionLen: equ $-addition;                                   ; section .bss a resb 3    b resb 3 c resb 3 r resb 3 section .text  ...

NASM: program to find largest number from an array of 32-bit numbers(hard-coded)

;     Find largest number from the array of 32-bit numbers. ;    Program search for largest number and display the same. section .data     larg_msg db 'Largest Number is::'     larg_len: equ $-larg_msg     nwline db 10     array dd 0fa100001h,0b2000002h,0ffffffffh,0d400004h, 0500005h        ;array elements     arrcnt dd 05h section .bss     dnum_buff resb 8     large resd 1 %macro dispmsg 2     mov eax,4    ;System call for write     mov ebx,1    ;standard output stream     mov ecx,%1    ;message start address     mov edx,%2    ;message length     int 80h %endmacro section .text     global _start         global break...