Latest Publications

algoritma segi tiga pascal

mumpung masih hangat, berikut ini salah satu contoh algoritma segitiga pascal beserta contoh codingnya di php

flowchart :

contoh program :

$limit	= 6;
$pascal	= "";
for($i=1;$i<=$limit;$i++){
	for($j=1;<=$i;$j++){
		if($j==1 || $j==$i){
			$value[$i][$j] = 1;
		}else{
			$value[$i][$j] = $value[$i-1][$j] + $value[$i-1][$j-1];
		}
		$pascal .= $value[$i][$j]." ";
	}
	$pascal .= "
\n";
}
echo $pascal;

output :

Bookmarks:
  • Facebook
  • Google Bookmarks
  • Digg
  • LinkedIn
  • Twitter

activity diagram by example

kasus : koperasi simpan pinjam dan kredit motor

  1. pencatatan data anggota
    setiap anggota baru mengisi formulir keanggotaan. formulir yang sudah diisi wajib dikembalikan ke staff koperasi dan staff koperasi akan membuatkan kartu anggota berikut dengan kartu simpan.

    activity diagram : pencatatan data anggota

    activity diagram : pencatatan data anggota

  2. pembayaran simpanan anggota
    setiap bulan anggota koperasi wajib melakukan pembayaran simpanan (wajib, pokok, atau sukarela) dan setiap melakukan pembayaran akan dicatat di buku simpanan oleh staff koperasi.

    activity diagram : pembayaran simpanan anggota

    activity diagram : pembayaran simpanan anggota

    (more…)

Bookmarks:
  • Facebook
  • Google Bookmarks
  • Digg
  • LinkedIn
  • Twitter

operasi input output

1. Proses INPUT OUTPUT
Sebuah Proses memerlukan Input / Output

File Deskriptor

Proses Input Output

Instruksi / Command yang diberikan pada Linux melalui shell disebut sebagai eksekusi program yang selanjutnya disebut proses.
Setiap kali instruksi diberikan, maka linux kernel akan menciptakan sebuah proses dengan memberikan nomor PID ( Process Identity )
Proses dalam linux membutuhkan input dan menghasilkan output.
Dalam konteks Linux input / output adalah :
- Keyboard
- Layar
- File
- Struktur data Kernel
- Peralatan input/output lainnya (network)

2. File DESCRIPTOR
Linux berkomunikasi dengan file melalui file descriptor yang direpresentasikan melalui angka yang dimulai dari 0,1,2 dan seterusnya.
Tiga buah file descriptor standar yang lalu diciptakan oleh proses adalah :
0 = keyboard ( standar input )
1 = layar ( standar output )
2 = layar ( standar error )

File Deskriptor

File Descriptor

Linux tidak membedakan antara peralatan hardware dan file, Linux memanipulasi peralatan hardware sama dengan file.

(more…)

Bookmarks:
  • Facebook
  • Google Bookmarks
  • Digg
  • LinkedIn
  • Twitter

how to install wordpress mu on nginx

