Friday, May 30, 2008

Sharon Stone apologizes

After Dior dropper her ads in China, Sharon Stone finally realize what went wrong. She issued a statement to apologize to Chinese people.  

Tuesday, May 27, 2008

Sharon Stone owes human race an apology

 
Stone was in the Cannes Film Festival. During a quick interview with the media, she claims the earth quake in China is "Very interesting", "I'm not happy about the way that Chinese are treating the Tibetan.", "How should we deal with Olympics", and finally "Is that karma?"
Sharon Stone was one of the most honorable Hollywood star, but I am very disappointed about what she said this time.  Sharon Stone, was that what you were thinking when you saw 60,000 died?  What would you think if people say certain incurable disease is a karma?
As a Taiwanese, we always have issues with China. However, at this time, all we care is that the human race are suffering.  It is not a time for boundary and political views.  It is time for humanity.

Monday, May 26, 2008

JavaOne 2008 紀念品



今年參加了JavaOne 2008。我從十年前就想去JavaOne,終於今年我們的好公司同意讓我去。老闆真是英明。當然我就像是觀光客一樣亂買了一些紀念品,包括Java磁鐵,Java原子筆,Java手電筒,Java茶杯,Java USB Hub,以及Java夾克,Java Polo衫等等亂七八糟的東西,還有附帶的Java背包,Java圓領衫等等,簡直可以說土到不行。但管他的,難得有機會來一次當然要採購一下。



講一些比較有營養的。今年的焦點展覽裝置有兩個。一個是Sentilla PERK (Pervasitve Computing Kit),另一個是Livescribe Pulse。



Sentilla PERK是一個Java ME CLDC 1.1的裝置,小小一個大概跟鳳梨酥差不多大,不是手機,沒有喇叭,但是有無線通訊的功能,還有溫度與三軸加速感應器(就是像Wii或iPhone那種,搖一搖就有反應)。整個開發套件包括兩個感應器小電腦,一個USB Gateway,一個USB韌體燒錄器,還有一套軟體開發工具(Eclipse平台)。Sentilla在JavaOne會場各角落都佈署了感應器,藉由二氧化碳濃度與溫度推測每場演講人的人氣指數。



Livescribe Pulse是一支有攝影機的筆,當這支筆寫在印有小點點的紙上,攝影機會紀錄座標,因此所有在紙上寫的都可以傳輸到電腦裡索引,同時可以同步錄音。因此事後只要點一下當時的筆跡,就可以聽到當時的內容。



Livescribe Pulse其實已經不是新技術了。早在七八年前就知道專利擁有人在尋找買主,好幾家公司都投入生產,包括知名的羅技 但是都沒有做起來。這一次會成功嗎? 我雖然稍有保留,但認為值得期待。原因是生產公司選擇了開放的平台,讓程式開發者參與,因此買這支筆的人可以期待擴充新的功能,或許這樣可以讓買家有比較多的興趣。



圖片上從左上角逆時鐘(往下轉右再往上)各項目介紹如下:
Sun出版商的書摘(蠻好的 看完我就去訂書了)
Effective Java第二版新書(作者現場舉辦簽書會 我當然也跑去簽了)

JavaOne省紙筆記本(真的很省紙 從來沒有人給那麼小本的 我記滿到最後一頁)
JavaCard 3.0讀卡機
研討會識別證(JavaCard 2.0) 剩下的酒票(每天早午各用一張飯票 最後一晚可用兩張酒票 飯超難吃)
研討會行程表與會場地圖
舊金山市Muni七日地鐵巴士票
Java環保原子筆
Eclipse Equinox紀念衫(很難拿 要跑去八個攤位蓋章才能領一件)
JAVA+YOU主題紀念衫(每人一件)
Java Polo衫(大號太大)
Java夾克(很實用 因為我衣服沒帶夠 舊金山又冷風又大)
Pulse筆記本
Livescribe Pulse智慧筆
JavaOne光碟DVD (NetBeans 6.1, GlassFish, etc)
AMD與Conversal等展示光碟
Sentilla Perk感應無線小電腦
甲骨文水壺
JavaOne紀念背包

Monday, May 19, 2008

NetBeans 6.1: First Impression


I got a copy of NetBeans 6.1 from JavaOne.  

