探索与发现

研究java技术

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  83 随笔 :: 0 文章 :: 109 评论 :: 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">市场价:¥100.00</span></p>
 <p><span class="price">购买价:¥90.00</span></p>
 <p class="buylist">购买数量 <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">市场价:¥120.00</span></p>
 <p><span class="price">购买价:¥120.00</span></p>
 <p class="buylist">购买数量 <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">市场价:¥100.00</span></p>
 <p><span class="price">购买价:¥100.00</span></p>
 <p class="buylist">购买数量 <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">市场价:¥100.00</span></p>
 <p><span class="price">购买价:¥100.00</span></p>
 <p class="buylist">购买数量 <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">市场价:¥100.00</span></p>
 <p><span class="price">购买价:¥100.00</span></p>
 <p class="buylist">购买数量 <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 蜘蛛 阅读(298) | 评论 (0)编辑 收藏

为测试 Flex 应用程序设置测试环境

正确的用于测试 Flex 应用程序的环境设置将有助于确保可靠的功能测试结果。测试环境一般由测试人员在测试计算机上进行设置。

关于此任务

要设置测试环境:

过程

  1. 检查浏览器的设置:
    1. Internet Explorer:
      1. 打开 Internet Explorer。
      2. 单击工具 > 互联网选项
      3. 单击安全性选项卡。
      4. 选择适当的 Web 内容区域。执行下列某个步骤:
        • 如果在远程机器上配置了 Web 服务器,那么请完成下列步骤:
          1. 选择本地内部网
          2. 单击站点 > 高级
          3. 将此 Web 站点添加到区域字段中,输入要添加到 Web 站点的 URL。
          4. 单击添加,然后单击确定
        • 如果在本地主机上配置了 Web 服务器,那么请完成下列步骤:
          1. 选择本地内部网
          2. 单击定制级别
          3. 复位至列表中,选择中低
          4. 在“设置”窗格中,针对初始化且脚本 ActiveX 控件不标记为安全一项单击启用
          5. 单击确定
    2. Firefox:
      1. 单击工具 > 选项 > 内容
      2. 清除阻止弹出窗口复选框。
      3. 单击工具 > 选项 > 安全
      4. 清除当有站点试图安装插件时发出警告复选框。
  2. 打开 IBM Rational Functional Tester,然后单击配置 > 启用测试环境。必须启用所需要的 JRE 并将 Internet Explorer 设置为缺省 Web 浏览器。
  3. 在“Web 浏览器”页面中启用所需要的浏览器。
  4. 将测试下应用程序设置为可信以在本地运行应用程序。指向单个文件或目录的路径处于可信状态,同时所有的文件将会分配到每个选定的目录及其可信的子目录中。按照下列步骤来分配信任目标:
    1. 在 C:\WINDOWS\system32\Macromed\Flash 中创建文件夹 FlashPlayerTrust。
    2. 在 FlashPlayerTrust 文件夹中创建一个名为 Flex 且不带扩展名的文件。
    3. 在 Flex 文件中输入 Flex 应用程序的目录路径。例如,如果 Flex 应用程序位于 C:\Test 目录中,请在 Flex 文件中输入路径 C:\Test
    4. 保存文件。
posted @ 2010-07-27 06:00 蜘蛛 阅读(241) | 评论 (0)编辑 收藏

http://unitedmindset.com/jonbcampos/2009/08/12/flex-best-practices-events/
posted @ 2009-09-18 06:53 蜘蛛 阅读(405) | 评论 (2)编辑 收藏

http://www.davidtucker.net/category/cairngorm/
posted @ 2009-09-15 20:36 蜘蛛 阅读(192) | 评论 (0)编辑 收藏

1.可以使用PopUpManager进行界面切换
2.使用状态(state),自定义一些状态事件(StateEvent),在index.mxml(mx:application)中监听组件派发的状态事件类型,利用改变状态来改变显示的界面.


⑴用第一种方式来实现相对简单,利用PopUpManager的一些静态方法即可实现,比较适用于一些size相对较小的可视化组件,比如:登陆表单组件,或修改一个值,要求重新输入一个新值等等类似情况.实现示例代码如下:

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来改变显示的界面则要相对复杂许多.

