I just bought Samsung Galaxy Mini last week and i found this phone is so fu*ckin cool.

Why i said that because its ability compare to the price is so worth, I bought it with Rp 1.5 million here in Jakarta. If you are a fan of android and want to play around with rooting and other stuff with but still have a cool phone, then this is one of its.

But the first thing that i dont like from this phone is i cannot set my ringtones or sms tones with my own mp3 file and there’s no menu to do this.

Non-terminating decimal expansion

| January 26th, 2011

When i use BigDecimal object in my code and try to divide() i got following error

Exception in thread "main" java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result.
at java.math.BigDecimal.divide(BigDecimal.java:1594)

Based on BigDecimal API (I used JDK 1.6) it said

The BigDecimal class gives its user complete control over rounding behavior. If no rounding mode is specified and the exact result cannot be represented, an exception is thrown; otherwise, calculations can be carried out to a chosen precision and rounding mode by supplying an appropriate MathContext  object to the operation. In either case, eight rounding modes are provided for the control of rounding. Using the integer fields in this class (such as ROUND_HALF_UP) to represent rounding mode is largely obsolete; the enumeration values of the RoundingMode enum, (such as RoundingMode.HALF_UP) should be used instead.

There are 2 approaches to do this
1) Using DIV (I like this one)

<rich:modalPanel id="panelId" width="600" height="600">
	<f:facet name="header">
			<h:outputText value="Title Here" />
	</f:facet>
	<f:facet name="controls">
		<h:panelGroup>
			<h:graphicImage value="/img/close.png" styleClass="hidelink" id="hidelink"/>
			<rich:componentControl for="panelId" attachTo="hidelink" operation="hide" event="onclick"/>
		</h:panelGroup>
	</f:facet>
	<h:outputText>
		<div style="width:400px;height:290px;overflow:auto;">
		<h:panelGrid columns="2" columnClasses="name,value">
			<h:outputText value="Value here" />
			<h:outputText value="Value here" />
		</h:panelGrid>
		</div>
	</h:outputText>
</rich:modalPanel>

Using this approach, if you dont manage the div size properly, your DIV wont fit perfectly to the modal panel size and DIV position will look ugly. I used this trick to set the DIV position so it will look nice

  1. Set modal panel WIDTH to what ever you want
  2. Use minHeight instead of HEIGHT for modal panel and the value MUST smaller than your DIV HEIGTH.
  3. Use autosized=”true” in modal panel

<rich:modalPanel id=”panelId” width=”600″ minHeight=”100″ autosized=”true”>

If you want to disable xwindows on startup but still be able to start xwindows with startx command when you need it, use the following steps

sudo vi /etc/inittab

Find a line

id:5:initdefault:

Change with

id:3:initdefault:

Save the file and reboot

iRobot Android Tablet (APad)

| July 20th, 2010

aPad

I found this interesting gadget called iRobot Android Tablet a.k.a APad from this link and this link

With very very reasonable price, this gadget can be a threat to iPad if they keep selling with that high price.

I hope, many company out there will produce the same gadget with android inside and good price.

iPad is still not worth to buy with that high price. Only to open eBook (mostly pdf) and internet cost me more than $450 ?? Hell No !!

I think similiar gadget like Amazon kindle, iPad, or this APad will become populer gadget in the future.