Senin, 27 Januari 2014

1 cara membuat multiple calculator di JAVA

ok sobat blogger, kali ini ane akan berbagi tutorial yg ane buat sendiri tentang cara membuat multiple calculator di JAVA yg bisa sobat download di link di bawah ini :

link : http://www.4shared.com/rar/MBdqe369/how_to_make_a_multi_calculator.html

oke selamat berkreasi,,
ingat !!
gunakan imaginasimu :v
ilmu itu tidak ada batasnya

B|

1 Synchronous and Asynchronous

pastilah sobat blogger sering mendengar dua kata diatas, terutama yang berkutat di dunia IT.
terkadang saya sendiri juga merasa bingung apa itu synchronous dan asynchronous. yah meskipun sering mendengarnya tapi tetep saja bingung  :v  . oke kali ini saya akan memberikan contoh simplenya saja,

"Ada seseorang yang sedang mengendarai mobil. Saat berkendara, ia tidak hanya selalu fokus pada berkendara. Ia bisa melihat keadaan sekitar, mengambil air minum, bahkan ada juga yang ber-sms ria dengan seseorang."

Nah, orang di atas telah melakukan sesuatu secara async. Dia tidak hanya berkendara saja, tapi dia juga melakukan beberapa hal sekaligus. Kontras dengan synchronous (sync). Yang melakukan kegiatan secara prosedural dan periodik. Contoh kasusnya adalah:


"Orang yang sedang baris, maka ia harus bersamaan dengan yang lainya. Ia tidak boleh menoleh atau melakukan apapun sampai diperintahkan berhenti atau ada aba-aba untuk melakukan perintah tersebut."

Metode yang seperti ini dalam pemrograman bisa menjadi tidak user-friendly. Apabila saat aplikasi memproses suatu pekerjaan yang berat. Maka, tampilan aplikasi tidak akan bisa diapa-apakan dan terlihat seperti “not responding”. Ini sangat buruk karena menjadikan aplikasi kita terlihat lambat dan berat.

gimana ? sudah paham kn ??  :D

oke lanjut lebih detailnya,, tentang pengertian synchronous dan asynchronous :

Synchronous

proses pengirim dan penerima diatur sedemikian rupa sehingga memiliki pengaturan yang sama, sehingga dapat diterima dan dikirim denan baik. umumnya pengaturan ini didasarkan pada waktu dalam mengirimkan sinyal.  waktu ini diatur oleh denyut listrik secara periodik yang disebut clock . dengan kata lain synchronous adalah sistem operasi untuk kejadian yang terjadi pada waktu bersamaan, berkelanjutan dan dapat diprediksi. contoh: chating

Asynchronous

proses komunikasi data yang tidak tergantung dengan waktu yang tetap. proses transformasi data kecepatanya. cukup relatif dan tidak tetap. metode komunikasi serial dari satu perangkat ke perangkat lainnya. data dikirimkan perbit persatuan waktu. tiap simbol yang dikirimkan mempunyai start bit dan stop bit, untuk melakukan sinkronisasi dari suatu device pengirim dan penerima. interval yang terjadi antar satu karakter dengan karakter lainnya dapat bervariasi.  asynchronous merupakan operasi yang tidak bergantung waktu
Asynchronous sering disebut juga sebagai Asynchronous Transfer Mode (ATM). mode ini paling sering digunakan dalam mengirimkan dan menerima data antar 2 alat.  pada mode ini berarti clock yang digunakan oleh kedua alat tidak bekerja selaras satu dengan yang lainnya.  dengan demikian data harus berisikan informasi tambahan yang mengijinkan kedua lata kapan menyetujui kapan pengiriman alat dilakukan. contoh: modem, mesin fax, TCP/IP, mail, buletin board, dll.

oke sekian dulu sobat blogger,,
smoga ilmu yg ane share bermanfaat
jika ada kesalahan, silahkan komen di bawah ini :D

sumber : http://upikhardiyanti.wordpress.com/2010/03/02/contoh-synchronous-dan-asynchronous/ 