About 6 years ago, when I downloaded JDK 1.3, Sun told me there is a free IDE bundled with it. Sure, why not, I thought.  I choose to download the bundled JDK1.3.1 + NetBeans pack.  That became my second-worst Java download experience in my whole life. (The worst experience is the Project Looking Glass bundled with JDK 6, which I uninstalled in a just a few minutes after download.)  I don't know how to describe the NetBeans 3 experience.  At that time I've been using UltraEdit for quite a while.  There is nothing I can't do with UltraEdit plus a command line compare to NetBeans 3, plus the sluggish "lightweight" Swing implementation on JDK 1.3.1. The whole experience is really a bad one, and I wondering why Sun kept saying this is the best IDE ever.  I mean, have they ever use the Visual Studio before?  I almost swear I will never use NetBeans again in my entire career, unless my job force me to use it.

In the mean time IBM open-sourced the groundbreaking Eclipse IDE inspired by their VisualAge product line.  It is a smart mix of native and Java layer; It has the native user response and experiences, while still have the simplicity and extensibility of Java. In my opinion at that time, Eclipse technologies are at least five years ahead of NetBeans.  Those advances are not just about some conceptual differences, but all the details too.  

Six years later, I finally decide to give NetBeans another chance. The reason is because I saw Tor Nobye's JavaOne demo with James Gosling and realize NetBeans has grown up now.  I happened to work on a Java Micro Edition project for my work recently, and NetBeans plus the Mobility pack seems like the perfect chance for my first impression on NetBeans 6.1.

The installation of NetBeans 6.1 is very simple.  It has a platform-specific installer for both Mac OS X and Windows (those are the only platforms I tried). The start up time is quite good, actually it takes about the same time as Eclipse on my machine. The user interface is pretty neat, way much better than the nightmare version 3. 

The Mobility pack contains the famous Visual Mobile Designer. This is one of the best screen flow design tool for Java ME.  It works around the tricky round-trip code generation issue by putting the generated code in a read-only region, so new code will not mess up the generated code.  You still have the freedom to write code outside the generated region.

One click on the Run button, the compiled code is deployed to the emulator, and the emulator is launched. Unit testing on NetBeans is as simple as using Eclipse or Microsoft tools.  The jar and jad files are generated under the dist directory automatically after project is built.  Simply upload those files to a web site, and your MIDP application is ready for deployment. The Mobility pack has a manifest tool to assist you to select the JSR and MIDP/CLDC profile requirement, and the packaging are very easy to use.

My goal is to build a web URL monitoring panel. The tool sends concurrent http requests to the web site I want to monitor, and display the response on the phone. This is a very simple application. I had it done in two days using the brand new tool. However, the development is not totally painless.  I found that NetBeans provided a Swing-like mobile TableItem which supports the backing TableModel.  I was very excited about this and decided to use it on my first project using Mobility pack.  When I update the model and fire an update event, the screen does not refresh on the standard Mobility pack emulator.  I need to navigate around to see the refreshed screen. I tried the same thing on Sony Ericsson's development tool, which is a modified Sun's WTK 2.5, and that emulator works fine.  I see my screen refreshed after table model change and fire the event. Since the manufacture's emulator works for me, I moved the finished project into the device.  Guess what? TableItem is not working in the real device!  It partially works in Mobility emulator, works in the manufacture's emulator, but does not work in the real device. I end up rewrite all my TableItem code into StringItem. Of course, the Z310 phone supports StringItem just like all Java phone, and no need to fire any events to make it refresh.  At this time, I will stay away from NetBeans implementation of mobile TableItem. It is definitely not reach production quality for sure.

It is nice to know that NetBeans is now really a usable tool. I managed to finish a project completely in NetBeans without switching back to other IDE.  Six years of hard working, now NetBeans is getting much closer to it's competitors. Other than bit by TableItem, the first impression on NetBeans 6.1 is quite good.  It will be my Java Mobile IDE from now on.


Saturday, May 10, 2008

JavaOne 2008 Conference (3) - Consumer Java

Java has been there for more than a decade. The JavaOne 2008 conference shows that the technology is maturing, new ideas keep coming, and lots of future opportunities are still finding their ways. Here are some of my notes on JavaOne 2008 for Consumer and Desktop Java.

