Monthly Archives: October 2014

Monitoring Network Protocol Using JAVA

A network protocol is a rule / standards that regulate / allow a communication between two / more devices in the network. Protocol implemented in hardware and software. There are some kind of protocol that is often used in internet services. Namely: TCP / IP, UDP, PPP, ICMP, POP3, SMTP, HTTP, HTTPS, SSH and SSL. On this occasion, I will share how to monitor the activity of our computer network using JAVA program. Library that can be used is JNETPCAP and JPCAP.But, in this opportunity i will use JNETPCAP as my library.

1. Create project using Netbeans IDE
2. Add JNETPCAP library into our project

3. Create a main class // in this case , i just monitor HTTP protocol

package jnetpcapexample;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import org.jnetpcap.Pcap;
import org.jnetpcap.PcapIf;
import org.jnetpcap.packet.PcapPacket;
import org.jnetpcap.packet.PcapPacketHandler;
import org.jnetpcap.protocol.network.Arp;
import org.jnetpcap.protocol.tcpip.Http;
import org.jnetpcap.protocol.tcpip.Tcp;


/**
 *
 * @author Achmad Fauzi
 * fauzi.knightmaster.achmad@gmail.com
 */
public class LivePacketCapture {

    public static void main( String  [] args ){
        try {
            // Will be filled with NICs
            List<PcapIf> alldevs = new ArrayList();

            // For any error msgs
            StringBuilder errbuf = new StringBuilder();

            //Getting a list of devices
            int r = Pcap.findAllDevs(alldevs, errbuf);
            System.out.println(r);
            if (r != Pcap.OK) {
                System.err.printf("Can't read list of devices, error is %s", errbuf.toString());
                return;
            }

            System.out.println("Network devices found:");
            int i = 0;
            for (PcapIf device : alldevs) {
                String description =(device.getDescription() != null) ? device.getDescription(): "No description available";
                System.out.printf("#%d: %s [%s]\n", i++, device.getName(), description);
            }
            System.out.println("choose the one device from above list of devices");
            int ch = new Scanner(System.in).nextInt();
            PcapIf device = alldevs.get(ch);

            int snaplen = 64 * 1024;           // Capture all packets, no trucation
            int flags = Pcap.MODE_PROMISCUOUS; // capture all packets
            int timeout = 10 * 1000;           // 10 seconds in millis

            //Open the selected device to capture packets
            Pcap pcap = Pcap.openLive(device.getName(), snaplen, flags, timeout, errbuf);

            if (pcap == null) {
                System.err.printf("Error while opening device for capture: "+ errbuf.toString());
                return;
            }
            System.out.println("device opened");

            //Create packet handler which will receive packets
            PcapPacketHandler jpacketHandler = new PcapPacketHandler() {
                Arp arp = new Arp();
                Http http = new Http();
                Tcp tcp = new Tcp();
                @Override
                public void nextPacket(PcapPacket jHeaders, Object o) {
                    //Here i am capturing the ARP packets only,you can capture any packet that you want by just changing the below if condition
//                    if (jHeaders.hasHeader(arp)) {
//                        System.out.println("Hardware type" + arp.hardwareType());
//                        System.out.println("Protocol type" + arp.protocolType());
//                        System.out.println("Packet:" + arp.getPacket());
//                        System.out.println();
//                    }
                    
                    if ( jHeaders.hasHeader( http ) ){
                        System.out.println("Header = " + http.header());
                        System.out.println("Content Type = " + http.contentType());
                        System.out.println("Info = " + http.contentTypeEnum());
                    }
                    
//                    if ( jHeaders.hasHeader(tcp)) {  
//                        System.out.printf("#%d seq=%08X%n", jHeaders.getFrameNumber(), tcp.seq());  
//                    }  
                }
            };            
            pcap.loop(Pcap.LOOP_INFINITE, jpacketHandler, "");
            pcap.close();
        } catch (Exception ex) {
            System.out.println(ex);
        }
    }}

4. Modify VM Option in your project
VM Options : “-Djava.library.path=”~/[JNETPCAP dll directory]”
5. run
do simulation by accessing Browser : detik.com

Result :

run:
0
Network devices found:
#0: \Device\NPF_{8870722A-90D9-4A12-AB35-F93D3B7F20B2} [TAP-Windows Adapter V9]
#1: \Device\NPF_{B1350B76-4EF9-4F64-9F49-04493D044D22} [Realtek PCIe GBE Family Controller]
#2: \Device\NPF_{619BE85C-1731-4933-B5F4-0AB7F78996F8} [Microsoft]
#3: \Device\NPF_{23B0AECB-1C03-4DB1-8B08-FDFFF8FC5F5A} [Microsoft]
#4: \Device\NPF_{5EB521BC-BBCF-4391-8D1A-69D4D2C6EA49} [TAP-Windows Adapter V9]
choose the one device from above list of devices
1
device opened
Header = GET / HTTP/1.1
Host: www.detik.com
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Cookie: __utma=146380193.2047366996.1410833007.1414117345.1414553890.5; __utmz=146380193.1414117345.4.2.utmcsr=google|utmccn=(organic)|utmcmd=organic; __auc=be689fde1487c3344056fe6eb4a; __utmb=146380193.3.10.1414566581; __utmc=146380193; __asc=7187d84314959fb76b3f23383c8; dts-=_d%3D.; chs-=0c50b412769a6f19aa3fb763483e58f4
Connection: keep-alive


Content Type = null
Info = OTHER
Header = HTTP/1.1 200 OK
Server: nginx/id11
Date: Wed, 29 Oct 2014 07:09:40 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Cache-Control: no-transform
Vary: User-Agent, Accept
Server: id11
X-Cached: HIT
X-XSS-Protection: 1;mode=block
X-Content-Type-Options: nosniff
Connection: Keep-Alive
Content-Encoding: gzip


Content Type = text/html
Info = HTML
Header = GET /urchin.js HTTP/1.1
Host: www.detik.com
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://www.detik.com/
Cookie: __utma=146380193.2047366996.1410833007.1414117345.1414553890.5; __utmz=146380193.1414117345.4.2.utmcsr=google|utmccn=(organic)|utmcmd=organic; __auc=be689fde1487c3344056fe6eb4a; __utmb=146380193.3.10.1414566581; __utmc=146380193; __asc=7187d84314959fb76b3f23383c8; dts-=_d%3D.; chs-=0c50b412769a6f19aa3fb763483e58f4
Connection: keep-alive


Content Type = null
Info = OTHER
Header = HTTP/1.1 200 OK
Server: nginx/id17
Date: Wed, 29 Oct 2014 07:09:18 GMT
Content-Type: application/x-javascript
Last-Modified: Fri, 24 Feb 2012 11:14:04 GMT
Transfer-Encoding: chunked
Expires: Thu, 30 Oct 2014 07:09:18 GMT
Cache-Control: max-age=86400
Server: id17
X-XSS-Protection: 1;mode=block
X-Content-Type-Options: nosniff
Connection: Keep-Alive
Content-Encoding: gzip
Age: 22


Content Type = application/x-javascript
Info = OTHER
Header = GET /__utm.gif?utmwv=1&utmn=1071965559&utmcs=windows-1252&utmsr=1366x768&utmsc=24-bit&utmul=en-us&utmje=1&utmfl=15.0%20r0&utmdt=detikcom%20%3A%20situs%20warta%20era%20digital&utmhn=www.detik.com&utmr=-&utmp=/ HTTP/1.1
Host: www.detik.com
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://www.detik.com/
Cookie: __utma=146380193.2047366996.1410833007.1414117345.1414553890.5; __utmz=146380193.1414117345.4.2.utmcsr=google|utmccn=(organic)|utmcmd=organic; __auc=be689fde1487c3344056fe6eb4a; __utmb=146380193; __utmc=146380193; __asc=7187d84314959fb76b3f23383c8; dts-=_d%3D.; chs-=0c50b412769a6f19aa3fb763483e58f4
Connection: keep-alive


Content Type = null
Info = OTHER
Header = HTTP/1.1 200 OK
Server: nginx/id11
Date: Wed, 29 Oct 2014 07:09:41 GMT
Content-Type: image/gif
Content-Length: 35
Last-Modified: Thu, 06 Jan 2011 06:52:03 GMT
ETag: "4d256693-23"
Expires: Thu, 30 Oct 2014 07:09:41 GMT
Cache-Control: max-age=86400
Server: id11
X-XSS-Protection: 1;mode=block
X-Content-Type-Options: nosniff
Accept-Ranges: bytes
Connection: Keep-Alive
Age: 0


Content Type = image/gif
Info = GIF
Header = GET /wh/100/200/static/thumbnails/2014/10/29/SHOW-IMAH-SEG-5.jpg HTTP/1.1
Host: www.mytrans.com
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://www.detik.com/
Connection: keep-alive


Content Type = null
Info = OTHER
Header = GET /wh/100/200/static/thumbnails/2014/10/29/SHOW-IMAH-SEG-4.jpg HTTP/1.1
Host: www.mytrans.com
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://www.detik.com/
Connection: keep-alive


Content Type = null
Info = OTHER
Header = HTTP/1.1 403 Forbidden
Cache-Control: no-cache
Pragma: no-cache
Content-Type: text/html; charset=utf-8
Connection: Keep-Alive
Content-Length: 606


Content Type = text/html; charset=utf-8
Info = HTML
Header = HTTP/1.1 403 Forbidden
Cache-Control: no-cache
Pragma: no-cache
Content-Type: text/html; charset=utf-8
Connection: Keep-Alive
Content-Length: 606