①首先我们需要自定义统一的状态事件名称

Java代码
  1. <span style="font-size: small;">package note.events{  
  2. /** 
  3.  * 状态事件,每个状态值要和状态名称一样 
  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项目的主程序中定义state,当然也可以加上状态切换的动画.

Html代码
  1. <span style="font-size: small;"><!-- 定义状态,我们分别定义了三个状态,每个状态对应一个自定义的可视化组件  -->  
  2.     <mx:states>  
  3.         <mx:State name="loginState">  
  4.             <mx:AddChild position="lastChild">  
  5.                 <!-- 状态对应的自定义组件:登陆组件 -->  
  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.                 <!-- 状态对应的自定义组件:添加留言组件 -->  
  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.                 <!-- 状态对应的自定义组件:添加用户组件 -->  
  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>  

③在组件中派发状态事件(StateEvent)

Js代码
  1. <span style="font-size: small;"> //关闭添加留言组件的时候派发"空"状态事件,也就是主程序界面不显示其他组件     
  2.  //如果想显示其他组件,则派发相应的状态事件     
  3.  internal function closeMySelf():void{    
  4.         appModel.dispatchEvent(new Even(StateEvent.NULL_STATE));    
  5.  }</span>  

④在主程序界面中监听状态事件(StateEvent),从而通过改变状态来显示我们需要的组件.

Js代码
  1. <span style="font-size: small;">                                                //添加状态事件监听,在程序初始化的时候执行  
  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.             //状态事件处理函数  
  8.             internal function stateEventHandler(evt:Event):void{  
  9.                 this.currentState = evt.type.toString();  
  10.             }</span>  

在项目中appModel是一个继承 EventDispatcher,使用单例模式实现的程序模型.不知道读者是否发现StateEvent中事件名称是和主程序界面中定义的state的 name值是一致的.因为这样定义我们就可以使用统一的状态事件处理函数,就不需要先去判断是哪个状态事件,在来改变当前状态.只要简单的执行 this.currentState = evt.type.toString();

posted @ 2009-09-10 17:50 蜘蛛 阅读(2844) | 评论 (2)编辑 收藏

http://blog.csdn.net/lixinye0123
posted @ 2009-08-24 06:31 蜘蛛 阅读(366) | 评论 (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 蜘蛛 阅读(575) | 评论 (3)编辑 收藏

http://msp.sfsu.edu/Instructors/rey/aepage/tutorials.html
posted @ 2009-08-05 02:17 蜘蛛 阅读(210) | 评论 (0)编辑 收藏

     摘要: Photoshop超级技巧 色彩技巧    139. Photoshop是32位应用程序,为了正确地观看文件,须将屏幕设置为24位彩色。    140. 先执行“视图”→“新视图”命令,产生有关新视窗后,再执行“视图”→“预览”...  阅读全文
posted @ 2009-07-31 14:35 蜘蛛 阅读(382) | 评论 (0)编辑 收藏

和动画一样,剪辑这个词涵盖的东西太多,以至于我们无从下口。到底什么是剪辑,

什么算剪辑,业内人也说不清楚,更别说介绍给普通观众了。我们从那些有记可查

的各种定义,定律,课本文章里跳出来,只谈谈感受–剪辑:剪什么?

以我的感受,面对一个片子或者是面对一个未出生的片子我们到底应该先剪什么?

首先剪到的应当是

1、剪调性,其次是

2、剪情绪,再次是

3、剪内容, 之后是

3、剪故事,然后是

4、剪道理,次之是

5、剪镜头,再次是

6、剪音乐,最次是

7、剪手法,完后才是

8、剪技术。

其中调性是和产品,和目标,和观众,和影片相关的,就是我们究竟要做一个什么

片子,给谁看,说的是男人的事还是娘们儿的事,是个广告还是专题,是诗歌还是

散文,是政府报告,还是书情小调–于是我们有了影片的调性,它决定了创作者

的情绪。

情绪,是控制影片的主观元素,我们将”我”,将代表”我”的”情绪”放在代表

客观产品和客户的调性要求之后,是因为我们需要以承认一个好的剪辑是在为客户

和观众剪辑的先决条件下确立的。因为调性的确立,而导引出”我”在整个影片控

制中的情绪应当是什么样的。当情绪控制完整时,我们进入了一个状态,开剪!

我们把情绪从空中迫降到内容,面对一大堆素材,内容的整理分类和控制、想象成

了一个庞大的工作,在这么庞大复杂甚至是有点机械重复的过程中,千万不要失去

情绪,选择素材时候还要时刻考虑调性。而这一步针对内容的筛选和分析,是影片

对错的基本保证。

内容确认,将零散的内容剪辑组织成有趣的故事,常常被看做是剪辑的魅力所在。

我们可以用剪辑影响情绪故事甚至改变内容,总之一切虽然在你手中,却依靠想象

力才能走得更远。人人心中有,各个笔下无。电视包装的故事往往并不复杂,但希

望通过剪辑增加信息量并且要求极其清晰和准确的表达。这里需要大量的训练和思

考。

故事的背后要考虑道理,往往剪辑时候需要一个理由,这个理由不一定有机会说出

来或者是展示给每个观众,或者是让每个观众都能体会到理由所在,但是剪辑师必

须有一个理由,能够说服自己剪下去的理由,能够将当前镜头和前后镜头连接起来

的理由。这个理由可能是内容的情绪的故事的,或也可能是镜头运动的,色彩的,

修辞的,反正需要一个理由,将影片进行到底!

道理依靠镜头的组织,这里我们终于剪到镜头了。这是一个很视觉的活,这是一个

很镜头感的饕餮。景别,运动,正反打,一个镜头一个镜头的衔接,一个堡垒一个

堡垒的推进,一组镜头和一组镜头的对话,镜头就是实在的字,讲着道理说着故事。

没有镜头,也可以剪辑,用黑场替代你现在不存在的镜头。我们依然可以组织影片。

镜头的另一魅力就是时长和观众的心理预期,恰到好处的镜头长短,如呼吸般可以

与观众同步,在同步的呼吸中控制观众的节奏,一定要在心里下一个预期前给一个

准确的时长。甚至可以留下一点点遗憾。这就是镜头的魅力。

配合情绪,故事和镜头的音乐举足轻重。但是只会按照音乐剪辑的剪辑,毫无控制

力。他们的影片就像流水帐一样”进人意料”。实际上音乐,同期,字幕,画面同

时构成一个 立体的影片空间与线索。完全可以通过音乐的控制手法去讲故事。对于

影片音乐无可厚非属于一个乘数,而非简陋的加法。

其次我们还有N多种剪辑手法配合,实际上可以把剪辑影片理解成一段舞曲,一段

旋律,我们变换的剪辑手法无非是123,223,323 423……或者是忽然转变成11123

—11223—11323……旋律的变化 ,节奏的调整。这些统称为剪辑手法,可以从广

告带中积累。当然也可以自己创造。而现代剪辑中我认为一些拍摄技巧可以说是从

剪辑中来的,也可以变成一种剪辑技巧。合成也是一种剪辑。合成影响了影片的色

调,质感,景别的重构,这些对剪辑都明显的帮衬作用。

最后要剪技术,这个不用多提,市场上,培训上也提的过多。我们再去技术上争你

死我活都没用。还是少提点为好,或者下一帖再说。

从技术上来说,剪辑软件都类似,看不出多少分别(实际还是有区别的),基本上

快的话一天就能学会慢的话两三个月也能了。之后,你就会剪辑了吗?你就懂得剪

辑了吗?一切要从实践中来。

回头看看:

1、剪调性,其次是

2、剪情绪,再次是

3、剪内容, 之后是

4、剪故事,然后是

5、剪道理,次之是

6、剪镜头,再次是

7、剪音乐,最次是

8、剪手法,完后才是

9、剪技术。

剪到手法还是音乐? —-你剪到了哪一步呢?

同志们!–剪出九级。

posted @ 2009-07-29 10:32 蜘蛛 阅读(270) | 评论 (0)编辑 收藏

http://itbbs.pconline.com.cn/dv/8515019.html
posted @ 2009-07-25 09:27 蜘蛛 阅读(183) | 评论 (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 蜘蛛 阅读(162) | 评论 (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 蜘蛛 阅读(216) | 评论 (0)编辑 收藏

美国教师Joe Harkins给即将毕业的CG动画大学生一封信

偶然在网上看到了这篇帖子,是一位名叫Joe Harkins的美国教师为了解答学生们的疑惑而发表的一封信。Joe Harkins从一个过来人的角度,解答了刚刚入行或者正在准备入行年轻人存在的一些疑惑。虽然有一些问题不适合中国学生,但是也有很多代表性的问题,能给我们一些启发。

              作为一个在各个学校演讲的演讲者,旧金山艺术学院新媒体传达中心和SIGGRAPH任教的老师, Joe Harkins会收到无数电子邮件。在回复了上百封邮件后,他逐渐认识到几乎所有的学生都关心这样一个信息:他们想知道他们所受的教育的真正价值有多少。

              他们需要一个真正诚恳的,有经验的人来评判他们的作品。最重要的是他们想知道如何才能获得一份工作。

         我应该去学校拿一个学位吗?

        是否上学拿学位并不是关键。毕业了以后没有人会在意你这个了。他们不想知道你在哪里毕业,学校里成绩多牛。他们不会问你“你主修什么?”
         他们更可能会说:“你会做什么?”

              说实话,这个行业还没有高端到去顾及每个从业人员的学历,这不同于医生和律师。的确,这个行业里有一些从名牌学校毕业的天才,他们对于行业来说是价 值连城的。但是那些毕竟是极少数。更多的是普通人,他们做着自己喜欢的事情,他们有天赋并且很努力去做着他们热爱的事情。

       是否一定需要一个大学学历才能在行业里生存?并非如此,但并不是说去上学没有意义,只是没有学历也不要郁闷,不管什么途径学到能帮助你在职场安身立命的技能,才是最主要的。


       如果我走技术路线,我需要有艺术素养么?  

        毫无疑问,所有能力都需要依赖于你天生的艺术天赋,观察细节的眼力,评价他人和自己作品的能力。虽然很多纯技术性工种并不要求艺术方面的能力,但是 如果你想在CG方面变的更优秀,你仍然需要具备一定的艺术素质。这会让你成为一个综合实力很强的技术工作者。

       我以前学的和CG毫不相干,进入这个行业怎么样?
       这很不错,至少你有一个后路可以做别的。不过你还是必须要选择一个你真正将要投身的行业,然后努力学习。学的多并不是一个坏事。但是有一个问题,既然你都做好了改行的准备,那么你究竟下了多少的决心投身到CG行业呢?


       我该学什么软件好呢?

       首先忘记软件这个东西吧!如果你对技术性的东西有兴趣,那么你需要一个很强悍的数学和科学基础。当然还要会编程!如果你走艺术路线,那么你 需要在传统技法上下工夫,比如速描,色彩,雕塑等。先打好扎实的2D基础,再来玩3D。

       软件仅仅是一个工具而 已,行业里用到最多的3D软件是MAYA;2D方面,PhotoShop仍然是一个必会项目。说到合成,你学好Shake 或者Combustion 不会有错,会AfterEffect更好。渲染部分,Renderman和Mental Ray所占比例最大。动作捕捉方面MotionBuilder用的最多。特效家们爱用Hudini,不过MAYA  仍然是用的最多的,尤其是它的流体,像 www.maya.la 这也是不错的学习交流地方。

      学什么软件还是很重要的,因为这些庞杂的软件学习起来会花费大量的时间和精力。对一个流行的软件你懂的越少,那么你就越不值钱。这并不是说哪个软件更好,关键的是行业中用的最多的软件是什么,这才是决定学什么软件更有价值的关键!


       马上要毕业了,我该做什么呢?

对于即将毕业进入行业的学生,这里有些简单的准备工作需要做:

            开始关注招聘的信息,准备好你的简历。
            着手制作你的作品展示或者一个demo。
            尝试去正式接触和联系那些看过你作品的公司。

       毕业的时候,我应该具备些什么呢?

         最重要的东西就是你手中的demo或者是一个作品展示。当然你还需要一个简历,但是那相对是次要的东西。几乎所有的人的demo都会被单独看过,如果你毕业的时候没有这些东西,那么你绝对没有作好竞争的准备。

       我已经毕业了,接下来该怎么做?

       毕业了,你就进入了这个行业的大海开始“漂”的生活。你是新人,没人认识你,但是你需要一份工作。“漂”这个词很重要。尽可能多的发送你的作品和简历。花 时间给每个公司写求职信,而且要保证这些信是针对这个公司而不是泛泛而写。绝对不要写那种很没个性的信,那会让你失去工作的机会。但是也别做的太过火,简 单到位就好。求职信,简历,作品这3样东西都准备好了,就够了。

关于作品,有以下几点法则:

          不要超过2分钟,任何过多的内容都是没有经验的表现。
          最好的作品放在第一个,绝对不要重复表现什么内容,更不要把一些不能体现你最佳水平的东西放进去充数。
          忘记配乐吧,你的作品基本都是关掉声音而且是被快进看完的。很遗憾。
          觉得你的作品很不错,可以到 www.299.com.cn 的久久CG动画论坛发出来。
          名字,电话和电子邮件要显醒目,千万别忘记这些联系方式。
          你的作品究竟有多少含金量?

       从某种程度上说,它是无价的!进入行业的机会是十分难得到的,你会和许多极富天赋的人来竞争一个工作。如果你用一个月的时间作出一个作品,很显然它会很有价值!世界上所有的天才艺术家绝对不会对自己的作品草草了事,不会偷懒和拖拖拉拉。作好准备吧,这里充满了竞争。

      作品决定了所有的事情。它是你唯一靠的住的伙伴,也是你进入行业唯一的敲门砖。作品会集中大部分的注意力!我有面试的机会了,但是我该怎么做呢?做你自 己!带上内容更多的作品和简历,准时去面试。最重要的是要诚实,别夸大你的能力,那不会有什么帮助。别过分打扮,但是至少要得体。你要保持自信,他们对你 有兴趣,你也要表现的对他们很感兴趣。

       所有的招聘都要求工作经验,但是我没有经验,我该怎么办?

        这是一个存在于任何行业中的悖论。对于公司来说,毕业生代表者无名和廉价。虽然招聘要求是只需要有工作经验的人,但是正因为你比其他人廉价,所以你 有机会去填补那些比较菜鸟的职位空缺,虽然你没有任何工作经验。工作经验的要求是为了筛选人,但是公司知道毕业生仍然会不断投送简历。只要你确定这个工作 你可以胜任,那么你就投简历吧!正因为你的不知名,所以你充满了可能性,公司愿意给你一次尝试的机会。如果你得到了能证明自己的机会,你该为自己高兴!

       拥有了第一份工作以后我该怎么做呢?

        当你还是一个新人你肯定要度过一段难熬的日子。别指望他们告诉你重要的东西,别指望他们来提拔你。你要做的就是埋头尽最大努力工作,尽可能的学习。 你正在充实你的履历。工作经验比工资重要的多。以长远眼光来考虑你的事业,别仅仅目光短浅的盯在这份工作上。

完成了最初的几个项目后,你可能在某些方面赢得了一些重视。

        你可能有足够的经验去另外的公司找到一个更好的职位。

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

        如果可以的话,你可以试着做些新的工作,换些不同的岗位。

第一年或者第二年间可以尝试上面这些。但是你需要在这期间看到结果如何,否则你会陷在一个乏味的环境里。

       众多候选人中,HR更看重什么?

        HR不关心你从哪里来,你努力了多久,你在学校是尖子生还是垫底的。他们只需要你拿出你的作品来证明你可以做什么。同时你需要有谦虚好学的精神,愿 意接受指导。持之以恒,按时完成工作,努力工作直到下班为止。让他们看的出你是一个聪明的人,愿意自己解决问题而不是想都不想就请教别人。让他们知道你是多么想把事情做好,最重要的是你的热情!充满了活力。这些就是HR希望在侯选者中看到的。无论是不是新人。
posted @ 2009-07-14 16:49 蜘蛛 阅读(243) | 评论 (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 蜘蛛 阅读(875) | 评论 (0)编辑 收藏