Blu-ray is the new standard
The war is over. Blu-ray is the high-definition storage media standard. This means every single player from now on will have a Java VM in it. On the opening day, rock star Neil Young releases his music collection on Blu-ray. Usually people buy collection album several times because the second collections contains a few new songs. With Blu-ray (BD-live), you can simply purchase the extra inside the player. Digital content goes into another era, so are the developers. There are open-source communities for BD-J platform that enable regular developers to write content for home-made Blu-ray discs. It is definitely cool to write code my home video, or is it?

Java card runs Servlet and GCF
Strange idea but seems work pretty well. Java card 3.0 can accept http request inside the card. It sounds crazy in the beginning to run Servlet inside a credit-card like thing. This opens a lot of possibilities since the client side doesn’t need to implement or deploy any rich client code just for logging in the user, and http can also provide rich experience if it is well-designed. Another surprise is the generic connection framework (GCF) originated from the J2ME CLDC world. The card can open another connection using the connection framework, so the card can be used as a streaming mediator. For example, the card itself can be used as a stream decoder so the streamed video can be viewed only when the card is inserted, and the algorithm never leaves the card.

CLDC proved success – not just for phones
Thanks for hardware innovation. Things ran only in a smart phone now runs inside a plastic card. This year the show devices include a pen that runs J2ME CLDC, and motion/hear sensor that has a JVM inside it. Java was designed for embedded devices, and seems it is still going to be that way.

U.S. mobile app market is tightly controlled. Asia is the market of freedom
In the U.S., 95% of mobile market is controlled by the service provider. Another 4% are influence by the service provider. In other word, only 1% users have the choice of their own mobile solution. Asian market has less control from service provider, and the mobile application market is way bigger than the U.S. Freedom boosts the economy. I really hope U.S. service providers could give more freedom to the application creators. Let’s see how Apple doing after June.

Desktop Java - JavaFX
JavaFX is still trying to prove that Java technology is not dead inside a browser.

Java SE 6 Update 10 (a.k.a. 6u10)
Java 6 u10 is highly anticipated, and might be the only hope for JavaFX. Java 6 u10 will download only the minimum kernel (about 4MB) to get user started. Compare to 14MB of full JRE, I think this size is much more attractive to the end user, as it is a little closer to Flash download size (2MB).
Finally Mac is officially supporting Java 6, and MacBook Pro is everywhere in the crowd

JavaOne 2008 Conference (2) - Enterprise Java

Java has been there for more than a decade. The JavaOne 2008 conference shows that the technology is maturing, new ideas keep coming, and lots of future opportunities are still finding their ways. Here are some of my notes on JavaOne 2008 about Enterprise Java.

Traditional EJB Container will disappear
Currently, J2EE container has two flavors: The web container, and the Enterprise JavaBean (EJB) container. Tomcat is the most famous web container, and lots of the enterprise vendor sell the “application server” as the combination of both EJB and web container. Customers usally pay entry level charge for the “express edition” that gives you the web container only, and pay premium for the “enterprise edition” that can do the full J2EE stack, including EJB. Despite of Remote access and lookup, EJB is simple a Java object that has the following features:
-Lifecycle is managed by container
-Dependency injection by the container
-Object allocation is managed by container
-Access container managed resources, such as listeners, data source, connectors
In the next version of EJB, these feature can be included as part of the web container, so a web container is also a light EJB container. With the addition of annotation, there is no more need for define a local EJB separately (which is a bad idea from day one anyway). I think this will help acceptance of EJB, as a way of providing services. Java Persistence API already provides an alternative way of ORM aside from Entity EJB without containers. With this EJB 3.1 annotation change, it melts the boundary of the Express Server and the full Enterprise Application Server.
I don’t think EJB model itself will be a legacy, but the idea of charging premium for EJB container might no longer be true.

JSF tools are mature
JavaServer Faces is designed to be a good model for tooling. However, the tool support of JSF was horrible for quite a while. Rational Application Developer didn’t get it right. Earlier version of NetBeans didn’t do too good either. This year watching Oracle’s demo, looks like the JavaServer Faces are quite mature in the tooling world now. Not only Netbeans support on JSF is great, but also other part of the community is improved. Oracle’s tool is based on Eclipse and the JSF works. I hope IBM Rational can get them right in the future.