setting dns server

  1. tambahkan zone sarunkgenk.com di file /etc/bind/named.conf
    user@computer:$ sudo vim /etc/bind/named.conf
    zone "sarunkgenk.com" IN {
    type master;
    file "/etc/bind/db.sarunkgenk.com";
    allow-update { none; };
    };
  2. ubah file /etc/bind/db.sarunkgenk.com
    user@computer:$ sudo vim /etc/bind/db.sarunkgenk.com
    ;
    ; BIND data file for local loopback interface
    ;
    $TTL    604800
    $ORIGIN sarunkgenk.com.
    @       IN      SOA     ns1.sarunkgenk.com. me.cuplis.net. (
    128       ; Serial
    604800         ; Refresh
    86400         ; Retry
    2419200         ; Expire
    604800 )       ; Negative Cache TTL

    IN      NS      ns1.sarunkgenk.com.
    ns1                     IN      A       192.168.22.115
    @                       IN      A       192.168.22.115

    www                     IN      CNAME   @
    *                       IN      A       192.168.22.115
    @                       IN      MX      5 ASPMX.L.GOOGLE.COM.
    IN      MX      10 ALT2.ASPMX.L.GOOGLE.COM.
    IN      MX      1 ASPMX2.GOOGLEMAIL.COM.
  3. cek konfigurasi dns
    user@computer:$ sudo named-checkzone sarunkgenk.com /etc/bind/db.sarunkgenk.com
    zone sarunkgenk.com/IN: loaded serial 128
    OK
  4. restart bind
    user@computer:$ sudo /etc/init.d/bind9 restart
  5. cek hasil
    user@computer:$ dig sarunkgenk.com;
    ; <<>> DiG 9.4.2 <<>> sarunkgenk.com
    ;; global options:  printcmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 22729
    ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

    ;; QUESTION SECTION:
    ;sarunkgenk.com.            IN    A

    ;; ANSWER SECTION:
    sarunkgenk.com.        604800    IN    A    192.168.22.115

    ;; AUTHORITY SECTION:
    sarunkgenk.com.        604800    IN    NS    ns1.sarunkgenk.com.

    ;; ADDITIONAL SECTION:
    ns1.sarunkgenk.com.    604800    IN    A    192.168.22.115

    ;; Query time: 0 msec
    ;; SERVER: 192.168.22.115#53(192.168.22.115)
    ;; WHEN: Sun Oct  4 15:41:20 2009
    ;; MSG SIZE  rcvd: 82

(more…)

Bookmarks:
  • Facebook
  • Google Bookmarks
  • Digg
  • LinkedIn
  • Twitter

how to configure php as fastcgi on nginx

  1. install php
    user@computer:$ sudo apt-get install php5-cgi
  2. buat file /etc/default/php-fastcgi
    user@computer:$ sudo vim /etc/default/php-fastcgi
    START=yes

    # Which user runs PHP? (default: www-data)
    EXEC_AS_USER=www-data

    # Host and TCP port for FASTCGI-Listener (default: localhost:9000)
    FCGI_HOST=localhost
    FCGI_PORT=8888

    # Environment variables, which are processed by PHP
    PHP_FCGI_CHILDREN=4
    PHP_FCGI_MAX_REQUESTS=1000

    (more…)

Bookmarks:
  • Facebook
  • Google Bookmarks
  • Digg
  • LinkedIn
  • Twitter

how to install and configure nginx webserver on ubuntu

caranya cukup mudah :

  1. install nginx
    user@computer:$ sudo apt-get install nginx
  2. jalankan nginx
    user@computer:$ sudo /etc/init.d/nginx start
  3. kemudian buka browser dan buka url http://youripaddress dan seharusnya sudah ada tampilan seperti berikut :

    Welcome to nginx!

    Welcome to nginx!

  4. nginx meletakkan vhost2-nya path /etc/nginx/sites-available/
  5. sedangkan vhost2 yang aktif ada di path /etc/nginx/sites-enabled/. file2 di folder ini akan lebih mudah di symbolic link dari path /etc/nginx/sites-available/ yang berisi daftar vhost yang sudah kita setting.
  6. nginx akan membuat vhost default yang aktif :
    user@computer:$ ls -lah /etc/nginx/sites-enabled/
    total 8.0K
    drwxr-xr-x 2 root root 4.0K 2009-10-03 12:41 .
    drwxr-xr-x 5 root root 4.0K 2009-10-03 12:54 ..
    lrwxrwxrwx 1 root root   34 2009-10-03 12:41 default -> /etc/nginx/sites-available/default

nginx version: nginx/0.6.35
Linux cuplis 2.6.24-16-server #1 SMP Thu Apr 10 13:58:00 UTC 2008 i686 GNU/Linux

source : http://www.ubuntugeek.com/howto-install-nginx-webserver-in-ubuntu-804-hardy-heron.html

Bookmarks:
  • Facebook
  • Google Bookmarks
  • Digg
  • LinkedIn
  • Twitter