Content Type = text/html; charset=utf-8
Info = HTML
Header = GET /__utm.gif?utmwv=1&utmn=668242190&utmcs=UTF-8&utmsr=1366x768&utmsc=24-bit&utmul=en-us&utmje=1&utmfl=15.0%20r0&utmdt=detikcom%20%3A%20situs%20warta%20era%20digital&utmhn=www.detik.com&utmr=-&utmp=/ HTTP/1.1
Host: www.detik.com
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://www.detik.com/
Cookie: __utma=146380193.2047366996.1410833007.1414117345.1414553890.5; __utmz=146380193.1414117345.4.2.utmcsr=google|utmccn=(organic)|utmcmd=organic; __auc=be689fde1487c3344056fe6eb4a; __utmb=146380193; __utmc=146380193; __asc=7187d84314959fb76b3f23383c8; dts-=_d%3D.; chs-=0c50b412769a6f19aa3fb763483e58f4
Connection: keep-alive


Content Type = null
Info = OTHER
Header = HTTP/1.1 200 OK
Server: nginx/id11
Date: Wed, 29 Oct 2014 07:09:41 GMT
Content-Type: image/gif
Content-Length: 35
Last-Modified: Thu, 06 Jan 2011 06:52:03 GMT
ETag: "4d256693-23"
Expires: Thu, 30 Oct 2014 07:09:41 GMT
Cache-Control: max-age=86400
Server: id11
X-XSS-Protection: 1;mode=block
X-Content-Type-Options: nosniff
Accept-Ranges: bytes
Connection: Keep-Alive
Age: 0


Content Type = image/gif
Info = GIF
Header = GET /wh/100/200/static/thumbnails/2014/10/29/SHOW-IMAH-SEG-5.jpg HTTP/1.1
Host: www.mytrans.com
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://www.detik.com/
Connection: keep-alive


Content Type = null
Info = OTHER
Header = GET /wh/100/200/static/thumbnails/2014/10/29/SHOW-IMAH-SEG-4.jpg HTTP/1.1
Host: www.mytrans.com
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://www.detik.com/
Connection: keep-alive


Content Type = null
Info = OTHER
Header = HTTP/1.1 403 Forbidden
Cache-Control: no-cache
Pragma: no-cache
Content-Type: text/html; charset=utf-8
Connection: Keep-Alive
Content-Length: 606


Content Type = text/html; charset=utf-8
Info = HTML
Header = HTTP/1.1 403 Forbidden
Cache-Control: no-cache
Pragma: no-cache
Content-Type: text/html; charset=utf-8
Connection: Keep-Alive
Content-Length: 606


Content Type = text/html; charset=utf-8
Info = HTML
Header = GET /__utm.gif?utmwv=5.6.0dc&utms=1&utmn=217585871&utmhn=www.detik.com&utmcs=UTF-8&utmsr=1366x768&utmvp=1349x633&utmsc=24-bit&utmul=en-us&utmje=1&utmfl=15.0%20r0&utmdt=detikcom%20%3A%20situs%20warta%20era%20digital&utmhid=51159814&utmr=-&utmp=%2F HTTP/1.1
Host: www.detik.com
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://www.detik.com/
Cookie: __utma=146380193.2047366996.1410833007.1414117345.1414553890.5; __utmz=146380193.1414117345.4.2.utmcsr=google|utmccn=(organic)|utmcmd=organic; __auc=be689fde1487c3344056fe6eb4a; __utmb=146380193.0.10.1414566603; __utmc=146380193; __asc=7187d84314959fb76b3f23383c8; dts-=_d%3D.; chs-=0c50b412769a6f19aa3fb763483e58f4
Connection: keep-alive


Content Type = null
Info = OTHER
Header = GET /__utm.gif?utmwv=5.6.0dc&utms=1&utmn=1253115562&utmhn=www.detik.com&utmcs=UTF-8&utmsr=1366x768&utmvp=1349x633&utmsc=24-bit&utmul=en-us&utmje=1&utmfl=15.0%20r0&utmdt=detikcom%20%3A%20situs%20warta%20era%20digital&utmhid=51159814&utmr=-&utmp=%2F&utmht=1414566603393&utmac=UA-891770-5&utmcc=__utma%3D146380193.2047366996.1410833007.1414117345.1414553890.5%3B%2B__utmz%3D146380193.1414117345.4.2.utmcsr%3Dgoogle%7Cutmccn%3D(organic)%7Cutmcmd%3Dorganic%3B&utmu=qhAAAAAg~ HTTP/1.1
Host: stats.g.doubleclick.net
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://www.detik.com/
Cookie: id=2247bf182703002c||t=1410686534|et=730|cs=002213fd48ff37581b59a90a44
Connection: keep-alive


Content Type = null
Info = OTHER
Header = GET /__utm.gif?utmwv=5.6.0dc&utms=2&utmn=998779788&utmhn=www.detik.com&utmcs=UTF-8&utmsr=1366x768&utmvp=1349x633&utmsc=24-bit&utmul=en-us&utmje=1&utmfl=15.0%20r0&utmdt=detikcom%20%3A%20situs%20warta%20era%20digital&utmhid=51159814&utmr=-&utmp=%2F&utmht=1414566603402&utmac=UA-891770-59&utmcc=__utma%3D146380193.2047366996.1410833007.1414117345.1414553890.5%3B%2B__utmz%3D146380193.1414117345.4.2.utmcsr%3Dgoogle%7Cutmccn%3D(organic)%7Cutmcmd%3Dorganic%3B&utmmt=1&utmu=qhAAAAAgAAI~ HTTP/1.1
Host: stats.g.doubleclick.net
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://www.detik.com/
Cookie: id=2247bf182703002c||t=1410686534|et=730|cs=002213fd48ff37581b59a90a44
Connection: keep-alive


Content Type = null
Info = OTHER
Header = GET /__utm.gif?utmwv=5.6.0dc&utms=3&utmn=1116814198&utmhn=www.detik.com&utmcs=UTF-8&utmsr=1366x768&utmvp=1349x633&utmsc=24-bit&utmul=en-us&utmje=1&utmfl=15.0%20r0&utmdt=detikcom%20%3A%20situs%20warta%20era%20digital&utmhid=51159814&utmr=-&utmp=%2F&utmht=1414566603409&utmac=UA-891770-118&utmcc=__utma%3D146380193.2047366996.1410833007.1414117345.1414553890.5%3B%2B__utmz%3D146380193.1414117345.4.2.utmcsr%3Dgoogle%7Cutmccn%3D(organic)%7Cutmcmd%3Dorganic%3B&utmmt=1&utmu=qhAAAAAgAAI~ HTTP/1.1
Host: stats.g.doubleclick.net
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://www.detik.com/
Cookie: id=2247bf182703002c||t=1410686534|et=730|cs=002213fd48ff37581b59a90a44
Connection: keep-alive


Content Type = null
Info = OTHER
Header = HTTP/1.1 200 OK
Server: nginx/id11
Date: Wed, 29 Oct 2014 07:09:42 GMT
Content-Type: image/gif
Content-Length: 35
Last-Modified: Thu, 06 Jan 2011 06:52:03 GMT
ETag: "4d256693-23"
Expires: Thu, 30 Oct 2014 07:09:42 GMT
Cache-Control: max-age=86400
Server: id11
X-XSS-Protection: 1;mode=block
X-Content-Type-Options: nosniff
Accept-Ranges: bytes
Connection: Keep-Alive
Age: 0


Content Type = image/gif
Info = GIF
Header = GET /chanel_boxs/11/5/5 HTTP/1.1
Host: channelbox.iklanbaris.detik.com
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://www.detik.com/
Cookie: __utma=146380193.2047366996.1410833007.1414117345.1414553890.5; __utmz=146380193.1414117345.4.2.utmcsr=google|utmccn=(organic)|utmcmd=organic; __auc=be689fde1487c3344056fe6eb4a; __utma=75318976.769333546.1410833011.1414117346.1414553895.5; __utmz=75318976.1414553895.5.5.utmcsr=detik.com|utmccn=(referral)|utmcmd=referral|utmcct=/; __utmb=146380193; __utmc=146380193; __asc=7187d84314959fb76b3f23383c8; __utmb=75318976.6.5.1414566582474; __utmc=75318976; dts-=_d%3D.; chs-=0c50b412769a6f19aa3fb763483e58f4; __utmt=1
Connection: keep-alive


Content Type = null
Info = OTHER
Header = HTTP/1.1 200 OK
Server: nginx/1.5.4
Date: Wed, 29 Oct 2014 07:09:42 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Status: 200 OK
X-Frame-Options: ALLOWALL
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: e031f76e-e70b-4ea7-bb2f-4d3ca947c943
X-Runtime: 0.158702
X-Cached: HIT
Connection: Keep-Alive
Content-Encoding: gzip


Content Type = text/html; charset=utf-8
Info = HTML
Header = HTTP/1.1 200 OK
Pragma: no-cache
Expires: Wed, 19 Apr 2000 11:43:00 GMT
Last-Modified: Wed, 21 Jan 2004 19:51:30 GMT
X-Content-Type-Options: nosniff
Content-Type: image/gif
Date: Fri, 24 Oct 2014 23:23:11 GMT
Server: Golfe2
Content-Length: 35
Cache-Control: private, no-cache, no-cache=Set-Cookie, proxy-revalidate
Age: 373592
Alternate-Protocol: 80:quic,p=0.01
Connection: Keep-Alive


Content Type = image/gif
Info = GIF
Header = HTTP/1.1 200 OK
Pragma: no-cache
Expires: Wed, 19 Apr 2000 11:43:00 GMT
Last-Modified: Wed, 21 Jan 2004 19:51:30 GMT
X-Content-Type-Options: nosniff
Content-Type: image/gif
Date: Fri, 24 Oct 2014 23:23:50 GMT
Server: Golfe2
Content-Length: 35
Cache-Control: private, no-cache, no-cache=Set-Cookie, proxy-revalidate
Age: 373553
Alternate-Protocol: 80:quic,p=0.01
Connection: Keep-Alive


