2011年10月17日 星期一


3.1 Compiler vs. Interpreter

An interpreter translates some form of source code into a target representation that it can immediately execute and evaluate. The structure of the interpreter is similar to that of a compiler, but the amount of time it takes to produce the executable representation will vary as will the amount of optimization. The following diagram shows one representation of the differences.
graphic
Compiler characteristics:
  • spends a lot of time analyzing and processing the program
  • the resulting executable is some form of machine- specific binary code
  • the computer hardware interprets (executes) the resulting code
  • program execution is fast
Interpreter characteristics:
  • relatively little time is spent analyzing and processing the program
  • the resulting code is some sort of intermediate code
  • the resulting code is interpreted by another program
  • program execution is relatively slow
The above characteristics are typical. There are well-known cases that are somewhere in between, such as Java with it's JVM.

refer from:

2011年10月15日 星期六

Resource is not public

另外如果使用Theme.Dialog.Alert之類而出現
Error: Resource is not public. (at 'theme' with value '@android:style/Theme.Dialog.Alert')的錯誤,因為在frameworks/base/core /res/res/values/public.xml找不到這個資料

只要加個*改成
  '@*android:style/Theme.Dialog.Alert'
就可以使用了。



refer from:
http://slashgill.blogspot.com/2010/11/theme.html

2011年10月14日 星期五

Login Failed: invalid_key when Android Facebook app is installed


As Sean suggests in his second tack...
I fixed the issue by removing this line (which uses SSO):
    mFacebook.authorize(activity, mAppId, PERMS_NEEDED, new LoginDialogListener(r));
in favor of this line (which does not):
    mFacebook.authorize(
            activity, 
            PERMS_NEEDED,
            Facebook.FORCE_DIALOG_AUTH,   // avoids SSO
            new LoginDialogListener(r));
refer from:
https://github.com/facebook/facebook-android-sdk/issues/191

2011年10月7日 星期五

nVidia BSOD nvlddmkm.sys

I have found and fixed the problem today. This is what appears to happen.
during the installation of the most current drivers 100.65 Vista, an OLD file
nvlddmkm.sys is copied into windows/system32/drivers and not the current one
in the install. As a result the new drivers are attempting to access a file
dated 11/2006 instead of 2/2007 ver 7.15.11.0065 which is in the newest WHQL
driver ver 100.65 vista 32.

Fix: Go to windows/system32/drivers and rename nvlddmkm.sys to
nvlddmkm.sys.old. Go to the nvidia directory and find the file nvlddmkm.sy_
and copy it to windows/system32. Using the cmd window (DOS box) type
EXPAND.EXE nvlddmkm.sy_ nvlddmkm.sys. When the expansion is complete, copy
the new nvlddmkm.sys to windows/system32/drivers and restart the computer.

Your computer should now work properly.

You will notice that any uninstall and reinstall of nvidia drivers will not
remove the old nvlddmkm.sys file and will not overwrite it with the newer
version. You have to do it manually. I do not know why this happens but who
cares as long it is fixed.

Good luck...

"Hohen" wrote:






nvlddmkm.sys 這是NVIDIA的顯卡驅動的文件吧,你入安全模式找到他刪了他,看看能不能開機,要是入到正常模式的話就去下你顯卡最新的FOR win7的驅動吧裝上新的驅動我想應該沒事,
要是你不是一入系統的藍的話那你不用刪直接下最新的驅動裝上看看



refer from:
http://www.vistax64.com/vista-hardware-devices/41867-nvidia-bsod-nvlddmkm-sys.html

2011年10月6日 星期四

android另類結束Activity方法——主動拋出異常





這種方法在網上已經有了部分介紹,但是大部分人不知道怎麼取消Force Close的對話框。「通過重寫Android應用程序的Application基類自己實現 Thread.UncaughtExceptionHandler接口的uncaughtException方法是可以避免出現FC窗口的,用戶感覺直接退出了一樣」。這是網上能找到的說明,這段話讓人看了摸不著頭腦,大部分人不知道怎麼重寫Application基類並實現接口。廢話不多說,直接上代碼! 首先需要在onCreate中添加此句代碼:Thread.setDefaultUncaughtExceptionHandler(new AntrouApp());表明出現異常由自己來處理。 接下來重寫異常處理類 
public class AntrouApp extends Application implements Thread.UncaughtExceptionHandler { 
    @Override 
public void onCreate() { 
// TODO Auto-generated method stub 
super.onCreate(); 
} 
@Override 
    public void uncaughtException(Thread thread, Throwable ex) { 
        android.os.Process.killProcess(android.os.Process.myPid());  
Thread.getDefaultUncaughtExceptionHandler().uncaughtException(thread, ex); 
//若沒有處理,則按照系統自己的處理方式處理 
    } 
} 

此方法會強制結束所有的Activity和service,當然也可以在service裡進行,達到後台強制結束任務的目的。在Activity結束後,系統會回到最近為onpause狀態的Activity。


refer from:
http://www.bangchui.org/simple/?t15896.html