Sabtu, 11 Januari 2014

1 basic linux commands 2


So, you have installed your favorite linux distro and you are sitting in front of it. Probably you must have heard a lot of frightening things about its console. Here you will see some basic linux commands which will help you to get familiar with linux command line. So let's continue with the linux commands cheatsheet.
But first a few words about a very basic command called man. man comes from manual and it works like this man command_name. With this command you can view information on how to use any command of your system. There is even a man page for man! Try typing man man and you ll get the point. So if want further information and details on a command listed below just type man command_name
Lets get started! 

Viewing, copying, moving and deleting files
ls
Display the contents of the current directory
ls -a
Display also hidden files and hidden directories


cp filename /path/dir_name
Copy filename into directory /path/dir_name
cp -r dir_name /path/dir_name2
Copy the entire dir_name into /path/dir_name2
cp filename1 filename2 /path/dir_name
Copy filename1 and filename2 into /path/dir_name


rm name
Remove a file or directory called name
rm -r name
Remove an entire directory as well as its included files and subdirectories


mv filename /path/dir_name
Move filename into /path/dir_name
mv filename1 filename2
Rename filename1 to filename2


cat filename
Display filenames contents


more filename
Display filename in pages. Use spacebar to view next page


head filename
Display filenames first 10 lines
head -15 filename
Display filenames first 15 lines


tail filename
Display filenames last 10 lines
tail -15 filename
Display filenames last 15 lines


pwd
Display current directory


cd /path/dir_name
Change to directory /path/dir_name
cd ..
Go 1 directory up


mkdir dir_name
Create directory dir_name
rmdir dir_name
Delete directory dir_name
 
Finding files and text within files
updatedb
Update (create first time used) a database of all files under the root directory /
locate filename
Find file filename searching in the database


find / -name filename
Starting from the root directory search for the file called filename
find / -name *filename
Same as above but search for file containing the string filename


grep string /path/dir_name
Starting from /path/dir_name search for all files containing string


which application_name
Search $path for application app_name
whereis application_name
Search $path, man pages and source files for application_name
 
Archived files
Decompress
tar -xzf filename.tgz
Decompress tzg file
tar -xzf filename.tar.gz
Decompress tar.gz file
tar -xjf filename.tar.bz2
Decompress tar.bz2 file
 
Compress
tar -czf filename.tar /path/dir_name
Compress directory /path/dir_name to filename.tar
gzip -c filename > filename.gz
Compress /path/dir_name to filename.tar.gz
bzip2 -c filename > filename.bz2
Compress /path/dir_name to filename.tar.bz2
 
Using rpm files 
rpm -hiv package.rpm
Install rpm called package.rpm
rpm -hiv --force package.rpm
Install rpm called package.rpm by force
rpm -hUv package.rpm
Upgrade rpm called package.rpm
rpm -e package.rpm
Delete rpm called package.rpm
rpm -qpil package.rpm
List files in not-installed rpm called package.rpm
rpm -ql package.rpm
List files in installed rpm called package.rpm
rpm -q str
List installed rpms containing the string str
rpm -qf /path/application_name
Display the rpm that contains application application_name
 
Starting and Stoping 
startx
Start the X system
shutdown -h now
Shutdown the system now and do not reboot
halt
Same as above
shutdown -r now
Reboot
reboot
Same as above
shutdown -r +10
Reboot in 10 minutes
   
Mounting filesystems
mount -t vfat /dev/sd(a)(1) /mnt/c_drive
Mount the first partition 1 of the first hard disk drive a which is in fat32 vfat dormat under /mnt/c_drive directory
mount -t iso9660 /dev/cdrom /mnt/cdrom
Mount cdrom under /mnt/cdrom directory


umount /mnt/hda1
Unmout the above
 
User administration
users
Display users currently logged in
adduser username
Create a new user called username
passwd username
Define password for user called username
who
List logged-in users
whoami
Display current user
finger username
Displays info about user username
su
Log in as root from current login
su -
Log in as root from current login and take root's path
exit
Exit from console login (ie, logout).
 