A side note, seems all enterprise company has moved their IDEs to Eclipse now: IBM, Oracle, CodeGear (Borland), Oracle-BEA, etc. Sun is focusing on the NetBeans of course, and looks like they are doing well too. I hate to have two IDEs for the same language in my desktop and I always choose Eclipse. However, I don’t mind to have an IDE for a different language, such as Ruby or JavaScript. NetBeans got me for this reason, not as a Java IDE (sorry).

Richer web experience is the trend, new security concerns rise
Ajax, Flash/AIR, JavaFX, and Silverlight make the web client market so busy, and consider all of them have their mobile variations. For so many years no one beat the Flash on rich web experiences, until Google shows how Ajax can serve the same purpose in a consistent user experience. Every year Sun tries to make Java come back to rich web experience. This year it is wrapped under JavaFX. Rich web experiences is not going away, and new view of web security need to be considered. The traffic between server and rich client might carry more information than you think, and the rich client might contain more business logic than the plain old HTML page. Hackers can have more fun to read the code now because the client is rich.

Web 1.0 technology is still the mainstream
While many people care about SOA and EJB, the topic that attracts most audience are still the web technology. Scalability is an apparently interesting topic. The comparison between web frameworks are very popular. Struts 1, Struts 2, JSF RI, JSF MyFaces, Spring MVC, they all have their pros and cons. Some of them excel others significantly in lowers load. Some of them are fast, but with some unpredictable pauses from time to time which might cause DoS.

JavaOne 2008 Conference (1) - Core Java

Java has been there for more than a decade. The JavaOne 2008 conference shows that the technology is maturing, new ideas keep coming, and lots of future opportunities are still finding their ways. Here are some of my notes on JavaOne 2008 on Core Java track.

Concurrency and Garbage-Collection

The discussion about Concurrency and Garbage-Collection is even hotter. They are popular for different reasons. Concurrency becomes a focus because of the population of multi-core chips. Ideally a multi-core chip should be able to execute our threaded code nicely in each core. However, in reality it is usually not the case. Even worse, the locking mechanism in modern virtual machines (doesn’t matter Java or .net) might become a bottleneck in the multi-core era. New building blocks are proposed in the conference. One example is the new keyword “atomic” to create a code block that can be committed or rolled-back. Intel also presented a hardware solution to support this atomic construct. Other system vendor has different opinion about this new proposal. Lock is difficult, but atomic might be even more difficult when real problem occur and debugging is needed.

Garbage-Collection (GC) is always a hot topic in Java. Every version of JRE has major improvement on Garbage-Collection. The non-deterministic nature of the GC makes Java VM a dangerous machine. With the modern 64-bit addressable environments, the problem is even worse. When JVM went into stop-the-world GC-cycle while under load, denial-of-service occurs. Real-time Java solves this issue by sacrificing the throughput. However, for enterprise JVMs with huge heap size, the stop-the-world problem remains due to heap fragmentation. Oracle-BEA announced the enterprise VM that has deterministic GC. I am very curious how it will perform running for weeks.

Hardware vendor’s involvements
I would think Java VM is an abstraction of execution environment that does not rely on any lower platform. Seems Java is significant enough nowadays that the hardware vendors are considering providing special instruction sets for the VM to improve their performance. I think the major reason for this to happen is the introduction of hypervisor on server virtualization. Hypervisor allows JVM and hardware (virtually) communicate in a different way. AMD CPU will provide a way to communicate with the JIT compiler when the JIT compiled binary does not perform as expected. Intel is proposing a transactional memory that allows Java to have a new way for dealing with concurrency. These kind of collaboration was usually been seen in Operating System level, such as AMD-Solaris, Intel-Mac OS X, or Wintel. It is nice to know that hardware vendors (other than Sun and ARM) want to accelerate Java platform too.

Instrumentation enhancements – VisualVM, JMX
I always feel Sun’s JVM monitoring technology fell behind IBM’s JVMs for at least five years. IBM’s JVM 1.4 has the whole stack of monitoring tool (through the expensive Tivoli). Seems the open community catches up quickly. Java 6 comes with instrumentation without performance impact or extra configuration. New JMX enhancement is coming up to allow single entry point for clustered environments.

VisualVM is a very sweet addition to the instrumentation world. It allows you to monitor your JVM performance in almost every aspect. It is for all Java VMs (well, all versions of Sun’s SE JVMs, to be specific), not just for ‘Enterprise’ containers. This means, it doesn’t cost you any money to see how your Virtual Machine is doing. No more guess using Windows Task Manager. Seems VisualVM will solve all the headaches.