Content Type = image/gif
Info = GIF
Header = GET /__utm.gif?utmwv=5.6.0dc&utms=4&utmn=662021376&utmhn=www.detik.com&utmt=event&utme=5(Etalase%20Detikcom*Impression*etalase_346_320)(1)&utmcs=UTF-8&utmsr=1366x768&utmvp=1349x633&utmsc=24-bit&utmul=en-us&utmje=1&utmfl=15.0%20r0&utmdt=detikcom%20%3A%20situs%20warta%20era%20digital&utmhid=51159814&utmr=-&utmp=%2F&utmht=1414566603955&utmac=UA-891770-5&utmni=1&utmcc=__utma%3D146380193.2047366996.1410833007.1414117345.1414553890.5%3B%2B__utmz%3D146380193.1414117345.4.2.utmcsr%3Dgoogle%7Cutmccn%3D(organic)%7Cutmcmd%3Dorganic%3B&utmu=6hAAAAAgAAI~ HTTP/1.1
Host: stats.g.doubleclick.net
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://www.detik.com/
Cookie: id=2247bf182703002c||t=1410686534|et=730|cs=002213fd48ff37581b59a90a44
Connection: keep-alive


Content Type = null
Info = OTHER
Header = GET /__utm.gif?utmwv=5.6.0dc&utms=5&utmn=922185129&utmhn=www.detik.com&utmt=event&utme=5(Etalase%20Detikcom*Impression*etalase_352_326)(1)&utmcs=UTF-8&utmsr=1366x768&utmvp=1349x633&utmsc=24-bit&utmul=en-us&utmje=1&utmfl=15.0%20r0&utmdt=detikcom%20%3A%20situs%20warta%20era%20digital&utmhid=51159814&utmr=-&utmp=%2F&utmht=1414566603966&utmac=UA-891770-5&utmni=1&utmcc=__utma%3D146380193.2047366996.1410833007.1414117345.1414553890.5%3B%2B__utmz%3D146380193.1414117345.4.2.utmcsr%3Dgoogle%7Cutmccn%3D(organic)%7Cutmcmd%3Dorganic%3B&utmu=6hAAAAAgAAI~ HTTP/1.1
Host: stats.g.doubleclick.net
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://www.detik.com/
Cookie: id=2247bf182703002c||t=1410686534|et=730|cs=002213fd48ff37581b59a90a44
Connection: keep-alive


Content Type = null
Info = OTHER
Header = GET /__utm.gif?utmwv=5.6.0dc&utms=6&utmn=522822483&utmhn=www.detik.com&utmt=event&utme=5(Etalase%20Detikcom*Impression*etalase_360_334)(1)&utmcs=UTF-8&utmsr=1366x768&utmvp=1349x633&utmsc=24-bit&utmul=en-us&utmje=1&utmfl=15.0%20r0&utmdt=detikcom%20%3A%20situs%20warta%20era%20digital&utmhid=51159814&utmr=-&utmp=%2F&utmht=1414566603997&utmac=UA-891770-5&utmni=1&utmcc=__utma%3D146380193.2047366996.1410833007.1414117345.1414553890.5%3B%2B__utmz%3D146380193.1414117345.4.2.utmcsr%3Dgoogle%7Cutmccn%3D(organic)%7Cutmcmd%3Dorganic%3B&utmu=6hAAAAAgAAI~ HTTP/1.1
Host: stats.g.doubleclick.net
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://www.detik.com/
Cookie: id=2247bf182703002c||t=1410686534|et=730|cs=002213fd48ff37581b59a90a44
Connection: keep-alive


Content Type = null
Info = OTHER
Header = HTTP/1.1 200 OK
Pragma: no-cache
Expires: Wed, 19 Apr 2000 11:43:00 GMT
Last-Modified: Wed, 21 Jan 2004 19:51:30 GMT
X-Content-Type-Options: nosniff
Content-Type: image/gif
Date: Fri, 24 Oct 2014 23:23:11 GMT
Server: Golfe2
Content-Length: 35
Cache-Control: private, no-cache, no-cache=Set-Cookie, proxy-revalidate
Age: 373592
Alternate-Protocol: 80:quic,p=0.01
Connection: Keep-Alive


Content Type = image/gif
Info = GIF
Header = HTTP/1.1 200 OK
Pragma: no-cache
Expires: Wed, 19 Apr 2000 11:43:00 GMT
Last-Modified: Wed, 21 Jan 2004 19:51:30 GMT
X-Content-Type-Options: nosniff
Content-Type: image/gif
Date: Fri, 24 Oct 2014 23:23:50 GMT
Server: Golfe2
Content-Length: 35
Cache-Control: private, no-cache, no-cache=Set-Cookie, proxy-revalidate
Age: 373553
Alternate-Protocol: 80:quic,p=0.01
Connection: Keep-Alive


Content Type = image/gif
Info = GIF
Header = HTTP/1.1 200 OK
Pragma: no-cache
Expires: Wed, 19 Apr 2000 11:43:00 GMT
Last-Modified: Wed, 21 Jan 2004 19:51:30 GMT
X-Content-Type-Options: nosniff
Content-Type: image/gif
Date: Fri, 24 Oct 2014 23:23:50 GMT
Server: Golfe2
Content-Length: 35
Cache-Control: private, no-cache, no-cache=Set-Cookie, proxy-revalidate
Age: 373553
Alternate-Protocol: 80:quic,p=0.01
Connection: Keep-Alive


Content Type = image/gif
Info = GIF
Header = HTTP/1.1 200 OK
Pragma: no-cache
Expires: Wed, 19 Apr 2000 11:43:00 GMT
Last-Modified: Wed, 21 Jan 2004 19:51:30 GMT
X-Content-Type-Options: nosniff
Content-Type: image/gif
Date: Fri, 24 Oct 2014 23:22:11 GMT
Server: Golfe2
Content-Length: 35
Cache-Control: private, no-cache, no-cache=Set-Cookie, proxy-revalidate
Age: 373652
Alternate-Protocol: 80:quic,p=0.01
Connection: Keep-Alive


Content Type = image/gif
Info = GIF
Header = GET /b?c1=2&c2=8443234&ns__t=1414566604248&ns_c=UTF-8&c8=detikcom%20%3A%20situs%20warta%20era%20digital&c7=http%3A%2F%2Fwww.detik.com%2F&c9= HTTP/1.1
Host: b.scorecardresearch.com
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://www.detik.com/
Cookie: UID=6407769-111.94.254.40-1410686533; UIDR=1410686533
Connection: keep-alive


Content Type = null
Info = OTHER
Header = HTTP/1.1 204 No Content
Content-Length: 0
Date: Wed, 29 Oct 2014 07:09:43 GMT
Pragma: no-cache
Expires: Mon, 01 Jan 1990 00:00:00 GMT
Cache-Control: private, no-cache, no-cache=Set-Cookie, no-store, proxy-revalidate
Connection: Keep-Alive


Content Type = null
Info = OTHER
Header = GET /test.png HTTP/1.1
Host: af53cee2d1a5edcd02482b308eff11248.profile.ams50.cloudfront.net
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://www.detik.com/
Connection: keep-alive


Content Type = null
Info = OTHER
Header = GET /__utm.gif?utmwv=1&utmn=1479623422&utmcs=UTF-8&utmsr=1366x768&utmsc=24-bit&utmul=en-us&utmje=1&utmfl=15.0%20r0&utmdt=Iklan%20Baris%20on%20Kanal&utmhn=channelbox.iklanbaris.detik.com&utmr=http://www.detik.com/&utmp=/chanel_boxs/11/5/5 HTTP/1.1
Host: channelbox.iklanbaris.detik.com
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://channelbox.iklanbaris.detik.com/chanel_boxs/11/5/5
Cookie: __utma=146380193.2047366996.1410833007.1414117345.1414553890.5; __utmz=146380193.1414117345.4.2.utmcsr=google|utmccn=(organic)|utmcmd=organic; __auc=be689fde1487c3344056fe6eb4a; __utma=75318976.769333546.1410833011.1414117346.1414553895.5; __utmz=75318976.1414553895.5.5.utmcsr=detik.com|utmccn=(referral)|utmcmd=referral|utmcct=/; __utmb=146380193.6.7.1414566603953; __utmc=146380193; __asc=7187d84314959fb76b3f23383c8; __utmb=75318976; __utmc=75318976; dts-=_d%3D.; chs-=0c50b412769a6f19aa3fb763483e58f4; __utmt=1
Connection: keep-alive


Content Type = null
Info = OTHER
Header = HTTP/1.1 200 OK
Server: nginx/1.5.4
Date: Wed, 29 Oct 2014 07:09:43 GMT
Content-Type: image/gif
Content-Length: 35
Last-Modified: Mon, 14 Apr 2014 04:41:31 GMT
ETag: "534b66fb-23"
Expires: Thu, 31 Dec 2037 23:55:55 GMT
Cache-Control: max-age=315360000
Accept-Ranges: bytes
Connection: Keep-Alive
Age: 0


Content Type = image/gif
Info = GIF
Header = GET /ga.js HTTP/1.1
Host: www.google-analytics.com
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://channelbox.iklanbaris.detik.com/chanel_boxs/11/5/5
Connection: keep-alive


Content Type = null
Info = OTHER
Header = HTTP/1.1 200 OK
Date: Wed, 29 Oct 2014 05:50:53 GMT
Expires: Wed, 29 Oct 2014 07:50:53 GMT
Last-Modified: Fri, 03 Oct 2014 00:48:42 GMT
X-Content-Type-Options: nosniff
Content-Type: text/javascript
Vary: Accept-Encoding
Server: Golfe2
Content-Length: 16063
Cache-Control: public, max-age=7200
Alternate-Protocol: 80:quic,p=0.01
Connection: Keep-Alive
Content-Encoding: gzip
Age: 4731


