Catching UncaughtError in Flex Modules « Alex’s Flex Closet
Catching UncaughtError in Flex Modules
Catching UncaughtError in Flex Modules « Alex’s Flex Closet
Catching UncaughtError in Flex Modules
Flash Player 10.1 Global Error Handling 全域錯誤處理 « focus1921’s web development
Flash Player 10.1 Global Error Handling 全域錯誤處理
2010 年 12 月 09 日發文作者 於在debug version的Flash Player中,如果遇到沒有用try…catch…補捉的錯誤時,會跳出錯誤視窗來顯示錯誤訊息、堆疊…等資訊。
在Flash Player 10.1提供了Global Error Handling全域錯誤處理機制來避免這種情況。可以處理所有程式未補捉的錯誤。
01
// 時間軸程式
02
03
// 全域(未補捉)錯誤錯理
04
function
onUncaughtError(e:UncaughtErrorEvent):
void
05
{
06
// 防止debug player跳出錯誤訊息
07
e.preventDefault();
08
09
// 可以作其它事例如跳出訊息視窗等等...
10
}
11
12
// 切換啟用或關閉全域錯誤處理
13
cbEnable.addEventListener(Event.CHANGE, onCBEnableChange);
14
function
onCBEnableChange(e:Event):
void
15
{
16
if
(cbEnable.selected)
17
{
18
// 為全域(未補捉)錯誤註冊偵聽
19
loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, onUncaughtError);
20
}
21
else
22
{
23
// 為全域(未補捉)錯誤移除偵聽
24
loaderInfo.uncaughtErrorEvents.removeEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, onUncaughtError);
25
}
26
}
27
28
btnThrowError.addEventListener(MouseEvent.CLICK, onBtnThrowErrorClick);
29
function
onBtnThrowErrorClick(e:MouseEvent):
void
30
{
31
// 擲出未補捉錯誤
32
var
_strTest:
String
=
null
;
33
trace
(_strTest.length);
Flex best practices – Part 1: Setting up your Flex project | Adobe Developer Connection
If you are willing to sacrifice the powerful tool set provided by Flex Builder 3.0 standalone or plug-in, applications can be developed using only the Flex 3 SDK.
The practices covered in this article should be followed regardless of which setup you use.
This is the first part of my series on using and applying best practices to your Flex development process. This article will focus on best practices for setting up your Flex project.
Why follow best practices? During your Flex development career, your hands will touch many projects. Not all projects will be created from scratch. More than likely you will be working on an established codebase that has been built up over time by different developers working in different stages of their careers. You will be facing projects that may have already begun or have already been released and now need to be refactored, changed, and updated. Time and time again, you will find yourself being thrown into the middle of the development process for various projects. Because of this, it is critical that the project has been started using best practices. Otherwise, you will be spending additional time making sense of the project and understanding the codebase rather than making the requested improvements or changes. This additional time can increase the cost of a project and dramatically detract from the task at hand. For these reasons, the Flex development community has established a set of common best practices for Flex developers to use. Following these best practices improves the clarity of a Flex project and enables Flex developers to focus on innovation rather than learning a myriad of nonstandard development approaches.
Selenium – Web Browser Automation
Selenium – Web Browser Automation
What is Selenium?
Selenium automates browsers. That’s it. What you do with that power is entirely up to you. Primarily it is for automating web applications for testing purposes, but is certainly not limited to just that. Boring web-based administration tasks can (and should!) also be automated as well.
Selenium has the support of some of the largest browser vendors who have taken (or are taking) steps to make Selenium a native part of their browser. It is also the core technology in countless other browser automation tools, APIs and frameworks.
Which part of Selenium is appropriate for me?
If you want to
- create quick bug reproduction scripts
- create scripts to aid in automation-aided exploratory testing
Then you want to use Selenium IDE; a Firefox add-on that will do simple record-and-playback of interactions with the browser
If you want to
- create robust, browser-based regression automation
- scale and distribute scripts across many environments
Then you want to use Selenium WebDriver; a collection of language specific bindings to drive a browser — the way it is meant to be driven.
Selenium WebDriver is the successor of Selenium Remote Control which has been officially deprecated. The Selenium Server (used by both WebDriver and Remote Control) now also includes built-in grid capabilities.
Cooper Maa: Arduino 筆記 – Lab21 用繼電器控制 12V 風扇
Arduino 筆記 – Lab21 用繼電器控制 12V 風扇
[SQL SERVER][Performance]刪除重複資料效能比較 – RiCo技術農場- 點部落
–方法3
–先新增資料declare @start time(7),@end time(7),@elaspedtime numeric(20,7)set @start=GETDATE()while 1=1
begin
delete top(1) from ##mytablewhere c1 in( select c1 from ##mytablegroup by c1having COUNT(*)>1 );if @@ROWCOUNT=0 breakend
set @end=GETDATE()set @elaspedtime=convert(int, datediff(ms, @start, @end));select @elaspedtime as '花費時間'--查看結果select * from ##mytable
花費時間(ms)=20000
ps:每一次的刪除作業就得先在子查詢取得鍵值,直到@@ROWCOUNT=0才跳出,
這樣的做法效能奇差無比,但如果你需要一個燒機方法,這方法應該算首選…XD
–我的方法
–先新增資料
declare @start time(7),@end time(7),@elaspedtime numeric(20,7)set @start=GETDATE();with mycte(c1,c2,row)as
(select *,ROW_NUMBER() over(partition by c1 order by c1 ) as 'row'from ##mytable
)delete mycte where row>1set @end=GETDATE()set @elaspedtime=convert(int, datediff(ms, @start, @end));select @elaspedtime as '花費時間'--查看結果select * from ##mytable
MS SQL Server查詢優化方法 – VFP hsiung 雄 周文雄 博格ERP 部落格 – Yahoo!奇摩部落格
查詢速度慢的原因很多,常見如下幾種
1、沒有索引或者沒有用到索引(這是查詢慢最常見的問題,是程式設計的缺陷)
2、I/O吞吐量小,形成了瓶頸效應。
3、沒有創建計算列導致查詢不優化。
4、記憶體不足
5、網路速度慢
6、查詢出的資料量過大(可以採用多次查詢,其他的方法降低資料量)
7、鎖或者鎖死(這也是查詢慢最常見的問題,是程式設計的缺陷)
8、sp_lock,sp_who,活動的用戶查看,原因是讀寫競爭資源。
9、返回了不必要的行和列
10、查詢語句不好,沒有優化
軟體開發團隊工具心得分享
Hudson+Continuous Integration筆記-3 | MaoYang-有話要說
閱讀本篇文章, 請先閱讀
Table of ContentsHudson的安裝
Hudson要安裝在何種作業系統??
基本上這與專案團隊使用的開發工具或是程式開發語言有密切關係, 例如軟體專案是開發在ARM平台執行的嵌入式軟體, 那麽CI/Build Server勢必也要能執行ARM平台開發工具, CI/Build Server也可以和開發工具安裝在不同機器上, 但是這個設定有點複雜, 筆者不建議這麽做, 目前的硬體平台並不貴,針對不同的開發工具而建置CI/Build Server, 可以省去許多複雜的設定. 所以CI/Build Server要安裝在何種作業系統, 要以軟體專案的開發工具能安裝的作業系統為優先考量.