Annotation explosion
Java 5 introduced a lot of feature in the language. Lots of features create more trouble than they were originally designed (such as Generics, Enum, and auto-boxing). A book is revised because of these troubles (Effective Java 2nd Edition; which is sold in JavaOne 2008 and the great Josh Bloch is signing it in person). I guess the only feature that does not cause as much confusion is the annotation. This year I see annotation everywhere. Sometimes I wonder how much is too much. I see a bad trend to use annotation to replace interface. The common pitch is “You don’t have to declare interface anymore.” This happens in the new JMX, the new EJB and many other places. Interface is one of the good reasons why Java programmers have better design concept than the programmers of other similar languages. I wonder why people would think it is an accomplishment by getting rid of the design.

Fragmented visions – modules, and “language improvements”
In my previous blog (in Chinese), I worried that the Java community will destroy themselves due to fragmented visions. Seems this is still ongoing. Despite of the matured OSGi framework, Java module system is under heavy development. It is assumed to be part of the Java 7. The new Java module system will be able to run OSGi bundle as a second-class citizen in the Java module system. OSGi already have the solution of lifecycle, versioning, modularization, and services. Java module system focuses on the first three, but not the services. It seems that these two groups still work separately, each claim they are focusing on different aspect of the same things.

Ever since Java 5 introduced the Generic, the community was excited about new language ideas. It seems that lots of people want to transform Java into the ultimate language – a programming language that has the good stuff of every other language. If that becomes true, Josh Bloch needs to write the third edition of Effective Java, and I might need to stand in the line to get the third edition signed three years later. Wait. Maybe that will not happen. Maybe when people realize how polluted Java is after all the ‘new idea’ introduced, people will simply move away from Java and move on to other language that really does the job better. Not long ago, fragmented visions collapse the C++ community and the creator (the uppercase AT&T) has no control over it. Will this happen when Java 7 releases with all new language keywords? Maybe Java 6 u10 is the last Java that the community will use?

New players: Scala, JRuby
Java platform is not about Java language anymore. Groovy got some attention a few years ago, and this year definitely JRuby is the hot thing on dynamic language. Surprisingly NetBeans become the best IDE of Ruby language. (Yes, it works with the native Ruby too.). JRuby sessions are so popular, and more people start doing Rail on their J2EE containers.
Scala is another language that people talking on the hallway. This is the first functional language that is build on top of Java’s runtime in the beginning. I have no idea what this is yet, but it seems this will be another cool stuff next year.
I didn’t notice there is a company called Azul systems that is good in Java appliances until JavaOne 2008. It seems that they are working on a lot of hard platform stuff.

These are the things I saw on the Core Java side base on my limited knowledge.

Tuesday, May 06, 2008

看到大爛片 Snake on a Plane

電視上正在播出『飛機上有蛇』。這部電影的大意是說,在飛機上 有蛇。請來了大牌黑人演技派演員山謬傑克遜擔任乘客兼警探,很認真的在飛機上展開人蛇大戰。電影開始沒多久蛇就跑出來了,乘客當然尖叫開始亂跑讓蛇開始興奮咬人。為配合電影需要,本機上的蛇專咬人臉或吃眼球以方便捕捉畫面。此時拉丁美女空服員與黑人警探聯手救人,而白人金髮美女則不意外的負責尖叫並尋找走失的吉娃娃誤闖蛇窩,最後靠身強體壯的華人背負逃出。然後黑人饒舌歌手也加入打蛇的行列,奇怪的是蛇好像專咬白人,用咬得不夠看,乾脆跑出大蟒蛇整個人從頭活吞。忽而機長不見了,山謬傑克遜和拉丁美女空服員只好跑去開飛機。飛到平穩以後機長又不知道從哪裡出現,這樣才可以讓山謬傑克遜再跑回機艙去救人。中間還穿插白人美女替無辜小弟弟吸吮毒液的橋段以增加畫面美觀。最後山謬傑克遜撐不下去了,剛好機長也死掉了,於是山謬傑克遜就跟饒舌歌手一起開飛機迫降。

山謬傑克遜很認真的把這片演完到最後,並沒有擔心演藝事業因此垮台而落跑。不像傑米福克斯演『機戰未來』那樣,幾分鐘就飛機爆炸死掉,根本就是來騙錢的。