這桌子真的很cyber,很cool,而且也很實用, 我很喜歡從相機load相的方法,很方便 =)
http://www.popularmechanics.com/technology/industry/4217348.html
平日忙忙碌碌,
喜歡趣味數學和新科技,
但最喜歡還是和森森仔在草原奔跑...
這桌子真的很cyber,很cool,而且也很實用, 我很喜歡從相機load相的方法,很方便 =)
http://www.popularmechanics.com/technology/industry/4217348.html
上星期五(2007-10-12) Oracle向BEA提出收購, 作價$17, 比市價高出25%. 其實BEA的主要産品BEA Weblogic Server和Oracle現有産品Oracle Application Server功能上重疊, 我估計是次收講主要是買客.
Oracle和Sun一直在J2EE的市埸的市佔率不高, 在受到開源Application Server(如: JBoss, Geronimo, GlassFish, JOnAS…) 的沖激下, 他們只有兩條路: 一是開源; 一是和其他商業J2EE Server合併. Sun選擇了前者, Oracle大慨選擇了後者.
BEA Weblogic原本是這個市埸的一哥, 可是2006年頭已被IBM Websphere和JBoss趕上了. Oracle和BEA合併後的市佔率相信會躍升回第一位, 足可和IBM和JBoss抗衡, 而相信合併後Oracle在J2EE的影響力亦可提昇不少.
在J2EE市場天下三分(Oracle+BEA, IBM, JBoss)的情況下, 可以預期未來Sun在J2EE的生存空間將會更少.
雖然J2EE standard是由JCP訂立, 可是由Sun一直有使用其影響力去影響Java的發展. 不過由一個沒有什麼生存空間的公司去帶領JCP, 實在可笑. 長遠來說對J2EE發展也不健康. 舉例來說Java世界已有很多不是"JCP標準"的"defacto標準" 他們正是因爲補充JCP的不足而出現, 好像Struts, Spring. 雖然很多Programmer都用它, 但Sun的J2EE Tutorial 從不提它們. 有時JCP會因為利益關係而不用defacto standard, 反而另訂的個新API (好像Log4J vs Java 1.4 logging API, Hibernate vs JPA 等), 這令Java界的使用者不知跟隨誰, 不但苦了初學者, 也苦了使用J2EE的公司, 不利J2EE發展.
The Microsoft Office Live team has created a free book entitled "Build a Web site That Sells" that may be useful in web design classes. The book "includes tips, techniques, and tools to help you design an effective and engaging Web site, generate more Web site traffic, maximize search engine results, provide a more secure online experience, and much more."
It's designed in part for customers of the Windows Office Live program which offers both free and paid services for business professionals but includes a lot of information that is useful for anyone who wants to create a professional or professional looking web site. Just the sort of supplemental material for a web design course. And of course the price (FREE) makes it the kind of tool schools can afford.
Download the book from here.
I copied this entry from Free Book On Building Great Web Sites (Alfred Thompson)
public class Test{
public static void
main(String args[]){
System.out.println(0.05+0.01);
System.out.println(1.0-0.42);
System.out.println(4.015*100);
System.out.println(123.3/100);
}
};
0.060000000000000005
0.5800000000000001
401.49999999999994
1.2329999999999999
public double round(double value){
return Math.round(value*100)/100.0;
}
4.015*100=401.49999999999994
System.out.println(new java.text.DecimalFormat(\"0.00\").format(4.025));輸出是4.02
import java.math.BigDecimal;
/**
*
由於Java的簡單類型不能夠精確的對浮點數進行運算,這個工具類提供精
* 確的浮點數運算,包括加減乘除和四舍五入。
*/
public class Arith{
//默認除法運算精度
private static final int
DEF_DIV_SCALE = 10;
//這個類不能實例化
private Arith(){
}
/**
* 提供精確的加法運算。
* @param v1 被加數
*
@param v2 加數
* @return 兩個參數的和
*/
public static double
add(double v1,double v2){
BigDecimal b1 = new
BigDecimal(Double.toString(v1));
BigDecimal b2 = new
BigDecimal(Double.toString(v2));
return b1.add(b2).doubleValue();
}
/**
* 提供精確的減法運算。
* @param v1 被減數
*
@param v2 減數
* @return 兩個參數的差
*/
public static double
sub(double v1,double v2){
BigDecimal b1 = new
BigDecimal(Double.toString(v1));
BigDecimal b2 = new
BigDecimal(Double.toString(v2));
return b1.subtract(b2).doubleValue();
}
/**
* 提供精確的乘法運算。
* @param v1 被乘數
*
@param v2 乘數
* @return 兩個參數的積
*/
public static double
mul(double v1,double v2){
BigDecimal b1 = new
BigDecimal(Double.toString(v1));
BigDecimal b2 = new
BigDecimal(Double.toString(v2));
return b1.multiply(b2).doubleValue();
}
/**
* 提供(相對)精確的除法運算,當發生除不盡的情況時,精確到
*
小數點以后10位,以后的數字四舍五入。
* @param v1 被除數
* @param v2 除數
*
@return 兩個參數的商
*/
public static double div(double v1,double v2){
return div(v1,v2,DEF_DIV_SCALE);
}
/**
*
提供(相對)精確的除法運算。當發生除不盡的情況時,由scale參數指
* 定精度,以后的數字四舍五入。
* @param v1
被除數
* @param v2 除數
* @param scale 表示表示需要精確到小數點以后幾位。
*
@return 兩個參數的商
*/
public static double div(double v1,double
v2,int scale){
if(scale<0){
throw new
IllegalArgumentException(
\"The scale must be a positive integer or
zero\");
}
BigDecimal b1 = new BigDecimal(Double.toString(v1));
BigDecimal b2 = new BigDecimal(Double.toString(v2));
return
b1.divide(b2,scale,BigDecimal.ROUND_HALF_UP).doubleValue();
}
/**
* 提供精確的小數位四舍五入處理。
* @param v 需要四舍五入的數字
* @param scale 小數點后保留幾位
* @return 四舍五入后的結果
*/
public static double round(double v,int scale){
if(scale<0){
throw new IllegalArgumentException(
\"The scale must be a
positive integer or zero\");
}
BigDecimal b = new
BigDecimal(Double.toString(v));
BigDecimal one = new BigDecimal(\"1\");
return b.divide(one,scale,BigDecimal.ROUND_HALF_UP).doubleValue();
}
};
I think the idea of Google Docs is good and it has a big advantage for collaboration on same document.
However, since Google Docs is a web application, no matter how to improve
I think this is the reason why Google Pack include Star Office. I guess goggle may put some effort to integrate Google Doc with Star Office / Open Office.
Today, I have an idea to write a plugin for Microsoft Office, so that I can save the MS Word document directly to google docs or directly open a document from google doc.
After doing some research I found it is possible because Google release some API
http://code.google.com/apis/documents/developers_guide_protocol.html#UploadingDocs
Unfortunately, it did not provide .NET API. May be I need to implement one by myself…
I also found some article which tell me how to build an addin for Microsoft Office using .NET
http://www.codeproject.com/csharp/addin_office_using_csharp.asp
All API is ready, it is time to implement it la….
"I'm a strong believer that if you don't have anything right to say, or anything that moves the art forward, then you'd better just be completely silent and neutral, as opposed to trying to lay out a framework."真的十分認同!
(如果你對該問題不具有發言權,也沒辦法推進其解決進程,那麼最好保持沉默和中立,而不應該擺出一個非此即彼的架勢。)