探索與發(fā)現(xiàn)

          研究java技術(shù)

            BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
            83 隨筆 :: 0 文章 :: 109 評(píng)論 :: 0 Trackbacks

          2009年7月10日 #


          css 樣式
          .productshow{width:100%}
          .productshow .text{list-style-type:none; margin:0; padding:0}
          .productshow .text li{line-height:25px; background:url(../t_line.gif) repeat-x bottom}
          .productshow .text li A {background:url(../icons/dot1.gif) no-repeat; background-position:0 3px; padding-left:13px}
          .productshow .text A:link {color: #000; text-decoration: none}
          .productshow .text A:visited {color:#000; text-decoration: none}
          .productshow .text A:active {color: #000; text-decoration: none}
          .productshow .text A:hover {color: #B00000; text-decoration: underline}
          .productshow .pic{list-style-type:none; margin:0; padding:0}
          .productshow .pic li{float:left; width:120px}
          .productshow .pic li p{text-align:center; line-height:160%; word-break:break-all; width:120px; overflow:auto; }
          .productshow .pic li .picture{margin:0 auto; text-align:Center; width:110px; height:110px}
          .productshow .pic li .picture IMG{MARGIN-TOP: expression(( 110 - this.height ) / 2); width: expression(this.width > 110 ? 110 : true); height: expression(this.height > 110 ? 110 : true); max-width: 110px; max-height: 110px; VERTICAL-ALIGN: middle; TEXT-ALIGN: center}
          .productshow .pic li .sprice{text-align:center;color:#999;text-decoration:line-through}
          .productshow .pic li .proname{margin:0 auto; text-align:center; line-height:160%; height:40px; word-break:break-all; width:120px; overflow:hidden}
          .productshow .pic li .price{text-align:center;color:#ff0000}
          .productshow .pic li .buylist{line-height:25px; text-align:center;color:#6DAADA; display:none}
          .productshow .pic .list-line{width:157px}
          .productshow .pic .list-line .picture-s{float:left; margin:0 auto; text-align:Center; width:50px; height:50px}
          .productshow .pic .list-line .picture-s IMG{MARGIN-TOP: expression(( 45 - this.height ) / 2); width: expression(this.width > 45 ? 45 : true); height: expression(this.height > 45 ? 45 : true); max-width: 45px; max-height: 45px; VERTICAL-ALIGN: middle; TEXT-ALIGN: center}
          .productshow .pic .list-line .picinfo{float:left; padding-left:12px; width:95px}
          .productshow .pic li A:link {color: #000; text-decoration: none}
          .productshow .pic li A:visited {color:#000; text-decoration: none}
          .productshow .pic li A:active {color: #000; text-decoration: none}
          .productshow .pic li A:hover {color: #B00000; text-decoration: underline}



          主體代碼

          <table width="609" style="border:1px solid #FF8119" cellspacing="0" cellpadding="0">
                        <tbody><tr>
                          <td background="shop/skins/56770_com_b_002/center_bg.gif"><div class="productshow">
          <ul class="pic">
          <form action="#" method="post" name="LEBI_FORMBUY_0001" id="LEBI_FORMBUY_0001"><li>
           <div class="picture"><a href="shop/product/default.asp?id=16" class="picborder" target="_self"><img border="0" src="shop/Pic/201009/1211144612000.jpg" {@onmouse}="" alt="2010男裝 秋裝商"></a></div>
           <div class="proname"><a href="shop/product/default.asp?id=16" title="2010男裝 秋裝商" target="_self">2010男裝 秋裝商</a></div>
                   <p><span class="sprice">市場(chǎng)價(jià):¥100.00</span></p>
           <p><span class="price">購買價(jià):¥90.00</span></p>
           <p class="buylist">購買數(shù)量 <input type="text" name="pro_num_0001_16" id="pro_num_0001_16" value="1" size="3" style="width:30px;" class="form"><input type="hidden" name="pro_size_0001_16" id="pro_size_0001_16" value="-"><input type="hidden" name="pro_color_0001_16" id="pro_color_0001_16" value="-"><br><input type="button" name="button_0001_16" value="購買" onclick="javascript:addtobasket('16','0001','','1')" class="button">&nbsp;<input type="button" name="fav" value="收藏" onclick="location.href='shop/user/?action=shoucang_add&amp;id=16&amp;product_name=2010%E7%94%B7%E8%A3%85+%E7%A7%8B%E8%A3%85%E5%95%86&amp;backurl=http%3A%2F%2Flocalhost%3A80%2Fshop%2Fdefault%2Easp&amp;product_type='" class="button">
          </p>
          </li><li>
           <div class="picture"><a href="shop/product/default.asp?id=15" class="picborder" target="_self"><img border="0" src="shop/Pic/201009/1211103327386.jpg" {@onmouse}="" alt="2010男裝 秋裝商"></a></div>
           <div class="proname"><a href="shop/product/default.asp?id=15" title="2010男裝 秋裝商" target="_self">2010男裝 秋裝商</a></div>
                   <p><span class="sprice">市場(chǎng)價(jià):¥120.00</span></p>
           <p><span class="price">購買價(jià):¥120.00</span></p>
           <p class="buylist">購買數(shù)量 <input type="text" name="pro_num_0001_15" id="pro_num_0001_15" value="1" size="3" style="width:30px;" class="form"><input type="hidden" name="pro_size_0001_15" id="pro_size_0001_15" value="-"><input type="hidden" name="pro_color_0001_15" id="pro_color_0001_15" value="-"><br><input type="button" name="button_0001_15" value="購買" onclick="javascript:addtobasket('15','0001','','1')" class="button">&nbsp;<input type="button" name="fav" value="收藏" onclick="location.href='shop/user/?action=shoucang_add&amp;id=15&amp;product_name=2010%E7%94%B7%E8%A3%85+%E7%A7%8B%E8%A3%85%E5%95%86&amp;backurl=http%3A%2F%2Flocalhost%3A80%2Fshop%2Fdefault%2Easp&amp;product_type='" class="button">
          </p>
          </li><li>
           <div class="picture"><a href="shop/product/default.asp?id=14" class="picborder" target="_self"><img border="0" src="shop/Pic/201009/121181193516.jpg" {@onmouse}="" alt="2010男裝 秋裝商"></a></div>
           <div class="proname"><a href="shop/product/default.asp?id=14" title="2010男裝 秋裝商" target="_self">2010男裝 秋裝商</a></div>
                   <p><span class="sprice">市場(chǎng)價(jià):¥100.00</span></p>
           <p><span class="price">購買價(jià):¥100.00</span></p>
           <p class="buylist">購買數(shù)量 <input type="text" name="pro_num_0001_14" id="pro_num_0001_14" value="1" size="3" style="width:30px;" class="form"><input type="hidden" name="pro_size_0001_14" id="pro_size_0001_14" value="-"><input type="hidden" name="pro_color_0001_14" id="pro_color_0001_14" value="-"><br><input type="button" name="button_0001_14" value="購買" onclick="javascript:addtobasket('14','0001','','1')" class="button">&nbsp;<input type="button" name="fav" value="收藏" onclick="location.href='shop/user/?action=shoucang_add&amp;id=14&amp;product_name=2010%E7%94%B7%E8%A3%85+%E7%A7%8B%E8%A3%85%E5%95%86&amp;backurl=http%3A%2F%2Flocalhost%3A80%2Fshop%2Fdefault%2Easp&amp;product_type='" class="button">
          </p>
          </li><li>
           <div class="picture"><a href="shop/product/default.asp?id=11" class="picborder" target="_self"><img border="0" src="shop/Pic/201009/121101451977.jpg" {@onmouse}="" alt="2010品牌男襯衣"></a></div>
           <div class="proname"><a href="shop/product/default.asp?id=11" title="2010品牌男襯衣" target="_self">2010品牌男襯衣</a></div>
                   <p><span class="sprice">市場(chǎng)價(jià):¥100.00</span></p>
           <p><span class="price">購買價(jià):¥100.00</span></p>
           <p class="buylist">購買數(shù)量 <input type="text" name="pro_num_0001_11" id="pro_num_0001_11" value="1" size="3" style="width:30px;" class="form"><input type="hidden" name="pro_size_0001_11" id="pro_size_0001_11" value="-"><input type="hidden" name="pro_color_0001_11" id="pro_color_0001_11" value="-"><br><input type="button" name="button_0001_11" value="購買" onclick="javascript:addtobasket('11','0001','','1')" class="button">&nbsp;<input type="button" name="fav" value="收藏" onclick="location.href='shop/user/?action=shoucang_add&amp;id=11&amp;product_name=2010%E5%93%81%E7%89%8C%E7%94%B7%E8%A1%AC%E8%A1%A3&amp;backurl=http%3A%2F%2Flocalhost%3A80%2Fshop%2Fdefault%2Easp&amp;product_type='" class="button">
          </p>
          </li><li>
           <div class="picture"><a href="shop/product/default.asp?id=9" class="picborder" target="_self"><img border="0" src="shop/Pic/201009/121053257865.jpg" {@onmouse}="" alt="2010年秋冬新款特"></a></div>
           <div class="proname"><a href="shop/product/default.asp?id=9" title="2010年秋冬新款特" target="_self">2010年秋冬新款特</a></div>
                   <p><span class="sprice">市場(chǎng)價(jià):¥100.00</span></p>
           <p><span class="price">購買價(jià):¥100.00</span></p>
           <p class="buylist">購買數(shù)量 <input type="text" name="pro_num_0001_9" id="pro_num_0001_9" value="1" size="3" style="width:30px;" class="form"><input type="hidden" name="pro_size_0001_9" id="pro_size_0001_9" value="-"><input type="hidden" name="pro_color_0001_9" id="pro_color_0001_9" value="-"><br><input type="button" name="button_0001_9" value="購買" onclick="javascript:addtobasket('9','0001','','1')" class="button">&nbsp;<input type="button" name="fav" value="收藏" onclick="location.href='shop/user/?action=shoucang_add&amp;id=9&amp;product_name=2010%E5%B9%B4%E7%A7%8B%E5%86%AC%E6%96%B0%E6%AC%BE%E7%89%B9&amp;backurl=http%3A%2F%2Flocalhost%3A80%2Fshop%2Fdefault%2Easp&amp;product_type='" class="button">
          </p>
          </li></form></ul>

          <div class="both"></div></div></td>
                        </tr>
                        <tr>
                          <td><img src="shop/skins/56770_com_b_002/center_bottom.gif" width="609" height="10"></td>
                        </tr>
                      </tbody></table> 
                     

          posted @ 2010-09-15 22:55 蜘蛛 閱讀(312) | 評(píng)論 (0)編輯 收藏

          為測(cè)試 Flex 應(yīng)用程序設(shè)置測(cè)試環(huán)境

          正確的用于測(cè)試 Flex 應(yīng)用程序的環(huán)境設(shè)置將有助于確保可靠的功能測(cè)試結(jié)果。測(cè)試環(huán)境一般由測(cè)試人員在測(cè)試計(jì)算機(jī)上進(jìn)行設(shè)置。

          關(guān)于此任務(wù)

          要設(shè)置測(cè)試環(huán)境:

          過程

          1. 檢查瀏覽器的設(shè)置:
            1. Internet Explorer:
              1. 打開 Internet Explorer。
              2. 單擊工具 > 互聯(lián)網(wǎng)選項(xiàng)
              3. 單擊安全性選項(xiàng)卡。
              4. 選擇適當(dāng)?shù)?Web 內(nèi)容區(qū)域。執(zhí)行下列某個(gè)步驟:
                • 如果在遠(yuǎn)程機(jī)器上配置了 Web 服務(wù)器,那么請(qǐng)完成下列步驟:
                  1. 選擇本地內(nèi)部網(wǎng)
                  2. 單擊站點(diǎn) > 高級(jí)
                  3. 將此 Web 站點(diǎn)添加到區(qū)域字段中,輸入要添加到 Web 站點(diǎn)的 URL。
                  4. 單擊添加,然后單擊確定
                • 如果在本地主機(jī)上配置了 Web 服務(wù)器,那么請(qǐng)完成下列步驟:
                  1. 選擇本地內(nèi)部網(wǎng)
                  2. 單擊定制級(jí)別
                  3. 復(fù)位至列表中,選擇中低
                  4. 在“設(shè)置”窗格中,針對(duì)初始化且腳本 ActiveX 控件不標(biāo)記為安全一項(xiàng)單擊啟用
                  5. 單擊確定
            2. Firefox:
              1. 單擊工具 > 選項(xiàng) > 內(nèi)容
              2. 清除阻止彈出窗口復(fù)選框。
              3. 單擊工具 > 選項(xiàng) > 安全
              4. 清除當(dāng)有站點(diǎn)試圖安裝插件時(shí)發(fā)出警告復(fù)選框。
          2. 打開 IBM Rational Functional Tester,然后單擊配置 > 啟用測(cè)試環(huán)境。必須啟用所需要的 JRE 并將 Internet Explorer 設(shè)置為缺省 Web 瀏覽器。
          3. 在“Web 瀏覽器”頁面中啟用所需要的瀏覽器。
          4. 將測(cè)試下應(yīng)用程序設(shè)置為可信以在本地運(yùn)行應(yīng)用程序。指向單個(gè)文件或目錄的路徑處于可信狀態(tài),同時(shí)所有的文件將會(huì)分配到每個(gè)選定的目錄及其可信的子目錄中。按照下列步驟來分配信任目標(biāo):
            1. 在 C:\WINDOWS\system32\Macromed\Flash 中創(chuàng)建文件夾 FlashPlayerTrust。
            2. 在 FlashPlayerTrust 文件夾中創(chuàng)建一個(gè)名為 Flex 且不帶擴(kuò)展名的文件。
            3. 在 Flex 文件中輸入 Flex 應(yīng)用程序的目錄路徑。例如,如果 Flex 應(yīng)用程序位于 C:\Test 目錄中,請(qǐng)?jiān)?Flex 文件中輸入路徑 C:\Test
            4. 保存文件。
          posted @ 2010-07-27 06:00 蜘蛛 閱讀(258) | 評(píng)論 (0)編輯 收藏

          http://unitedmindset.com/jonbcampos/2009/08/12/flex-best-practices-events/
          posted @ 2009-09-18 06:53 蜘蛛 閱讀(419) | 評(píng)論 (2)編輯 收藏

          http://www.davidtucker.net/category/cairngorm/
          posted @ 2009-09-15 20:36 蜘蛛 閱讀(206) | 評(píng)論 (0)編輯 收藏

          1.可以使用PopUpManager進(jìn)行界面切換
          2.使用狀態(tài)(state),自定義一些狀態(tài)事件(StateEvent),在index.mxml(mx:application)中監(jiān)聽組件派發(fā)的狀態(tài)事件類型,利用改變狀態(tài)來改變顯示的界面.


          ⑴用第一種方式來實(shí)現(xiàn)相對(duì)簡(jiǎn)單,利用PopUpManager的一些靜態(tài)方法即可實(shí)現(xiàn),比較適用于一些size相對(duì)較小的可視化組件,比如:登陸表單組件,或修改一個(gè)值,要求重新輸入一個(gè)新值等等類似情況.實(shí)現(xiàn)示例代碼如下:

          Js代碼
          1. <span style="font-size: small;">var win:*;   
          2. win = new loginPanel();   
          3. //彈出顯示登錄框   
          4. PopUpManager.addPopUp(win,this,true);   
          5. //登陸框顯示在中間   
          6. PopUpManager.centerPopUp(win); </span>  

           ⑵在第二種方法中利用state來改變顯示的界面則要相對(duì)復(fù)雜許多.

          ①首先我們需要自定義統(tǒng)一的狀態(tài)事件名稱

          Java代碼
          1. <span style="font-size: small;">package note.events{  
          2. /** 
          3.  * 狀態(tài)事件,每個(gè)狀態(tài)值要和狀態(tài)名稱一樣 
          4.  * @author halzhang 
          5. */  
          6. public class StateEvent{  
          7.           public static const NULL_STATE:String = "";  
          8.           public static const LOGIN_STATE:String = "loginState";  
          9.           public static const ADDNOTE_STATE:String = "addNoteState";  
          10.           public static const ADDUSER_STATE:String = "addUserState";  
          11.           public static const LISTALLUSER_STATE:String = "listAllUserState";  
          12.          }  
          13. }</span>  

           ②在Flex項(xiàng)目的主程序中定義state,當(dāng)然也可以加上狀態(tài)切換的動(dòng)畫.

          Html代碼
          1. <span style="font-size: small;"><!-- 定義狀態(tài),我們分別定義了三個(gè)狀態(tài),每個(gè)狀態(tài)對(duì)應(yīng)一個(gè)自定義的可視化組件  -->  
          2.     <mx:states>  
          3.         <mx:State name="loginState">  
          4.             <mx:AddChild position="lastChild">  
          5.                 <!-- 狀態(tài)對(duì)應(yīng)的自定義組件:登陸組件 -->  
          6.                 <view:loginPanel id="panel_login" x="195" y="89"/>  
          7.             </mx:AddChild>  
          8.         </mx:State>  
          9.           
          10.         <mx:State name="addNoteState">  
          11.             <mx:AddChild position="lastChild">  
          12.                 <!-- 狀態(tài)對(duì)應(yīng)的自定義組件:添加留言組件 -->  
          13.                 <view:addNotePanel id="panel_addNote" x="10" y="44"/>  
          14.             </mx:AddChild>  
          15.         </mx:State>  
          16.           
          17.         <mx:State name="addUserState">  
          18.             <mx:AddChild position="lastChild">  
          19.                 <!-- 狀態(tài)對(duì)應(yīng)的自定義組件:添加用戶組件 -->  
          20.                 <view:addUserPanel id="panel_addUser" x="10" y="44"/>  
          21.             </mx:AddChild>  
          22.         </mx:State>  
          23.           
          24.         <mx:State name="listAllUserState">  
          25.             <mx:AddChild position="lastChild">  
          26.                 <view:allUserPanel id="panel_allUser" x="10" y="44"/>  
          27.             </mx:AddChild>  
          28.         </mx:State>  
          29.     </mx:states></span>  

          ③在組件中派發(fā)狀態(tài)事件(StateEvent)

          Js代碼
          1. <span style="font-size: small;"> //關(guān)閉添加留言組件的時(shí)候派發(fā)"空"狀態(tài)事件,也就是主程序界面不顯示其他組件     
          2.  //如果想顯示其他組件,則派發(fā)相應(yīng)的狀態(tài)事件     
          3.  internal function closeMySelf():void{    
          4.         appModel.dispatchEvent(new Even(StateEvent.NULL_STATE));    
          5.  }</span>  

          ④在主程序界面中監(jiān)聽狀態(tài)事件(StateEvent),從而通過改變狀態(tài)來顯示我們需要的組件.

          Js代碼
          1. <span style="font-size: small;">                                                //添加狀態(tài)事件監(jiān)聽,在程序初始化的時(shí)候執(zhí)行  
          2.             internal function stateListener():void{  
          3.                 appModel.addEventListener(StateEvent.NULL_STATE,stateEventHandler);  
          4.                 appModel.addEventListener(StateEvent.LOGIN_STATE,stateEventHandler);  
          5.                 appModel.addEventListener(StateEvent.ADDNOTE_STATE,stateEventHandler);  
          6.             }  
          7.             //狀態(tài)事件處理函數(shù)  
          8.             internal function stateEventHandler(evt:Event):void{  
          9.                 this.currentState = evt.type.toString();  
          10.             }</span>  

          在項(xiàng)目中appModel是一個(gè)繼承 EventDispatcher,使用單例模式實(shí)現(xiàn)的程序模型.不知道讀者是否發(fā)現(xiàn)StateEvent中事件名稱是和主程序界面中定義的state的 name值是一致的.因?yàn)檫@樣定義我們就可以使用統(tǒng)一的狀態(tài)事件處理函數(shù),就不需要先去判斷是哪個(gè)狀態(tài)事件,在來改變當(dāng)前狀態(tài).只要簡(jiǎn)單的執(zhí)行 this.currentState = evt.type.toString();

          posted @ 2009-09-10 17:50 蜘蛛 閱讀(2874) | 評(píng)論 (2)編輯 收藏

          http://blog.csdn.net/lixinye0123
          posted @ 2009-08-24 06:31 蜘蛛 閱讀(381) | 評(píng)論 (7)編輯 收藏

          impersonation
          <system.web>
          <identity impersonate="true" />
          </system.web>

          Configuring log4net for SharePoint Windows Authentication
          http://mikeknowles.com/blog/2009/02/17/ConfiguringLog4netForSharePointWindowsAuthentication.aspx


          log4net does not work in IIS
          http://forums.asp.net/p/1420781/3153374.aspx


          http://stackoverflow.com/questions/1061857/sharepoint-and-identity-impersonatefalse
          posted @ 2009-08-11 23:26 蜘蛛 閱讀(608) | 評(píng)論 (3)編輯 收藏

          http://msp.sfsu.edu/Instructors/rey/aepage/tutorials.html
          posted @ 2009-08-05 02:17 蜘蛛 閱讀(222) | 評(píng)論 (0)編輯 收藏

               摘要: Photoshop超級(jí)技巧 色彩技巧    139. Photoshop是32位應(yīng)用程序,為了正確地觀看文件,須將屏幕設(shè)置為24位彩色。    140. 先執(zhí)行“視圖”→“新視圖”命令,產(chǎn)生有關(guān)新視窗后,再執(zhí)行“視圖”→“預(yù)覽”...  閱讀全文
          posted @ 2009-07-31 14:35 蜘蛛 閱讀(404) | 評(píng)論 (0)編輯 收藏

          和動(dòng)畫一樣,剪輯這個(gè)詞涵蓋的東西太多,以至于我們無從下口。到底什么是剪輯,

          什么算剪輯,業(yè)內(nèi)人也說不清楚,更別說介紹給普通觀眾了。我們從那些有記可查

          的各種定義,定律,課本文章里跳出來,只談?wù)劯惺?#8211;剪輯:剪什么?

          以我的感受,面對(duì)一個(gè)片子或者是面對(duì)一個(gè)未出生的片子我們到底應(yīng)該先剪什么?

          首先剪到的應(yīng)當(dāng)是

          1、剪調(diào)性,其次是

          2、剪情緒,再次是

          3、剪內(nèi)容, 之后是

          3、剪故事,然后是

          4、剪道理,次之是

          5、剪鏡頭,再次是

          6、剪音樂,最次是

          7、剪手法,完后才是

          8、剪技術(shù)。

          其中調(diào)性是和產(chǎn)品,和目標(biāo),和觀眾,和影片相關(guān)的,就是我們究竟要做一個(gè)什么

          片子,給誰看,說的是男人的事還是娘們兒的事,是個(gè)廣告還是專題,是詩歌還是

          散文,是政府報(bào)告,還是書情小調(diào)–于是我們有了影片的調(diào)性,它決定了創(chuàng)作者

          的情緒。

          情緒,是控制影片的主觀元素,我們將”我”,將代表”我”的”情緒”放在代表

          客觀產(chǎn)品和客戶的調(diào)性要求之后,是因?yàn)槲覀冃枰猿姓J(rèn)一個(gè)好的剪輯是在為客戶

          和觀眾剪輯的先決條件下確立的。因?yàn)檎{(diào)性的確立,而導(dǎo)引出”我”在整個(gè)影片控

          制中的情緒應(yīng)當(dāng)是什么樣的。當(dāng)情緒控制完整時(shí),我們進(jìn)入了一個(gè)狀態(tài),開剪!

          我們把情緒從空中迫降到內(nèi)容,面對(duì)一大堆素材,內(nèi)容的整理分類和控制、想象成

          了一個(gè)龐大的工作,在這么龐大復(fù)雜甚至是有點(diǎn)機(jī)械重復(fù)的過程中,千萬不要失去

          情緒,選擇素材時(shí)候還要時(shí)刻考慮調(diào)性。而這一步針對(duì)內(nèi)容的篩選和分析,是影片

          對(duì)錯(cuò)的基本保證。

          內(nèi)容確認(rèn),將零散的內(nèi)容剪輯組織成有趣的故事,常常被看做是剪輯的魅力所在。

          我們可以用剪輯影響情緒故事甚至改變內(nèi)容,總之一切雖然在你手中,卻依靠想象

          力才能走得更遠(yuǎn)。人人心中有,各個(gè)筆下無。電視包裝的故事往往并不復(fù)雜,但希

          望通過剪輯增加信息量并且要求極其清晰和準(zhǔn)確的表達(dá)。這里需要大量的訓(xùn)練和思

          考。

          故事的背后要考慮道理,往往剪輯時(shí)候需要一個(gè)理由,這個(gè)理由不一定有機(jī)會(huì)說出

          來或者是展示給每個(gè)觀眾,或者是讓每個(gè)觀眾都能體會(huì)到理由所在,但是剪輯師必

          須有一個(gè)理由,能夠說服自己剪下去的理由,能夠?qū)?dāng)前鏡頭和前后鏡頭連接起來

          的理由。這個(gè)理由可能是內(nèi)容的情緒的故事的,或也可能是鏡頭運(yùn)動(dòng)的,色彩的,

          修辭的,反正需要一個(gè)理由,將影片進(jìn)行到底!

          道理依靠鏡頭的組織,這里我們終于剪到鏡頭了。這是一個(gè)很視覺的活,這是一個(gè)

          很鏡頭感的饕餮。景別,運(yùn)動(dòng),正反打,一個(gè)鏡頭一個(gè)鏡頭的銜接,一個(gè)堡壘一個(gè)

          堡壘的推進(jìn),一組鏡頭和一組鏡頭的對(duì)話,鏡頭就是實(shí)在的字,講著道理說著故事。

          沒有鏡頭,也可以剪輯,用黑場(chǎng)替代你現(xiàn)在不存在的鏡頭。我們依然可以組織影片。

          鏡頭的另一魅力就是時(shí)長(zhǎng)和觀眾的心理預(yù)期,恰到好處的鏡頭長(zhǎng)短,如呼吸般可以

          與觀眾同步,在同步的呼吸中控制觀眾的節(jié)奏,一定要在心里下一個(gè)預(yù)期前給一個(gè)

          準(zhǔn)確的時(shí)長(zhǎng)。甚至可以留下一點(diǎn)點(diǎn)遺憾。這就是鏡頭的魅力。

          配合情緒,故事和鏡頭的音樂舉足輕重。但是只會(huì)按照音樂剪輯的剪輯,毫無控制

          力。他們的影片就像流水帳一樣”進(jìn)人意料”。實(shí)際上音樂,同期,字幕,畫面同

          時(shí)構(gòu)成一個(gè) 立體的影片空間與線索。完全可以通過音樂的控制手法去講故事。對(duì)于

          影片音樂無可厚非屬于一個(gè)乘數(shù),而非簡(jiǎn)陋的加法。

          其次我們還有N多種剪輯手法配合,實(shí)際上可以把剪輯影片理解成一段舞曲,一段

          旋律,我們變換的剪輯手法無非是123,223,323 423……或者是忽然轉(zhuǎn)變成11123

          —11223—11323……旋律的變化 ,節(jié)奏的調(diào)整。這些統(tǒng)稱為剪輯手法,可以從廣

          告帶中積累。當(dāng)然也可以自己創(chuàng)造。而現(xiàn)代剪輯中我認(rèn)為一些拍攝技巧可以說是從

          剪輯中來的,也可以變成一種剪輯技巧。合成也是一種剪輯。合成影響了影片的色

          調(diào),質(zhì)感,景別的重構(gòu),這些對(duì)剪輯都明顯的幫襯作用。

          最后要剪技術(shù),這個(gè)不用多提,市場(chǎng)上,培訓(xùn)上也提的過多。我們?cè)偃ゼ夹g(shù)上爭(zhēng)你

          死我活都沒用。還是少提點(diǎn)為好,或者下一帖再說。

          從技術(shù)上來說,剪輯軟件都類似,看不出多少分別(實(shí)際還是有區(qū)別的),基本上

          快的話一天就能學(xué)會(huì)慢的話兩三個(gè)月也能了。之后,你就會(huì)剪輯了嗎?你就懂得剪

          輯了嗎?一切要從實(shí)踐中來。

          回頭看看:

          1、剪調(diào)性,其次是

          2、剪情緒,再次是

          3、剪內(nèi)容, 之后是

          4、剪故事,然后是

          5、剪道理,次之是

          6、剪鏡頭,再次是

          7、剪音樂,最次是

          8、剪手法,完后才是

          9、剪技術(shù)。

          剪到手法還是音樂? —-你剪到了哪一步呢?

          同志們!–剪出九級(jí)。

          posted @ 2009-07-29 10:32 蜘蛛 閱讀(308) | 評(píng)論 (0)編輯 收藏

          http://itbbs.pconline.com.cn/dv/8515019.html
          posted @ 2009-07-25 09:27 蜘蛛 閱讀(193) | 評(píng)論 (0)編輯 收藏

          www.noisejunkies.net/links ...you will find a nice list there
          http://allbetsareoff.com
          http://maltaannon.com
          http://www.sternfx.com

          And, of course,

          http://library.creativecow.net/video-tutorials/adobeaftereffects

          www.aetuts.com

          creativecow.net,
          maltaannon.com,
          everythingfx.tk
          moviemaker933.tk
          fxresource.tk
          noisejunkies.net,
          aetuts+.com
          visualfxtuts.com
          aescripts.com

          These range from beginning to advanced tutorials.
          http://www.lfp-industries.com

          This site is constantly growing and makes some exciting tutorials.



          ref to :http://www.videocopilot.net/forum/viewtopic.php?f=33&t=19288




          posted @ 2009-07-16 10:40 蜘蛛 閱讀(183) | 評(píng)論 (0)編輯 收藏

          I would start with Andrew's Basic Training to learn the basis. Also, I would recommend you to have a look at Andrew's DVD Products, I think Serious FX could be a good start to learn effects and compositing.

          Before you go on with Andrews stuff..i suggest you to buy Creating Motion Graphics Vol1 and Vol.2 from Thris and Chris Meyer.
          These books will give you the basic principles of the programm and also make you feel comfortable with the interface of the programm such as its basic rules and knowledge.

          You must know how to put the gears in order to drive a car.....Andrews stuff is surely your next stop after you manage to drive you A.E vehicle goood!!
          posted @ 2009-07-15 15:22 蜘蛛 閱讀(236) | 評(píng)論 (0)編輯 收藏

          美國教師Joe Harkins給即將畢業(yè)的CG動(dòng)畫大學(xué)生一封信

          偶然在網(wǎng)上看到了這篇帖子,是一位名叫Joe Harkins的美國教師為了解答學(xué)生們的疑惑而發(fā)表的一封信。Joe Harkins從一個(gè)過來人的角度,解答了剛剛?cè)胄谢蛘哒跍?zhǔn)備入行年輕人存在的一些疑惑。雖然有一些問題不適合中國學(xué)生,但是也有很多代表性的問題,能給我們一些啟發(fā)。

                        作為一個(gè)在各個(gè)學(xué)校演講的演講者,舊金山藝術(shù)學(xué)院新媒體傳達(dá)中心和SIGGRAPH任教的老師, Joe Harkins會(huì)收到無數(shù)電子郵件。在回復(fù)了上百封郵件后,他逐漸認(rèn)識(shí)到幾乎所有的學(xué)生都關(guān)心這樣一個(gè)信息:他們想知道他們所受的教育的真正價(jià)值有多少。

                        他們需要一個(gè)真正誠懇的,有經(jīng)驗(yàn)的人來評(píng)判他們的作品。最重要的是他們想知道如何才能獲得一份工作。

                   我應(yīng)該去學(xué)校拿一個(gè)學(xué)位嗎?

                  是否上學(xué)拿學(xué)位并不是關(guān)鍵。畢業(yè)了以后沒有人會(huì)在意你這個(gè)了。他們不想知道你在哪里畢業(yè),學(xué)校里成績(jī)多牛。他們不會(huì)問你“你主修什么?”
                   他們更可能會(huì)說:“你會(huì)做什么?”

                        說實(shí)話,這個(gè)行業(yè)還沒有高端到去顧及每個(gè)從業(yè)人員的學(xué)歷,這不同于醫(yī)生和律師。的確,這個(gè)行業(yè)里有一些從名牌學(xué)校畢業(yè)的天才,他們對(duì)于行業(yè)來說是價(jià) 值連城的。但是那些畢竟是極少數(shù)。更多的是普通人,他們做著自己喜歡的事情,他們有天賦并且很努力去做著他們熱愛的事情。

                 是否一定需要一個(gè)大學(xué)學(xué)歷才能在行業(yè)里生存?并非如此,但并不是說去上學(xué)沒有意義,只是沒有學(xué)歷也不要郁悶,不管什么途徑學(xué)到能幫助你在職場(chǎng)安身立命的技能,才是最主要的。


                 如果我走技術(shù)路線,我需要有藝術(shù)素養(yǎng)么?  

                  毫無疑問,所有能力都需要依賴于你天生的藝術(shù)天賦,觀察細(xì)節(jié)的眼力,評(píng)價(jià)他人和自己作品的能力。雖然很多純技術(shù)性工種并不要求藝術(shù)方面的能力,但是 如果你想在CG方面變的更優(yōu)秀,你仍然需要具備一定的藝術(shù)素質(zhì)。這會(huì)讓你成為一個(gè)綜合實(shí)力很強(qiáng)的技術(shù)工作者。

                 我以前學(xué)的和CG毫不相干,進(jìn)入這個(gè)行業(yè)怎么樣?
                 這很不錯(cuò),至少你有一個(gè)后路可以做別的。不過你還是必須要選擇一個(gè)你真正將要投身的行業(yè),然后努力學(xué)習(xí)。學(xué)的多并不是一個(gè)壞事。但是有一個(gè)問題,既然你都做好了改行的準(zhǔn)備,那么你究竟下了多少的決心投身到CG行業(yè)呢?


                 我該學(xué)什么軟件好呢?

                 首先忘記軟件這個(gè)東西吧!如果你對(duì)技術(shù)性的東西有興趣,那么你需要一個(gè)很強(qiáng)悍的數(shù)學(xué)和科學(xué)基礎(chǔ)。當(dāng)然還要會(huì)編程!如果你走藝術(shù)路線,那么你 需要在傳統(tǒng)技法上下工夫,比如速描,色彩,雕塑等。先打好扎實(shí)的2D基礎(chǔ),再來玩3D。

                 軟件僅僅是一個(gè)工具而 已,行業(yè)里用到最多的3D軟件是MAYA;2D方面,PhotoShop仍然是一個(gè)必會(huì)項(xiàng)目。說到合成,你學(xué)好Shake 或者Combustion 不會(huì)有錯(cuò),會(huì)AfterEffect更好。渲染部分,Renderman和Mental Ray所占比例最大。動(dòng)作捕捉方面MotionBuilder用的最多。特效家們愛用Hudini,不過MAYA  仍然是用的最多的,尤其是它的流體,像 www.maya.la 這也是不錯(cuò)的學(xué)習(xí)交流地方。

                學(xué)什么軟件還是很重要的,因?yàn)檫@些龐雜的軟件學(xué)習(xí)起來會(huì)花費(fèi)大量的時(shí)間和精力。對(duì)一個(gè)流行的軟件你懂的越少,那么你就越不值錢。這并不是說哪個(gè)軟件更好,關(guān)鍵的是行業(yè)中用的最多的軟件是什么,這才是決定學(xué)什么軟件更有價(jià)值的關(guān)鍵!


                 馬上要畢業(yè)了,我該做什么呢?

          對(duì)于即將畢業(yè)進(jìn)入行業(yè)的學(xué)生,這里有些簡(jiǎn)單的準(zhǔn)備工作需要做:

                      開始關(guān)注招聘的信息,準(zhǔn)備好你的簡(jiǎn)歷。
                      著手制作你的作品展示或者一個(gè)demo。
                      嘗試去正式接觸和聯(lián)系那些看過你作品的公司。

                 畢業(yè)的時(shí)候,我應(yīng)該具備些什么呢?

                   最重要的東西就是你手中的demo或者是一個(gè)作品展示。當(dāng)然你還需要一個(gè)簡(jiǎn)歷,但是那相對(duì)是次要的東西。幾乎所有的人的demo都會(huì)被單獨(dú)看過,如果你畢業(yè)的時(shí)候沒有這些東西,那么你絕對(duì)沒有作好競(jìng)爭(zhēng)的準(zhǔn)備。

                 我已經(jīng)畢業(yè)了,接下來該怎么做?

                 畢業(yè)了,你就進(jìn)入了這個(gè)行業(yè)的大海開始“漂”的生活。你是新人,沒人認(rèn)識(shí)你,但是你需要一份工作。“漂”這個(gè)詞很重要。盡可能多的發(fā)送你的作品和簡(jiǎn)歷。花 時(shí)間給每個(gè)公司寫求職信,而且要保證這些信是針對(duì)這個(gè)公司而不是泛泛而寫。絕對(duì)不要寫那種很沒個(gè)性的信,那會(huì)讓你失去工作的機(jī)會(huì)。但是也別做的太過火,簡(jiǎn) 單到位就好。求職信,簡(jiǎn)歷,作品這3樣?xùn)|西都準(zhǔn)備好了,就夠了。

          關(guān)于作品,有以下幾點(diǎn)法則:

                    不要超過2分鐘,任何過多的內(nèi)容都是沒有經(jīng)驗(yàn)的表現(xiàn)。
                    最好的作品放在第一個(gè),絕對(duì)不要重復(fù)表現(xiàn)什么內(nèi)容,更不要把一些不能體現(xiàn)你最佳水平的東西放進(jìn)去充數(shù)。
                    忘記配樂吧,你的作品基本都是關(guān)掉聲音而且是被快進(jìn)看完的。很遺憾。
                    覺得你的作品很不錯(cuò),可以到 www.299.com.cn 的久久CG動(dòng)畫論壇發(fā)出來。
                    名字,電話和電子郵件要顯醒目,千萬別忘記這些聯(lián)系方式。
                    你的作品究竟有多少含金量?

                 從某種程度上說,它是無價(jià)的!進(jìn)入行業(yè)的機(jī)會(huì)是十分難得到的,你會(huì)和許多極富天賦的人來競(jìng)爭(zhēng)一個(gè)工作。如果你用一個(gè)月的時(shí)間作出一個(gè)作品,很顯然它會(huì)很有價(jià)值!世界上所有的天才藝術(shù)家絕對(duì)不會(huì)對(duì)自己的作品草草了事,不會(huì)偷懶和拖拖拉拉。作好準(zhǔn)備吧,這里充滿了競(jìng)爭(zhēng)。

                作品決定了所有的事情。它是你唯一靠的住的伙伴,也是你進(jìn)入行業(yè)唯一的敲門磚。作品會(huì)集中大部分的注意力!我有面試的機(jī)會(huì)了,但是我該怎么做呢?做你自 己!帶上內(nèi)容更多的作品和簡(jiǎn)歷,準(zhǔn)時(shí)去面試。最重要的是要誠實(shí),別夸大你的能力,那不會(huì)有什么幫助。別過分打扮,但是至少要得體。你要保持自信,他們對(duì)你 有興趣,你也要表現(xiàn)的對(duì)他們很感興趣。

                 所有的招聘都要求工作經(jīng)驗(yàn),但是我沒有經(jīng)驗(yàn),我該怎么辦?

                  這是一個(gè)存在于任何行業(yè)中的悖論。對(duì)于公司來說,畢業(yè)生代表者無名和廉價(jià)。雖然招聘要求是只需要有工作經(jīng)驗(yàn)的人,但是正因?yàn)槟惚绕渌肆畠r(jià),所以你 有機(jī)會(huì)去填補(bǔ)那些比較菜鳥的職位空缺,雖然你沒有任何工作經(jīng)驗(yàn)。工作經(jīng)驗(yàn)的要求是為了篩選人,但是公司知道畢業(yè)生仍然會(huì)不斷投送簡(jiǎn)歷。只要你確定這個(gè)工作 你可以勝任,那么你就投簡(jiǎn)歷吧!正因?yàn)槟愕牟恢阅愠錆M了可能性,公司愿意給你一次嘗試的機(jī)會(huì)。如果你得到了能證明自己的機(jī)會(huì),你該為自己高興!

                 擁有了第一份工作以后我該怎么做呢?

                  當(dāng)你還是一個(gè)新人你肯定要度過一段難熬的日子。別指望他們告訴你重要的東西,別指望他們來提拔你。你要做的就是埋頭盡最大努力工作,盡可能的學(xué)習(xí)。 你正在充實(shí)你的履歷。工作經(jīng)驗(yàn)比工資重要的多。以長(zhǎng)遠(yuǎn)眼光來考慮你的事業(yè),別僅僅目光短淺的盯在這份工作上。

          完成了最初的幾個(gè)項(xiàng)目后,你可能在某些方面贏得了一些重視。

                  你可能有足夠的經(jīng)驗(yàn)去另外的公司找到一個(gè)更好的職位。

                  你可能在本公司升職且得到更多的尊重。

                  如果可以的話,你可以試著做些新的工作,換些不同的崗位。

          第一年或者第二年間可以嘗試上面這些。但是你需要在這期間看到結(jié)果如何,否則你會(huì)陷在一個(gè)乏味的環(huán)境里。

                 眾多候選人中,HR更看重什么?

                  HR不關(guān)心你從哪里來,你努力了多久,你在學(xué)校是尖子生還是墊底的。他們只需要你拿出你的作品來證明你可以做什么。同時(shí)你需要有謙虛好學(xué)的精神,愿 意接受指導(dǎo)。持之以恒,按時(shí)完成工作,努力工作直到下班為止。讓他們看的出你是一個(gè)聰明的人,愿意自己解決問題而不是想都不想就請(qǐng)教別人。讓他們知道你是多么想把事情做好,最重要的是你的熱情!充滿了活力。這些就是HR希望在侯選者中看到的。無論是不是新人。
          posted @ 2009-07-14 16:49 蜘蛛 閱讀(263) | 評(píng)論 (0)編輯 收藏

          Problem. You want to split strings on different characters with single character or string delimiters. For example, split a string that contains ""r"n" sequences, which are Windows newlines. Solution. This document contains several tips for the Split method on the string type in the C# programming language.

          Input string: One,Two,Three,Four,Five
          Delimiter: , (char)
          Array: One (string array)
          Two
          Three
          Four
          Five

          1. Using Split

          Here we see the basic Split method overload. You already know the general way to do this, but it is good to look at the basic syntax before we move on. This example splits on a single character.

          === Example program for splitting on spaces ===

          using System;

          class Program
          {
          static void Main()
          {
          string s = "there is a cat";
          //
          // Split string on spaces.
          // This will separate all the words.
          //

          string[] words = s.Split(' ');
          foreach (string word in words)
          {
          Console.WriteLine(word);
          }
          }
          }

          === Output of the program ===

          there
          is
          a
          cat

          Description. The input string, which contains four words, is split on spaces and the foreach loop then displays each word. The result value from Split is a string[] array.

          2. Multiple characters

          Here we use either the Regex method or the C# new array syntax. Note that a new char array is created in the following usages. There is an overloaded method with that signature if you need StringSplitOptions, which is used to remove empty strings.

          === Program that splits on lines with Regex ===

          using System;
          using System.Text.RegularExpressions;

          class Program
          {
          static void Main()
          {
          string value = "cat"r"ndog"r"nanimal"r"nperson";
          //
          // Split the string on line breaks.
          // The return value from Split is a string[] array.
          //

          string[] lines = Regex.Split(value, ""r"n");

          foreach (string line in lines)
          {
          Console.WriteLine(line);
          }
          }
          }

          === Output of the program ===

          cat
          dog
          animal
          person

          Description. The first example uses Regex. Regex contains the Split method, which is static. It can be used to split strings, although it has different performance properties. The next two example show how you can specify an array as the first parameter to string Split.

          === Program that splits on multiple characters ===

          using System;

          class Program
          {
          static void Main()
          {
          //
          // This string is also separated by Windows line breaks.
          //

          string value = "shirt"r"ndress"r"npants"r"njacket";

          //
          // Use a new char[] array of two characters ("r and "n) to break
          // lines from into separate strings. Use "RemoveEmptyEntries"
          // to make sure no empty strings get put in the string[] array.
          //

          char[] delimiters = new char[] { '"r', '"n' };
          string[] parts = value.Split(delimiters, StringSplitOptions.RemoveEmptyEntries);
          for (int i = 0; i < parts.Length; i++)
          {
          Console.WriteLine(parts[i]);
          }

          //
          // Same as the previous example, but uses a new string of 2 characters.
          //

          parts = value.Split(new string[] { ""r"n" }, StringSplitOptions.None);
          for (int i = 0; i < parts.Length; i++)
          {
          Console.WriteLine(parts[i]);
          }
          }
          }

          === Output of the program ===
          (Repeated two times)

          shirt
          dress
          pants
          jacket

          Overview. One useful overload of Split receives char[] arrays. The string Split method can receive a character array as the first parameter. Each char in the array designates a new block.

          Using string arrays. Another overload of Split receives string[] arrays. This means string array can also be passed to the Split method. The new string[] array is created inline with the Split call.

          Explanation of StringSplitOptions. The RemoveEmptyEntries enum is specified. When two delimiters are adjacent, we end up with an empty result. We can use this as the second parameter to avoid this. [C# StringSplitOptions Enumeration - dotnetperls.com] The following screenshot shows the Visual Studio debugger.

          Split string debug screenshot

          3. Separating words

          Here we see how you can separate words with Split. Usually, the best way to separate words is to use a Regex that specifies non-word chars. This example separates words in a string based on non-word characters. It eliminates punctuation and whitespace from the return array.

          === Program that separates on non-word pattern ===

          using System;
          using System.Text.RegularExpressions;

          class Program
          {
          static void Main()
          {
          string[] w = SplitWords("That is a cute cat, man");
          foreach (string s in w)
          {
          Console.WriteLine(s);
          }
          Console.ReadLine();
          }

          /// <summary>
          /// Take all the words in the input string and separate them.
          /// </summary>

          static string[] SplitWords(string s)
          {
          //
          // Split on all non-word characters.
          // Returns an array of all the words.
          //

          return Regex.Split(s, @""W+");
          // @ special verbatim string syntax
          // "W+ one or more non-word characters together

          }
          }

          === Output of the program ===

          That
          is
          a
          cute
          cat
          man

          Word splitting example. Here you can separate parts of your input string based on any character set or range with Regex. Overall, this provides more power than the string Split methods. [C# Regex.Split Method Examples - dotnetperls.com]

          4. Splitting text files

          Here you have a text file containing comma-delimited lines of values. This is called a CSV file, and it is easily dealt with in C#. We use the File.ReadAllLines method here, but you may want StreamReader instead.

          Reading the following code. The C# code next reads in both of those lines, parses them, and displays the values of each line after the line number. The final comment shows how the file was parsed into the strings.

          === Contents of input file (TextFile1.txt) ===

          Dog,Cat,Mouse,Fish,Cow,Horse,Hyena
          Programmer,Wizard,CEO,Rancher,Clerk,Farmer

          === Program that splits lines in file (C#) ===

          using System;
          using System.IO;

          class Program
          {
          static void Main()
          {
          int i = 0;
          foreach (string line in File.ReadAllLines("TextFile1.txt"))
          {
          string[] parts = line.Split(',');
          foreach (string part in parts)
          {
          Console.WriteLine("{0}:{1}",
          i,
          part);
          }
          i++; // For demo only
          }
          }
          }

          === Output of the program ===

          0:Dog
          0:Cat
          0:Mouse
          0:Fish
          0:Cow
          0:Horse
          0:Hyena
          1:Programmer
          1:Wizard
          1:CEO
          1:Rancher
          1:Clerk
          1:Farmer

          5. Splitting directory paths

          Here we see how you can Split the segments in a Windows local directory into separate strings. Note that directory paths are complex and this may not handle all cases correctly. It is also platform-specific, and you could use System.IO.Path. DirectorySeparatorChar for more flexibility. [C# Path Examples - dotnetperls.com]

          === Program that splits Windows directories (C#) ===

          using System;

          class Program
          {
          static void Main()
          {
          // The directory from Windows
          const string dir = @"C:"Users"Sam"Documents"Perls"Main";
          // Split on directory separator
          string[] parts = dir.Split('""');
          foreach (string part in parts)
          {
          Console.WriteLine(part);
          }
          }
          }

          === Output of the program ===

          C:
          Users
          Sam
          Documents
          Perls
          Main

          6. Split internal logic

          The logic internal to the .NET framework for Split is implemented in managed code. The methods call into the overload with three parameters. The parameters are next checked for validity. Finally, it uses unsafe code to create the separator list, and then a for loop combined with Substring to return the array.

          7. Benchmarks

          The author tested a long string and a short string, having 40 and 1200 chars. String splitting speed varies on the type of strings. The length of the blocks, number of delimiters, and total size of the string factor into performance.

          Results. The Regex.Split option generally performed the worst. The author felt that the second or third methods would be the best, after observing performance problems with regular expressions in other situations.

          === Strings used in test ===
          //
          // Build long string.
          //

          _test = string.Empty;
          for (int i = 0; i < 120; i++)
          {
          _test += "01234567"r"n";
          }
          //
          // Build short string.
          //

          _test = string.Empty;
          for (int i = 0; i < 10; i++)
          {
          _test += "ab"r"n";
          }

          === Example methods tested (100000 iterations) ===

          static void Test1()
          {
          string[] arr = Regex.Split(_test, ""r"n", RegexOptions.Compiled);
          }

          static void Test2()
          {
          string[] arr = _test.Split(new char[] { '"r', '"n' }, StringSplitOptions.RemoveEmptyEntries);
          }

          static void Test3()
          {
          string[] arr = _test.Split(new string[] { ""r"n" }, StringSplitOptions.None);
          }

          Longer strings: 1200 chars. The benchmark for the methods on the long strings is more even. It may be that for very long strings, such as entire files, the Regex method is equivalent or even faster. For short strings, Regex is slowest, but for long strings it is very fast.

          === Benchmark of Split on long strings ===

          [1] Regex.Split: 3470 ms
          [2] char[] Split: 1255 ms [fastest]
          [3] string[] Split: 1449 ms

          === Benchmark of Split on short strings ===

          [1] Regex.Split: 434 ms
          [2] char[] Split: 63 ms [fastest]
          [3] string[] Split: 83 ms

          Short strings: 40 chars. This shows the three methods compared to each other on short strings. Method 1 is the Regex method, and it is by far the slowest on the short strings. This may be because of the compilation time. Smaller is better. [This article was last updated for .NET 3.5 SP1.]

          Performance recommendation. For programs that use shorter strings, the methods that split based on arrays are faster and simpler, and they will avoid Regex compilation. For somewhat longer strings or files that contain more lines, Regex is appropriate. I show some Split improvements that can improve your program. [C# Split Improvement - dotnetperls.com]

          8. Escaped characters

          You can use Replace on your string input to substitute special characters in for any escaped characters. This can solve lots of problems on parsing computer-generated code or data. [C# Split Method and Escape Characters - dotnetperls.com]

          9. Caching delimiters

          The author's further research into Split and its performance shows that it is worthwhile to declare your char[] array you are splitting on as a local instance to reduce memory pressure and improve runtime performance.

          === Slow version - before ===

          //
          // Split on multiple characters using new char[] inline.
          //

          string t = "string to split, ok";

          for (int i = 0; i < 10000000; i++)
          {
          string[] s = t.Split(new char[] { ' ', ',' });
          }

          === Fast version - after ===

          //
          // Split on multiple characters using new char[] already created.
          //

          string t = "string to split, ok";
          char[] c = new char[]{ ' ', ',' }; // <-- Cache this

          for (int i = 0; i < 10000000; i++)
          {
          string[] s = t.Split(c);
          }

          Interpretation of the above table. We see that storing the array of delimiters separately is good. My measurements show the above code is less than 10% faster when the array is stored outside the loop.

          10. Rewriting PHP explode

          C# has no explode method exactly like PHP explode, but you can gain the functionality quite easily with Split, for the most part. You can replace explode with the Split method that receives a string[] array. [C# PHP explode Function - dotnetperls.com]

          11. Summary

          Here we saw several examples and two benchmarks of the Split method in the C# programming language. You can use Split to divide or separate your strings while keeping your code as simple as possible. Sometimes, using IndexOf and Substring together to parse your strings can be more precise and less error-prone. [C# IndexOf String Examples - dotnetperls.com]

          posted @ 2009-07-10 14:41 蜘蛛 閱讀(916) | 評(píng)論 (0)編輯 收藏

          主站蜘蛛池模板: 县级市| 绥宁县| 将乐县| 于都县| 嘉荫县| 平凉市| 民权县| 凤凰县| 高雄县| 长岭县| 大石桥市| 龙海市| 旌德县| 大丰市| 许昌县| 吉首市| 崇明县| 高雄市| 巍山| 泸定县| 北流市| 二连浩特市| 德格县| 淄博市| 深州市| 揭阳市| 海安县| 古丈县| 互助| 铜山县| 贵州省| 赤城县| 苍南县| 新安县| 手游| 泊头市| 红桥区| 庄河市| 丹阳市| 苏尼特左旗| 禹州市|