Processes 
command
Execute command in the foreground
command &
Execute command in the background
ctrl+z
Suspend a program
ctrl+c
Interrupt a program
ps
List all processes
kill -9 pid
Kill process with id pid
top
Monitor processes in real time
 
Networking 
hostname
List the system's hostname
ifconfig
Set/Display network information
host ip
Resolves ip's hostname
ping ip/hostname
Check if ip/hostname is reachable
traceroute ip/hostname
Find network path to ip/hostname
   
System Information
uname -a
General system information
fdisk -l
List partition tables
cp filename /path/dir_name
Copy filename into directory /path/dir_name
df -T -h
List filesystem disk space usage
lspci
List PCI devices
lsusb
List USB devices
free -m
Display RAM+Swap usage
 
Program Compile
gcc -o output file.c
Compile a C program
./output
Run a C program you have compiled
g++ -o output file.cpp
Compile a C++ program
./output
Run a C++ program you have compiled
./configure && make && su -c 'make install'
Configure, compile and install a program with Makefile

0 Basic Linux Commands


All commands in Linux are case sensitive , so the “ LS “command will be perceived differently by “ ls ”.Now we start with the basic commands that are commonly used in Linux :

ls
This command is a command
to display the contents of a directory . This command is similar to the dir command in DOS .
There are several ways to use this
command , for example :
 

# ls

# ls - l

To find out more about the ls
command , please refer to the manual with the command man ls .

more
more
commands can be used to view the contents of a text file to the screen by screen . more to get out of the view by pressing button ‘ q ‘.

cat
This
command is used to display the contents of a file to the screen without a screen per-screen display facilities .

Usually used in conjunction with a pipeline or redirection . For example to display the contents of the file / etc / passwd and / etc / group , use the
command :

# cat / etc/passwd/ etc/group

cd
This
command is similar to the DOS cd command is used to move to a particular directory . Example commands :

# cd /home/whal

To go back to the /home directory , then use the
command :

# cd ..

cp
This
command is used to copy a file or directory . for example :

# cp whal whal2

The above
command will copy the files whal to files whal2 . To copy the entire directory using the command :

# cp - R/home/whal  /home/gue

mv
This
command is used to move a file to another location or with a different name . example :

# mv contoh1.php contoh2.php

# mv contoh1.php /home/whal/contoh2.php

rm
This
command is used to delete directories or files . This command is similar to the DOS del command . In order to use this command carefully because there is no command in Linux undelete or unerase . Example of use rm as follows :

# rm contoh1.php

To delete a directory, use the
command :

# rm /home/whal/temp

mkdir
This
command is used to create directories . For example :

# mkdir whal

Pipeline
On
Linux and UNIX , the output of a process program can be given as inputs to other processes . For example :

# ls - l /home/whal | more

grep
grep
command is used to download the filter input and display in the form of lines corresponding to the pattern you want . example :

# ps ax |grep wvdial

redirection
In
Linux or UNIX , you can turn swung standard input , standard output or error toward another goal .
For example, you can skew the standard output of a program to a file or standard input deflect a program from a file .

Distorting the process is called redirection and in UNIX  we used  ‘ > ’ symbols  ( to deflect the standard output to a file ) and the symbol ‘ < ’ ( to deflect from the standard input file ) . example :

To save the contents of the entire display directory /etc to a file , use the
command :

# ls - lR /etc > content-etc

To add the contents of the file contents etc with other data , use the symbol >> ( append ) the redirection , for example :

# ls - lR /home/whal >> content-etc

To make the sorting order of data contained in the file contoh.txt can use the
command :

# sort < contoh.txt

The above
commands are commands that are often used in Linux or UNIX . If you still have trouble please read the manual first. Because it is very important to read the manual if you frequently “ oprek “ Linux or UNIX . from the manual book we can get the solution of the problems.