Format Large Drives to Fat32

28 03 2008

wonder why Win cannot format large drives to Fat32.

Anyways,  follow instructions here





Email Address

25 03 2008

var reg

= new

RegExp(‘^([a-zA-Z0-9_\\.\\-])+\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$’);





TinyMCE – r has no properties

25 03 2008

Occurs in firefox when there’s a textarea in a hidden div.

Change in tiny_mce.js


IsCollapsed: function () (
This.getRng var r = ();
if(r.item)return false;
return r.boundingWidth==0||this.getSel().isCollapsed
)

to


IsCollapsed: function () (
This.getRng var r = ();
if(r==null||r.item)return false;
return r.boundingWidth==0||this.getSel().isCollapsed
)





Sort Multiple Fields With Collections.sort

25 03 2008

ComparatorChain chain = new ComparatorChain();
Comparator comp = new BeanComparator("firstname", new NullComparator(true));
chain.addComparator(comp,true);
comp = new BeanComparator("lastname", new NullComparator(true));
chain.addComparator(comp);
Collections.sort(customerlist,chain);

NullComparator(true) <– true places null values at the front of the list
chain.addComparator(comp,true); <– true reverse the list
customerlist = list of dynabeans





Custom Format Number

25 03 2008

DecimalFormatSymbols sym = new DecimalFormatSymbols();
sym.setGroupingSeparator('-');
NumberFormat accFormatter = new DecimalFormat("###,###,####,######",sym);
BigDecimal num = new BigDecimal("1111111111111111");
String formattedNum = accFormatter.format(num);

formattedNum = 111-111-1111-111111