misc

Asiasoft and Ragnarok Online 2, Downloaded 4GBs and Got Nothing.

Today i got a surprising announcement from Asiasoft, somehow Ragnarok Online 2 OpenBeta only available for FOUR South East Asia countries, despite there are eleven countries on SEA



A little bit weird because on their previous facebook status, they said that it will be a “Free to play for All”,



There was no notification whatsoever regarding country limitation for Open Beta before, and i already downloaded 4gbs installer for RO2 client. So basically i spent whole night downloading on my crappy internet connection and i got nothing Hahahaaa.

And i guess it’s just their way of saying "Asgardians! Thank you for helping us out in the stress testing! We have found a problem to solve, and we can't solve it. So we are now going to IP Block most of you instead.".



eBook Apa yang Cocok bagi Pemula yang Baru Belajar Java?

Kebetulan lagi rame di kaskus programmer forum, tentang ebook yang cocok untuk pemula. Supaya ga jawab berulang-ulang, mending gw tulis disini aja deh.

Untuk melatih pondasi, coba baca bukunya donald knuth
Donald Knuth

lalu lanjut ke buku-nya deitel deitel, java how to program
Deitel Deitel

klo dah faseh naik ke bukunya gang of four, bruce eckel dan kathy sierra
Gang of Four

Bruce Eckel

kathy sierra

klo ada waktu iseng, buknya Joshua Bloch seru juga
Joshua Bloch

kemudian lanjut ke bukunya craig walls dan gavin king
Craig Walls

Gavin King

kalo dah faseh abis itu langsung ke bukunya Debu Panda dan Reza Rahman
EJB3

Semoga membantu untuk para calon-calon programmer diluar sana, Maju Terus Ilmu Pengetahuan Indonesia…!!

How To Check Window’s Opened Comm Port using Java

On my latest project, i need to connect my java application to a GSM Modem, in order to sending and receiving SMS text. But before my application connected to opened comm port, i need to check which port number is opened. So this is a small java class to check my opened comm port. Btw, im using rtxt libraries to help me communicate with the opened port.

import gnu.io.CommPortIdentifier;
import java.util.Enumeration;

public class Main {
    
    private void doSomething() {
        Enumeration portList = CommPortIdentifier.getPortIdentifiers();
        System.out.println(portList.hasMoreElements());
        while (portList.hasMoreElements()) {
            CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement();
            System.out.println(portId.getName());
        }
    }
    
    public static void main(String[] args) {
        Main main = new Main();
        main.doSomething();
    }
}

Dont forget to add rxtx libraries your java’s path. You can find the Window’s installation path, here.

Hope it helps other, have fun πŸ™‚

A Weird Exception When Using Java’s BigDecimal, java.lang.ArithmeticException: Rounding necessary

I found this weird exception when im trying to convert double values to BigDecimal,

java.lang.ArithmeticException: Rounding necessary
	at java.math.BigDecimal.divideAndRound(BigDecimal.java:1439)
	at java.math.BigDecimal.setScale(BigDecimal.java:2394)
	at java.math.BigDecimal.setScale(BigDecimal.java:2437)

This is my java code

BigDecimal bgAvg = new BigDecimal(0);
bgAvg = bgAvg.add(new BigDecimal(myDoubleValue).setScale(2));

Somehow the error is gone after i changed my code into this

BigDecimal bgAvg = new BigDecimal(0);
bgAvg = bgAvg.add(BigDecimal.valueOf(myDoubleValue).setScale(2));

Hope it helped others, have fun with Java πŸ˜‰