Content Type = text/javascript
Info = OTHER
Header = HTTP/1.1 200 OK
Server: CloudFront
Date: Wed, 29 Oct 2014 07:09:44 GMT
Content-Type: text/plain
Content-Length: 58
Expires: Wed, 29 Oct 2014 07:09:44 GMT
Cache-Control: max-age=0
X-Amz-Cf-Id: PoGymgTmlVFJo_SbKJ7bRXv-xOm-cvkPMDI_RWkAV8L_fUuID_jnsA==
X-Cache: RoutingProfileExp from cloudfront
Via: 1.1 fe843ed327cefb9c06d08a7369d7ed2c.cloudfront.net (CloudFront)
Connection: Keep-Alive
Age: 0


Content Type = text/plain
Info = OTHER
Header = GET /__utm.gif?utmwv=5.6.0&utms=1&utmn=1188195878&utmhn=channelbox.iklanbaris.detik.com&utmcs=UTF-8&utmsr=1366x768&utmvp=250x260&utmsc=24-bit&utmul=en-us&utmje=1&utmfl=15.0%20r0&utmdt=Iklan%20Baris%20on%20Kanal&utmhid=721933259&utmr=http%3A%2F%2Fwww.detik.com%2F&utmp=%2Fchanel_boxs%2F11%2F5%2F5 HTTP/1.1
Host: channelbox.iklanbaris.detik.com
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://channelbox.iklanbaris.detik.com/chanel_boxs/11/5/5
Cookie: __utma=146380193.2047366996.1410833007.1414117345.1414553890.5; __utmz=146380193.1414117345.4.2.utmcsr=google|utmccn=(organic)|utmcmd=organic; __auc=be689fde1487c3344056fe6eb4a; __utma=75318976.769333546.1410833011.1414117346.1414553895.5; __utmz=75318976.1414553895.5.5.utmcsr=detik.com|utmccn=(referral)|utmcmd=referral|utmcct=/; __utmb=146380193.6.7.1414566603953; __utmc=146380193; __asc=7187d84314959fb76b3f23383c8; __utmb=75318976.0.10.1414566605; __utmc=75318976; dts-=_d%3D.; chs-=0c50b412769a6f19aa3fb763483e58f4; __utmt=1
Connection: keep-alive


Content Type = null
Info = OTHER
Header = GET /__utm.gif?utmwv=5.6.0&utms=1&utmn=713376747&utmhn=channelbox.iklanbaris.detik.com&utmcs=UTF-8&utmsr=1366x768&utmvp=250x260&utmsc=24-bit&utmul=en-us&utmje=1&utmfl=15.0%20r0&utmdt=Iklan%20Baris%20on%20Kanal&utmhid=721933259&utmr=http%3A%2F%2Fwww.detik.com%2F&utmp=%2Fchanel_boxs%2F11%2F5%2F5&utmht=1414566604850&utmac=UA-891770-130&utmcc=__utma%3D75318976.769333546.1410833011.1414117346.1414553895.5%3B%2B__utmz%3D75318976.1414553895.5.5.utmcsr%3Ddetik.com%7Cutmccn%3D(referral)%7Cutmcmd%3Dreferral%7Cutmcct%3D%2F%3B&utmjid=&utmu=qAAAAAAgAAAAAAAAAAAAAAAE~ HTTP/1.1
Host: www.google-analytics.com
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://channelbox.iklanbaris.detik.com/chanel_boxs/11/5/5
Connection: keep-alive


Content Type = null
Info = OTHER
Header = HTTP/1.1 200 OK
Server: nginx/1.5.4
Date: Wed, 29 Oct 2014 07:09:43 GMT
Content-Type: image/gif
Content-Length: 35
Last-Modified: Mon, 14 Apr 2014 04:41:31 GMT
ETag: "534b66fb-23"
Expires: Thu, 31 Dec 2037 23:55:55 GMT
Cache-Control: max-age=315360000
Accept-Ranges: bytes
Connection: Keep-Alive
Age: 0


Content Type = image/gif
Info = GIF
Header = HTTP/1.1 200 OK
Pragma: no-cache
Expires: Wed, 19 Apr 2000 11:43:00 GMT
Last-Modified: Wed, 21 Jan 2004 19:51:30 GMT
X-Content-Type-Options: nosniff
Content-Type: image/gif
Date: Sat, 25 Oct 2014 04:00:56 GMT
Server: Golfe2
Content-Length: 35
Cache-Control: private, no-cache, no-cache=Set-Cookie, proxy-revalidate
Age: 356928
Alternate-Protocol: 80:quic,p=0.01
Connection: Keep-Alive


Content Type = image/gif
Info = GIF
Header = GET /__utm.gif?utmwv=5.6.0&utms=2&utmn=255682012&utmhn=channelbox.iklanbaris.detik.com&utmt=event&utme=5(channelbox%20iklanbaris*Impression*http%3A%2F%2Fiklanbaris.detik.com%2Fkategori%2Fkamera-aksesoris%2Fiklan%2Fpasang-anti-petir-paling-murah-3)&utmcs=UTF-8&utmsr=1366x768&utmvp=250x260&utmsc=24-bit&utmul=en-us&utmje=1&utmfl=15.0%20r0&utmdt=Iklan%20Baris%20on%20Kanal&utmhid=721933259&utmr=http%3A%2F%2Fwww.detik.com%2F&utmp=%2Fchanel_boxs%2F11%2F5%2F5 HTTP/1.1
Host: channelbox.iklanbaris.detik.com
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://channelbox.iklanbaris.detik.com/chanel_boxs/11/5/5
Cookie: __utma=146380193.2047366996.1410833007.1414117345.1414553890.5; __utmz=146380193.1414117345.4.2.utmcsr=google|utmccn=(organic)|utmcmd=organic; __auc=be689fde1487c3344056fe6eb4a; __utma=75318976.769333546.1410833011.1414117346.1414553895.5; __utmz=75318976.1414553895.5.5.utmcsr=detik.com|utmccn=(referral)|utmcmd=referral|utmcct=/; __utmb=146380193.6.7.1414566603953; __utmc=146380193; __asc=7187d84314959fb76b3f23383c8; __utmb=75318976.1.10.1414566605; __utmc=75318976; dts-=_d%3D.; chs-=0c50b412769a6f19aa3fb763483e58f4; __utmt=1
Connection: keep-alive


Content Type = null
Info = OTHER
Header = HTTP/1.1 200 OK
Server: nginx/1.5.4
Date: Wed, 29 Oct 2014 07:09:43 GMT
Content-Type: image/gif
Content-Length: 35
Last-Modified: Mon, 14 Apr 2014 04:41:31 GMT
ETag: "534b66fb-23"
Expires: Thu, 31 Dec 2037 23:55:55 GMT
Cache-Control: max-age=315360000
Accept-Ranges: bytes
Connection: Keep-Alive
Age: 0


Content Type = image/gif
Info = GIF
Header = GET /__utm.gif?utmwv=5.6.0&utms=2&utmn=1578424000&utmhn=channelbox.iklanbaris.detik.com&utmt=event&utme=5(channelbox%20iklanbaris*Impression*http%3A%2F%2Fiklanbaris.detik.com%2Fkategori%2Fkamera-aksesoris%2Fiklan%2Fpasang-anti-petir-paling-murah-3)&utmcs=UTF-8&utmsr=1366x768&utmvp=250x260&utmsc=24-bit&utmul=en-us&utmje=1&utmfl=15.0%20r0&utmdt=Iklan%20Baris%20on%20Kanal&utmhid=721933259&utmr=http%3A%2F%2Fwww.detik.com%2F&utmp=%2Fchanel_boxs%2F11%2F5%2F5&utmht=1414566604910&utmac=UA-891770-130&utmcc=__utma%3D75318976.769333546.1410833011.1414117346.1414553895.5%3B%2B__utmz%3D75318976.1414553895.5.5.utmcsr%3Ddetik.com%7Cutmccn%3D(referral)%7Cutmcmd%3Dreferral%7Cutmcct%3D%2F%3B&utmjid=&utmu=6AAAAAAgAAAAAAAAAAAAAAAE~ HTTP/1.1
Host: www.google-analytics.com
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://channelbox.iklanbaris.detik.com/chanel_boxs/11/5/5
Connection: keep-alive


Content Type = null
Info = OTHER
Header = GET /__utm.gif?utmwv=5.6.0&utms=3&utmn=712515645&utmhn=channelbox.iklanbaris.detik.com&utmt=event&utme=5(channelbox%20iklanbaris*Impression*http%3A%2F%2Fiklanbaris.detik.com%2Fkategori%2Fsuplement-kesehatan%2Fiklan%2Fsolusi-diet-best-seller-5)&utmcs=UTF-8&utmsr=1366x768&utmvp=250x260&utmsc=24-bit&utmul=en-us&utmje=1&utmfl=15.0%20r0&utmdt=Iklan%20Baris%20on%20Kanal&utmhid=721933259&utmr=http%3A%2F%2Fwww.detik.com%2F&utmp=%2Fchanel_boxs%2F11%2F5%2F5 HTTP/1.1
Host: channelbox.iklanbaris.detik.com
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://channelbox.iklanbaris.detik.com/chanel_boxs/11/5/5
Cookie: __utma=146380193.2047366996.1410833007.1414117345.1414553890.5; __utmz=146380193.1414117345.4.2.utmcsr=google|utmccn=(organic)|utmcmd=organic; __auc=be689fde1487c3344056fe6eb4a; __utma=75318976.769333546.1410833011.1414117346.1414553895.5; __utmz=75318976.1414553895.5.5.utmcsr=detik.com|utmccn=(referral)|utmcmd=referral|utmcct=/; __utmb=146380193.6.7.1414566603953; __utmc=146380193; __asc=7187d84314959fb76b3f23383c8; __utmb=75318976.2.9.1414566604904; __utmc=75318976; dts-=_d%3D.; chs-=0c50b412769a6f19aa3fb763483e58f4; __utmt=1
Connection: keep-alive


Content Type = null
Info = OTHER
Header = GET /__utm.gif?utmwv=5.6.0&utms=3&utmn=1916121119&utmhn=channelbox.iklanbaris.detik.com&utmt=event&utme=5(channelbox%20iklanbaris*Impression*http%3A%2F%2Fiklanbaris.detik.com%2Fkategori%2Fsuplement-kesehatan%2Fiklan%2Fsolusi-diet-best-seller-5)&utmcs=UTF-8&utmsr=1366x768&utmvp=250x260&utmsc=24-bit&utmul=en-us&utmje=1&utmfl=15.0%20r0&utmdt=Iklan%20Baris%20on%20Kanal&utmhid=721933259&utmr=http%3A%2F%2Fwww.detik.com%2F&utmp=%2Fchanel_boxs%2F11%2F5%2F5&utmht=1414566604927&utmac=UA-891770-130&utmcc=__utma%3D75318976.769333546.1410833011.1414117346.1414553895.5%3B%2B__utmz%3D75318976.1414553895.5.5.utmcsr%3Ddetik.com%7Cutmccn%3D(referral)%7Cutmcmd%3Dreferral%7Cutmcct%3D%2F%3B&utmjid=&utmu=6AAAAAAgAAAAAAAAAAAAAAAE~ HTTP/1.1
Host: www.google-analytics.com
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://channelbox.iklanbaris.detik.com/chanel_boxs/11/5/5
Connection: keep-alive


Content Type = null
Info = OTHER
Header = GET /__utm.gif?utmwv=5.6.0&utms=4&utmn=257778609&utmhn=channelbox.iklanbaris.detik.com&utmt=event&utme=5(channelbox%20iklanbaris*Impression*http%3A%2F%2Fiklanbaris.detik.com%2Fkategori%2Falat-kesehatan%2Fiklan%2Foil-pembesar-mrp-raja-lintah-super-35)&utmcs=UTF-8&utmsr=1366x768&utmvp=250x260&utmsc=24-bit&utmul=en-us&utmje=1&utmfl=15.0%20r0&utmdt=Iklan%20Baris%20on%20Kanal&utmhid=721933259&utmr=http%3A%2F%2Fwww.detik.com%2F&utmp=%2Fchanel_boxs%2F11%2F5%2F5 HTTP/1.1
Host: channelbox.iklanbaris.detik.com
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://channelbox.iklanbaris.detik.com/chanel_boxs/11/5/5
Cookie: __utma=146380193.2047366996.1410833007.1414117345.1414553890.5; __utmz=146380193.1414117345.4.2.utmcsr=google|utmccn=(organic)|utmcmd=organic; __auc=be689fde1487c3344056fe6eb4a; __utma=75318976.769333546.1410833011.1414117346.1414553895.5; __utmz=75318976.1414553895.5.5.utmcsr=detik.com|utmccn=(referral)|utmcmd=referral|utmcct=/; __utmb=146380193.6.7.1414566603953; __utmc=146380193; __asc=7187d84314959fb76b3f23383c8; __utmb=75318976.3.8.1414566604904; __utmc=75318976; dts-=_d%3D.; chs-=0c50b412769a6f19aa3fb763483e58f4; __utmt=1
Connection: keep-alive


Content Type = null
Info = OTHER
Header = GET /__utm.gif?utmwv=5.6.0&utms=4&utmn=677276412&utmhn=channelbox.iklanbaris.detik.com&utmt=event&utme=5(channelbox%20iklanbaris*Impression*http%3A%2F%2Fiklanbaris.detik.com%2Fkategori%2Falat-kesehatan%2Fiklan%2Foil-pembesar-mrp-raja-lintah-super-35)&utmcs=UTF-8&utmsr=1366x768&utmvp=250x260&utmsc=24-bit&utmul=en-us&utmje=1&utmfl=15.0%20r0&utmdt=Iklan%20Baris%20on%20Kanal&utmhid=721933259&utmr=http%3A%2F%2Fwww.detik.com%2F&utmp=%2Fchanel_boxs%2F11%2F5%2F5&utmht=1414566604944&utmac=UA-891770-130&utmcc=__utma%3D75318976.769333546.1410833011.1414117346.1414553895.5%3B%2B__utmz%3D75318976.1414553895.5.5.utmcsr%3Ddetik.com%7Cutmccn%3D(referral)%7Cutmcmd%3Dreferral%7Cutmcct%3D%2F%3B&utmjid=&utmu=6AAAAAAgAAAAAAAAAAAAAAAE~ HTTP/1.1
Host: www.google-analytics.com
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://channelbox.iklanbaris.detik.com/chanel_boxs/11/5/5
Connection: keep-alive


Content Type = null
Info = OTHER
Header = GET /__utm.gif?utmwv=5.6.0&utms=5&utmn=1761040045&utmhn=channelbox.iklanbaris.detik.com&utmt=event&utme=5(channelbox%20iklanbaris*Impression*http%3A%2F%2Fiklanbaris.detik.com%2Fkategori%2Fperalatan-rumah-tangga%2Fiklan%2Fkredit-mesin-cuci-lg-162-ribu-bln)&utmcs=UTF-8&utmsr=1366x768&utmvp=250x260&utmsc=24-bit&utmul=en-us&utmje=1&utmfl=15.0%20r0&utmdt=Iklan%20Baris%20on%20Kanal&utmhid=721933259&utmr=http%3A%2F%2Fwww.detik.com%2F&utmp=%2Fchanel_boxs%2F11%2F5%2F5 HTTP/1.1
Host: channelbox.iklanbaris.detik.com
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://channelbox.iklanbaris.detik.com/chanel_boxs/11/5/5
Cookie: __utma=146380193.2047366996.1410833007.1414117345.1414553890.5; __utmz=146380193.1414117345.4.2.utmcsr=google|utmccn=(organic)|utmcmd=organic; __auc=be689fde1487c3344056fe6eb4a; __utma=75318976.769333546.1410833011.1414117346.1414553895.5; __utmz=75318976.1414553895.5.5.utmcsr=detik.com|utmccn=(referral)|utmcmd=referral|utmcct=/; __utmb=146380193.6.7.1414566603953; __utmc=146380193; __asc=7187d84314959fb76b3f23383c8; __utmb=75318976.4.7.1414566604904; __utmc=75318976; dts-=_d%3D.; chs-=0c50b412769a6f19aa3fb763483e58f4; __utmt=1
Connection: keep-alive


Content Type = null
Info = OTHER
Header = GET /__utm.gif?utmwv=5.6.0&utms=5&utmn=1880935665&utmhn=channelbox.iklanbaris.detik.com&utmt=event&utme=5(channelbox%20iklanbaris*Impression*http%3A%2F%2Fiklanbaris.detik.com%2Fkategori%2Fperalatan-rumah-tangga%2Fiklan%2Fkredit-mesin-cuci-lg-162-ribu-bln)&utmcs=UTF-8&utmsr=1366x768&utmvp=250x260&utmsc=24-bit&utmul=en-us&utmje=1&utmfl=15.0%20r0&utmdt=Iklan%20Baris%20on%20Kanal&utmhid=721933259&utmr=http%3A%2F%2Fwww.detik.com%2F&utmp=%2Fchanel_boxs%2F11%2F5%2F5&utmht=1414566604960&utmac=UA-891770-130&utmcc=__utma%3D75318976.769333546.1410833011.1414117346.1414553895.5%3B%2B__utmz%3D75318976.1414553895.5.5.utmcsr%3Ddetik.com%7Cutmccn%3D(referral)%7Cutmcmd%3Dreferral%7Cutmcct%3D%2F%3B&utmjid=&utmu=6AAAAAAgAAAAAAAAAAAAAAAE~ HTTP/1.1
Host: www.google-analytics.com
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://channelbox.iklanbaris.detik.com/chanel_boxs/11/5/5
Connection: keep-alive


Content Type = null
Info = OTHER
Header = GET /__utm.gif?utmwv=5.6.0&utms=6&utmn=373929153&utmhn=channelbox.iklanbaris.detik.com&utmt=event&utme=5(channelbox%20iklanbaris*Impression*http%3A%2F%2Fiklanbaris.detik.com%2Fkategori%2Fpeluang-bisnis%2Fiklan%2Fbelanja-bulanan-sambil-bisnis)&utmcs=UTF-8&utmsr=1366x768&utmvp=250x260&utmsc=24-bit&utmul=en-us&utmje=1&utmfl=15.0%20r0&utmdt=Iklan%20Baris%20on%20Kanal&utmhid=721933259&utmr=http%3A%2F%2Fwww.detik.com%2F&utmp=%2Fchanel_boxs%2F11%2F5%2F5 HTTP/1.1
Host: channelbox.iklanbaris.detik.com
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://channelbox.iklanbaris.detik.com/chanel_boxs/11/5/5
Cookie: __utma=146380193.2047366996.1410833007.1414117345.1414553890.5; __utmz=146380193.1414117345.4.2.utmcsr=google|utmccn=(organic)|utmcmd=organic; __auc=be689fde1487c3344056fe6eb4a; __utma=75318976.769333546.1410833011.1414117346.1414553895.5; __utmz=75318976.1414553895.5.5.utmcsr=detik.com|utmccn=(referral)|utmcmd=referral|utmcct=/; __utmb=146380193.6.7.1414566603953; __utmc=146380193; __asc=7187d84314959fb76b3f23383c8; __utmb=75318976.5.6.1414566604904; __utmc=75318976; dts-=_d%3D.; chs-=0c50b412769a6f19aa3fb763483e58f4; __utmt=1
Connection: keep-alive


Content Type = null
Info = OTHER
Header = HTTP/1.1 200 OK
Server: nginx/1.5.4
Date: Wed, 29 Oct 2014 07:09:43 GMT
Content-Type: image/gif
Content-Length: 35
Last-Modified: Mon, 14 Apr 2014 04:41:31 GMT
ETag: "534b66fb-23"
Expires: Thu, 31 Dec 2037 23:55:55 GMT
Cache-Control: max-age=315360000
Accept-Ranges: bytes
Connection: Keep-Alive
Age: 0


Content Type = image/gif
Info = GIF
Header = HTTP/1.1 200 OK
Server: nginx/1.5.4
Date: Wed, 29 Oct 2014 07:09:43 GMT
Content-Type: image/gif
Content-Length: 35
Last-Modified: Tue, 18 Feb 2014 10:45:22 GMT
ETag: "530339c2-23"
Accept-Ranges: bytes
Connection: Keep-Alive
Age: 0


Content Type = image/gif
Info = GIF
Header = HTTP/1.1 200 OK
Server: nginx/1.5.4
Date: Wed, 29 Oct 2014 07:09:43 GMT
Content-Type: image/gif
Content-Length: 35
Last-Modified: Mon, 14 Apr 2014 04:41:31 GMT
ETag: "534b66fb-23"
Expires: Thu, 31 Dec 2037 23:55:55 GMT
Cache-Control: max-age=315360000
Accept-Ranges: bytes
Connection: Keep-Alive
Age: 0


Content Type = image/gif
Info = GIF
Header = HTTP/1.1 200 OK
Server: nginx/1.5.4
Date: Wed, 29 Oct 2014 07:09:43 GMT
Content-Type: image/gif
Content-Length: 35
Last-Modified: Mon, 14 Apr 2014 04:41:31 GMT
ETag: "534b66fb-23"
Expires: Thu, 31 Dec 2037 23:55:55 GMT
Cache-Control: max-age=315360000
Accept-Ranges: bytes
Connection: Keep-Alive
Age: 0


Content Type = image/gif
Info = GIF
Header = HTTP/1.1 200 OK
Pragma: no-cache
Expires: Wed, 19 Apr 2000 11:43:00 GMT
Last-Modified: Wed, 21 Jan 2004 19:51:30 GMT
X-Content-Type-Options: nosniff
Content-Type: image/gif
Date: Sat, 25 Oct 2014 04:00:56 GMT
Server: Golfe2
Content-Length: 35
Cache-Control: private, no-cache, no-cache=Set-Cookie, proxy-revalidate
Age: 356928
Alternate-Protocol: 80:quic,p=0.01
Connection: Keep-Alive


Content Type = image/gif
Info = GIF
Header = HTTP/1.1 200 OK
Pragma: no-cache
Expires: Wed, 19 Apr 2000 11:43:00 GMT
Last-Modified: Wed, 21 Jan 2004 19:51:30 GMT
X-Content-Type-Options: nosniff
Content-Type: image/gif
Date: Fri, 24 Oct 2014 23:23:40 GMT
Server: Golfe2
Content-Length: 35
Cache-Control: private, no-cache, no-cache=Set-Cookie, proxy-revalidate
Age: 373564
Alternate-Protocol: 80:quic,p=0.01
Connection: Keep-Alive


Content Type = image/gif
Info = GIF
Header = HTTP/1.1 200 OK
Pragma: no-cache
Expires: Wed, 19 Apr 2000 11:43:00 GMT
Last-Modified: Wed, 21 Jan 2004 19:51:30 GMT
X-Content-Type-Options: nosniff
Content-Type: image/gif
Date: Fri, 24 Oct 2014 23:23:20 GMT
Server: Golfe2
Content-Length: 35
Cache-Control: private, no-cache, no-cache=Set-Cookie, proxy-revalidate
Age: 373584
Alternate-Protocol: 80:quic,p=0.01
Connection: Keep-Alive


Content Type = image/gif
Info = GIF
Header = HTTP/1.1 200 OK
Pragma: no-cache
Expires: Wed, 19 Apr 2000 11:43:00 GMT
Last-Modified: Wed, 21 Jan 2004 19:51:30 GMT
X-Content-Type-Options: nosniff
Content-Type: image/gif
Date: Sat, 25 Oct 2014 03:41:06 GMT
Server: Golfe2
Content-Length: 35
Cache-Control: private, no-cache, no-cache=Set-Cookie, proxy-revalidate
Age: 358118
Alternate-Protocol: 80:quic,p=0.01
Connection: Keep-Alive


Content Type = image/gif
Info = GIF
Header = GET /__utm.gif?utmwv=5.6.0&utms=6&utmn=434199237&utmhn=channelbox.iklanbaris.detik.com&utmt=event&utme=5(channelbox%20iklanbaris*Impression*http%3A%2F%2Fiklanbaris.detik.com%2Fkategori%2Fpeluang-bisnis%2Fiklan%2Fbelanja-bulanan-sambil-bisnis)&utmcs=UTF-8&utmsr=1366x768&utmvp=250x260&utmsc=24-bit&utmul=en-us&utmje=1&utmfl=15.0%20r0&utmdt=Iklan%20Baris%20on%20Kanal&utmhid=721933259&utmr=http%3A%2F%2Fwww.detik.com%2F&utmp=%2Fchanel_boxs%2F11%2F5%2F5&utmht=1414566604996&utmac=UA-891770-130&utmcc=__utma%3D75318976.769333546.1410833011.1414117346.1414553895.5%3B%2B__utmz%3D75318976.1414553895.5.5.utmcsr%3Ddetik.com%7Cutmccn%3D(referral)%7Cutmcmd%3Dreferral%7Cutmcct%3D%2F%3B&utmjid=&utmu=6AAAAAAgAAAAAAAAAAAAAAAE~ HTTP/1.1
Host: www.google-analytics.com
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://channelbox.iklanbaris.detik.com/chanel_boxs/11/5/5
Connection: keep-alive


Content Type = null
Info = OTHER
Header = HTTP/1.1 200 OK
Pragma: no-cache
Expires: Wed, 19 Apr 2000 11:43:00 GMT
Last-Modified: Wed, 21 Jan 2004 19:51:30 GMT
X-Content-Type-Options: nosniff
Content-Type: image/gif
Date: Sat, 25 Oct 2014 03:41:06 GMT
Server: Golfe2
Content-Length: 35
Cache-Control: private, no-cache, no-cache=Set-Cookie, proxy-revalidate
Age: 358118
Alternate-Protocol: 80:quic,p=0.01
Connection: Keep-Alive


Content Type = image/gif
Info = GIF

Advertisements

Fetching Drop Call Event Issue on Android 2.3 above

Drop call event is an event that occurred when an active call is cut. Whether it is cut from caller or recipient or something else that cause the event occurred. Nowadays, there are many programming forums talking about the issue “how to get drop call cause event on android”. But unfortunatelly, they can’t answer the question correctly, even though there are a few people that almost give good answer ( that’s what I tough ). As we know that there are many drop call causes from explanation of android API it self. But in this case, the main problem is Android API that provide drop call cause is no more available on Android 2.3 or above. Because Google has made it to be hidden API from package android.telephony.
A few week ago, I also looking for the solution about this issue. I had done some small research to solve it. Based on my research, I’ve founded 3 solutions for this issue. The first is by accessing radio interface layer on Android ( we can use RIL ) . The second is by reading logcat from the device it self. The third is by using radio command ( AT Command ) to directly communicate through modem device. In this opportunity, I’d like to share you how to get drop call cause with the second idea which is by reading logcat.
1. Giving root access to Android device. We can use Kingo Root application
2. Create android project ( I use Android Studio ) with blank activity. Because we will create the activity.xml later.
MyActivity.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <Button
        android:id="@+id/btReadLog"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Start Listening"/>

    <Button
        android:id="@+id/btClearLog"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Clear Log"/>  
</LinearLayout>

DropCallCause.java

public class ActDropCallCause extends Activity {

    private List<String> dropCallCauseList;
    private Button btReadLog;
    private Button btClearLog;   
    Calendar now;
    Calendar afterXSecond;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.myactivity);
        btReadLog = (Button) findViewById(R.id.btReadLog);
        btReadLog.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                readDropCallCauseList();
            }
        });

        btClearLog = (Button) findViewById(R.id.btClearLog);
        btClearLog.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                doClearLog();
            }

        });        
    }
	
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.drop_call_cause, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        int id = item.getItemId();
        if (id == R.id.action_settings) {
            return true;
        }
        return super.onOptionsItemSelected(item);
    }

    public void doClearLog() {
        try {
            Runtime.getRuntime().exec("logcat -c");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    /*Reading Logcat OnDisconnect Event ( Dropped Call ) for the last 5 minutes*/
    public void readDropCallCauseList(){
        dropCallCauseList = new ArrayList<String>();
        doClearLog();
        try {
            Process process = Runtime.getRuntime().exec("su -c logcat");
            BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream()));
            String line;
            afterXSecond = Calendar.getInstance();
            afterXSecond.add(Calendar.SECOND, 60);
            now = Calendar.getInstance();

            while ( ( (line = bufferedReader.readLine()) != null ) && ( now.getTime().compareTo(afterXSecond.getTime()) <= 0 ) ) {
                if ( (line.contains("CallNotifier")) && line.contains("onDisconnect: cause")) {
                    Log.d("INCREMENT", String.valueOf(dropCallCauseList.size()));
                    line = new Date().toString()+line;
                    line=line.replace("/", ":").trim();
                    line = line.replaceAll("\\s+", "");
                    dropCallCauseList.add(line+"::");
                    Log.d("DCC", line);
                }
                now = Calendar.getInstance();
            }
            doClearLog();
            Log.d("SCHEDULER DCC", "CLEAR LOG");
            sendDropCallCause();
            Log.d("SCHEDULER DCC", "SENDING DCC");
            dropCallCauseList.clear();
            readDropCallCauseList();
            Log.d("SCHEDULER DCC", "START READING DCC");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

3. Run the project as Android application and do simulation.

Note : all solutions that I said above require root access to the device.

Matrix dan Implementasinya dalam Pemrograman JAVA ( Part III )

11. Determinan ( Matrix ) adalah suatu fungsi tertentu yang menghubungkan suatu bilangan real dengan suatu matriks bujur sangkar ( Wikipedia ). Berikut contoh determinan dari suatu matrix

import java.util.Random;

public class MatrixDeterminan2{

	public static void main( String [] args ){
		int ordo = Integer.parseInt( args[0] );
		int[][] matrix = createMatrix( ordo );
		showMatrix( matrix, 2);
		System.out.println( "Determinan Is " + getDeterminan( matrix ) );
	}
	
	static int[][] createMatrix( int ordo ){
		int [][] result = new int[ordo][ordo];
		for ( int a=0; a<ordo; a++ ){
			for ( int b=0; b<ordo; b++){
				result[a][b] = new Random().nextInt(9) + 1;
			}
		}
		return result;
	}
		
	static int getDeterminan( int[][] matrixOrdo2 ){
		int result = ( matrixOrdo2[0][0] * matrixOrdo2[1][1]) - ( matrixOrdo2[0][1] * matrixOrdo2[1][0] );
		return result;
	}
	
	static void showMatrix( int [][] matrix, int ordo){
		for ( int a=0; a<ordo; a++ ){
			for ( int b=0; b<ordo; b++ ){
				System.out.print( matrix[a][b] + " ");
			}
			System.out.println();
		}
	}
	
}


12. Matrix Invers ( Kebalikan ) adalah matrix yang jika A dan B matriks bujur sangkar sedemikian rupa sehingga A B = B A = I ( Matrix Identitas ), maka B disebut balikan atau invers dari A dan dapat dituliskan B = A(invers).

import java.util.Random;

public class MatrixInvers2{

	public static void main( String [] args ){
		int ordo = Integer.parseInt( args[0] );
		double [][] matrix = createMatrix( ordo );
		showMatrix( matrix, ordo );
		double determinan = getDeterminan( matrix );
		System.out.println( "Determinan Is " +  determinan );
		double [][] invers = createInvers ( ordo, determinan, matrix );
		System.out.println( "Invers is" );
		showMatrix( invers, ordo );
	}
	
	static double[][] createMatrix( int ordo ){
		double [][] result = new double[ordo][ordo];
		for ( int a=0; a<ordo; a++ ){
			for ( int b=0; b<ordo; b++){
				result[a][b] = new Random().nextInt(9) + 1;
			}
		}
		return result;
	}
		
	static double getDeterminan( double [][] matrixOrdo2 ){
		double result = ( matrixOrdo2[0][0] * matrixOrdo2[1][1]) - ( matrixOrdo2[0][1] * matrixOrdo2[1][0] );
		return result;
	}
	
	static void showMatrix( double [][] matrix, int ordo){
		for ( int a=0; a<ordo; a++ ){
			for ( int b=0; b<ordo; b++ ){
				System.out.print( matrix[a][b] + " ");
			}
			System.out.println();
		}
	}
	
	static double[][] createInvers ( int ordo, double determinan, double[][] matrix ){
		double [][] result = new double[ordo][ordo];
		System.out.println( "Switching index position" );
		double temp = matrix[0][0];
		matrix[0][0] = matrix[1][1];
		matrix[1][1] = temp;				
		matrix[1][0] = -1 * matrix[1][0];
		matrix[0][1] = -1 * matrix[0][1];
		System.out.println( "After switching index position" );
		showMatrix( matrix, 2);
		double vector = 1/ determinan;
		for ( int a=0; a<ordo; a++ ){
			for ( int b=0; b<ordo; b++ ){
				result[a][b] = vector * matrix[a][b];
			}
		}
		return result;
	}
	
	
}

13. Matrix invers untuk matrix 3 x 3 harus diproses menggunakan proses pencarian adjoin/ kofator.

import java.util.Random;

public class MatrixInvers3{

	public static void main ( String [] args ){
		int ordo = 3;
		double [][] matrix = createMatrix( ordo );
		showMatrix( ordo, ordo, matrix );
		System.out.println("=====================");
		double [][] matrixToAdjunctionCramer = createMatrixToAdjunctionCramer( ordo, matrix );		
		showMatrix( ordo, 5,  matrixToAdjunctionCramer );
		System.out.println("=====================");
		double determinan = getDeterminan( 3, 5, matrixToAdjunctionCramer );
		System.out.println( "Determinant is : "+ determinan );
		double[][] transposedMatrix = createTransposeMatrix( matrix, ordo );
		System.out.println("TRANSPOSE MATRIX=====================");
		showMatrix( ordo, ordo, transposedMatrix );
		
		double [][] adjMatrix = getAdjunction( transposedMatrix, ordo );
		System.out.println("ADJ MATRIX=====================");
		showMatrix( ordo, ordo, adjMatrix );
		double[][] inversMatrix = getInvers( adjMatrix, determinan, 	ordo );
		System.out.println("INVERS MATRIX=====================");
		showMatrix( ordo, ordo, inversMatrix );
	}
	
	public static double [][] createMatrix( int ordo ){
		double [][] result = new double[ordo][ordo];
		for ( int a=0; a<ordo; a++ ){
			for ( int b=0; b<ordo; b++ ){
				result[a][b] = new Random().nextInt(9)+1;
			}
		}
		return result;
	}
	
	public static void showMatrix( int bar, int kol, double [][] matrix ){
		for( int a=0; a<bar; a++ ){
			for( int b=0; b<kol; b++ ){
				System.out.print( matrix[a][b] + " ");
			}
			System.out.println("");
		}
	}
	
	public static double[][] createMatrixToAdjunctionCramer( int ordo, double [][] matrix ){
		int newOrdo = ordo+2;
		double[][] result = new double[ordo][newOrdo];
		for ( int a=0; a<ordo; a++ ){
			for ( int b=0; b<newOrdo; b++ ){
				if( b < 3 ){
					result[a][b] = matrix[a][b];
				}else{
					result[a][b] = matrix[a][b-3];					
				}
			}
		}
		return result;
	}
	
	public static double getDeterminan( int bar, int kol, double[][] matrix ){
		double result = 0.0;		
		result = ( ( matrix[0][0] * matrix[1][1] * matrix[2][2] ) + 
					( matrix[0][1] * matrix[1][2] * matrix[2][3] ) + 
					( matrix[0][2] * matrix[1][3] * matrix[2][4] ) ) - 
				 ( ( matrix[2][0] * matrix[1][1] * matrix[0][2] ) +
					( matrix[2][1] * matrix[1][2] * matrix[0][3] ) +
					( matrix[2][2] * matrix[1][3] * matrix[0][4] ) );				
		return result;
	}

	public static double [][] createTransposeMatrix( double[][] matrix, int ordo ){
		double [][] result = new double[ordo][ordo];
		for ( int a=0; a<ordo; a++ ){
			for ( int b=0; b<ordo; b++ ){
				result[a][b] = matrix[b][a];
			}
		}
		return result;
	}
	public static double [][] getInvers( double[][] adjMatrix, double determinan, int ordo ){
		double multiplier = 1/determinan;
		double[][] result = new double[ordo][ordo];
		for ( int a=0; a<ordo; a++ ){
			for ( int b=0; b<ordo; b++ ){
				result[a][b] = multiplier * adjMatrix[a][b];
			}
		}
		return result;
	}
	
	public static double [][] getAdjunction( double [][] transposedMatrix, int ordo ){
		double[][] adjunction = new double[ordo][ordo];
		adjunction[0][0]=transposedMatrix[1][1]*transposedMatrix[2][2]-(transposedMatrix[2][1]*transposedMatrix[1][2]);
		adjunction[0][1]=(-1)*(transposedMatrix[1][0]*transposedMatrix[2][2]-(transposedMatrix[2][0]*transposedMatrix[1][2]));
		adjunction[0][2]=transposedMatrix[1][0]*transposedMatrix[2][1]-(transposedMatrix[2][0]*transposedMatrix[1][1]);
		
		adjunction[1][0]=(-1)*(transposedMatrix[0][1]*transposedMatrix[2][2]-transposedMatrix[2][1]*transposedMatrix[0][2]);
		adjunction[1][1]=transposedMatrix[0][0]*transposedMatrix[2][2]-transposedMatrix[2][0]*transposedMatrix[0][2];
		adjunction[1][2]=(-1)*(transposedMatrix[0][0]*transposedMatrix[2][1]-transposedMatrix[2][0]*transposedMatrix[0][1]);

		adjunction[2][0]=transposedMatrix[0][1]*transposedMatrix[1][2]-transposedMatrix[1][1]*transposedMatrix[0][2];
		adjunction[2][1]=(-1)*(transposedMatrix[0][0]*transposedMatrix[1][2]-transposedMatrix[1][0]*transposedMatrix[0][2]);
		adjunction[2][2]=transposedMatrix[0][0]*transposedMatrix[1][1]-transposedMatrix[1][0]*transposedMatrix[0][1];
		
		return adjunction;
	}	
}

Program Angka Terbilang dalam bahasa JAVA

Program angka terbilang ini merupakan program yang dapat mentranslasikan angka masukan dari user untuk menjadi bilangan alphabet. misal : 1217 terbilang ” seribu dua ratus tujuh belas”. Proses translasi program ini, menggunakan proses matematika yang mudah yakni hanya operasi division ( pembagian ) dan modulus ( sisa bagi ). Berikut contoh programnya :

public class AngkaTerbilang{

	public static void main( String [] args ){
		int angka = Integer.parseInt( args[0] );
		System.out.println( angka +" terbilang : "+ terbilang( angka ) );
	}
	
	public static String terbilang(int value){
		String terbilang = "";			
		if ( value <12 ) {
			terbilang = " "+ bilang( value );
		}else if ( value<20 ){
			terbilang = terbilang( value - 10 )+" belas ";
		}else if ( value<100 ){
			terbilang = terbilang( value/10 )+" puluh "+terbilang( value % 10 );
		}else if ( value<200 ){
			terbilang = " seratus "+terbilang( value - 100 );
		}else if ( value<1000 ){
			terbilang = terbilang( value/100 )+" ratus "+terbilang(value % 100);
		}else if ( value<2000 ){
			terbilang = " seribu "+ terbilang(value-1000);
		}else if ( value<1000000 ){
			terbilang = terbilang( value/1000 )+" ribu "+terbilang(value % 1000);
		}else if ( value< 1000000000 ){
			terbilang = terbilang( value/1000000)+" juta "+ terbilang( value % 1000000);
		}else {
			terbilang = terbilang( value/1000000000)+ " milyar "+ terbilang( value%1000000000 );
		}
		return terbilang;
	}
	
	static String bilang(int value){
		String bilang = "";
			switch ( value ){
				case 0 : bilang = ""; break;
				case 1 : bilang = "satu"; break;
				case 2 : bilang = "dua"; break;
				case 3 : bilang = "tiga"; break;
				case 4 : bilang = "empat"; break;
				case 5 : bilang = "lima"; break;
				case 6 : bilang = "enam"; break;
				case 7 : bilang = "tujuh"; break;
				case 8 : bilang = "delapan"; break;
				case 9 : bilang = "sembilan"; break;
				case 10 : bilang = "sepuluh"; break;
				case 11 : bilang = "sebelas"; break;
				default : bilang = "tidak terdefinisi";
			}
		return bilang;
	}		
}

Matrix dan Implementasinya dalam pemrograman JAVA ( PART II )

5. Matrix Skalar adalah matrix yang mengalami proses perkalian dengan 1 angka konstanta.

public class matrixScalar1{
	
	public static void main( String [] args ){
		int value = Integer.parseInt( args[0] );
		int [][] matrix = { {1,2,3}, {1,2,3} };
		processMultiply( value, matrix );
		displayMatrix( matrix );
	}
	
	public static void processMultiply( int value, int [][] matrix){		
		for (int a=0; a<2; a++){
			for(int b=0; b<3; b++){
				matrix[a][b] = matrix[a][b] * value;
			}
		}
	}
	
	public static void displayMatrix( int [][] matrix ){
		for(int a=0; a<2; a++){
			for(int b=0; b<3; b++){
				System.out.print(matrix[a][b] + " ");
			}
			System.out.println();
		}
	}
}

6. Matrix Scalar kedua, yaitu perkalian antar matrix dengan syarat baris x kolom = kolom x baris

import java.util.Scanner;

public class matrixScalar2{
	
	private static Scanner scan;
	
	public static void main( String [] args ){
		int bar1 = Integer.parseInt( args[0] );
		int kol1 = Integer.parseInt( args[1] );
		int bar2 = Integer.parseInt( args[2] );
		int kol2 = Integer.parseInt( args[3] );
		if ( kol1 != bar2 ){
			System.out.println ("Kolom matrix 1 != Baris matrix 2");
		}else{
			scan = new Scanner( System.in );
			System.out.println( "Input Matrix 1" );
			int [][] matrix1 = inputMatrix( bar1, kol1 );
			System.out.println( "Input Matrix 2" );
			int [][] matrix2 = inputMatrix( bar2, kol2 );
			System.out.println ( "Matrix 1:");
			displayMatrix( matrix1, bar1, kol1 );
			System.out.println ( "Matrix 2:");
			displayMatrix( matrix2, bar2, kol2 );
			int [][] result = processMultiply ( matrix1, matrix2, bar1, kol1, kol2 );
			System.out.println ( "Result Matrix Scalar :");
			displayMatrix( result, bar1, kol1 );
		}		
	}
	
	public static int [][] inputMatrix( int bar, int kol ){		
		int[][] matrix = new int[bar][kol];
		for (int a=0; a<bar; a++){
			for(int b=0; b<kol; b++){
				System.out.print("input index ["+a+","+b+"] =");
				matrix[a][b] = scan.nextInt();
			}
		}
		return matrix;
	}
	
	public static int [][] processMultiply( int [][] matrix1, int [][] matrix2, int bar, int kol, int kol2 ){
		int [][] result = new int[bar][kol];
		for ( int a=0; a<bar; a++ ){
			for ( int b=0; b<kol2; b++ ){
				for ( int c=0; c<kol; c++){
					result[a][b] = result[a][b] + matrix1[a][c] * matrix2[c][b];
				}
			}
		}
		return result;
	}
	
	public static void displayMatrix( int [][] matrix, int bar, int kol ){
		for(int a=0; a<bar; a++){
			for(int b=0; b<kol; b++){
				System.out.print(matrix[a][b] + " ");
			}
			System.out.println();
		}
	}
}


7. Matrix Segitiga Bawah adalah matrix yang semua elemen dibawah dialonal utamanya adalah 0

import java.util.Random;
public class matrixSegitigaBawah{	
	public static void main( String [] args ){
		int ordo = Integer.parseInt( args[0] );
		int [][] matrix = createMatrix( ordo );
		displayMatrix( matrix, ordo );
	}
	
	public static int[][] createMatrix( int ordo ){
		int [][] result = new int[ordo][ordo];
		for(int a=0; a<ordo; a++){
			for(int b=0; b<ordo; b++){
				if ( ( b<a ) ){
					result[a][b] = 0;
				}else{
					result[a][b] = new Random().nextInt(9) + 1;
				}
			}
		}
		return result;
	}
	
	public static void displayMatrix( int [][] matrix, int ordo ){
		for(int a=0; a<ordo; a++){
			for(int b=0; b<ordo; b++){
				System.out.print(matrix[a][b] + " ");
			}
			System.out.println();
		}
	}
}


8. Matrix Segitiga Atas adalah matrix yang semua elemen diatas diagonal utamanya adalah nol

import java.util.Random;
public class MatrixSegitigaAtas{
	
	public static void main( String [] args ){
		int ordo = Integer.parseInt( args[0] );
		int [][] matrix = createMatrix( ordo );
		displayMatrix( matrix, ordo );
	}
	
	public static int[][] createMatrix( int ordo ){
		int [][] result = new int[ordo][ordo];
		for(int a=0; a<ordo; a++){
			for(int b=0; b<ordo; b++){
				if ( ( a<b ) ){
					result[a][b] = 0;
				}else{
					result[a][b] = new Random().nextInt(9) + 1;
				}
			}
		}
		return result;
	}
	
	public static void displayMatrix( int [][] matrix, int ordo ){
		for(int a=0; a<ordo; a++){
			for(int b=0; b<ordo; b++){
				System.out.print(matrix[a][b] + " ");
			}
			System.out.println();
		}
	}
}


9. Matrix Transpose adalah matrix yang mana posisi elemen baris ditukar dengan posisi elemen kolom

import java.util.Scanner;
public class MatrixTranspose{
	private static Scanner scan;
	
	public static void main( String [] args ){
		int bar = Integer.parseInt( args[0] );
		int kol = Integer.parseInt( args[1] );

		scan = new Scanner ( System.in );
		
		int [][] initMatrix = createInitMatrix( bar, kol );
		int [][] transposedMatrix = doTranspose( initMatrix, bar, kol );		
		System.out.println ( "Origin Matrix is :" );
		displayMatrix ( initMatrix, bar, kol );
		System.out.println ( "Transposed Matrix is :" );
		displayMatrix ( transposedMatrix, kol, bar );
	}
	
	public static int[][] createInitMatrix ( int bar, int kol ){
		int [][] result = new int [bar][kol];
		for (int a=0; a<bar; a++){
			for ( int b=0; b<kol; b++){
				System.out.print("input index ["+a+","+b+"] =");
				result[a][b] = scan.nextInt();
			}
		}
		return result;
	}
	
	public static int[][] doTranspose ( int[][] matrix, int bar, int kol ){
		int[][] result = new int[kol][bar];
		for ( int a=0; a< bar; a++ ){
			for ( int b=0; b< kol; b++ ){
				result[b][a] = matrix[a][b];
			}
		}
		return result;
	}
	
	public static void displayMatrix( int [][] matrix, int bar, int kol ){
		for(int a=0; a<bar; a++){
			for(int b=0; b<kol; b++){
				System.out.print(matrix[a][b] + " ");
			}
			System.out.println();
		}
	}
	
}


10. Matrix Simetris adalah matrix yang jumlah baris dan kolomnya sama.

public class MatrixSimetris{

	public static void main(String [] args)	{
		int ordo = Integer.valueOf(args[0]);
		int [][] matrix = createMatrixSimetris(ordo);
		displayMatriSimetris( matrix, ordo);
	}
	
	public static int[][] createMatrixSimetris(int ordo){
		int [][] result = new int[ordo][ordo];
		for (int a=0; a<ordo; a++){
			for (int b=0; b<ordo; b++){
				result[a][b] = new Random().nextInt(9)+1;
			}
		}
		return result;
	}
	
	public static void displayMatriSimetris(int [][] matrix, int ordo){
		for (int a=0; a<ordo; a++){
			for (int b=0; b<ordo; b++){
				System.out.print(matrix[a][b]+"  ");
			}
			System.out.println("");
		}
	}
	
}