随笔-64  评论-13  文章-2  trackbacks-0
 
the method of debug jar package in MyEclipse
1 select the jar in Referenced Lib of the project
2 into it's properities
3 In java source attachment you can specify the localtion of the source code.

posted @ 2009-11-01 23:30 桂湖山 阅读(227) | 评论 (0)编辑 收藏
  VO是独立的Java Object。
  PO是由Hibernate纳入其实体容器(Entity Map)的对象,它代表了与数
据库中某条记录对应的Hibernate实体,PO的变化在事务提交时将反应到实
际数据库中。
  如果一个PO与Session对应的实体容器中分离(如Session关闭后的PO),那么
此时,它又会变成一个VO。
  一般而言,应该避免直接PO传递到系统中的其他层面,一种解决办法是,通
过一个VO,通过属性复制使其具备与PO相同属性值,并以其为传输媒质(实际上,
这个VO被用作Data Transfer Object,即所谓的DTO),将此VO传递给其他层
面以实现必须的数据传送。
  属性复制可以通过Apache Jakarta Commons Beanutils
(http://jakarta.apache.org/commons/beanutils/)组件提供的属性批
量复制功能,避免繁复的get/set操作。
下面的例子中,我们把user对象的所有属性复制到anotherUser对象中:
TUser user = new TUser();
TUser anotherUser = new TUser();
user.setName("Emma");
user.setUserType(1);
try {
BeanUtils.copyProperties(anotherUser,user);
System.out.println("UserName => "
+anotherUser.getName()
);
System.out.println("UserType => "
+ anotherUser.getUserType()
);
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}

posted @ 2009-10-26 23:03 桂湖山 阅读(513) | 评论 (0)编辑 收藏

DLL劫持现象:
1 打开IE(或者IE搜索页)出现不知名的网站
2 清空临时文件夹,断开网络,打开IE依旧出现此网页
3 启动项目不存无可疑

解决:
1 用Windows自带工具搜索“*.*”,包含内容则COPY一段不知名网页的内容
2 此时一般会搜索出一两个DLL文件(一般在system32目录下)
3 安全模式或者DOS下,删!
4 在Windows安全模式在注册表搜索相关DLL文件的键值,删!
5 回到Windows,OK~

摘自:http://bbs.ikaka.com/showtopic-4294296.aspx
posted @ 2009-10-11 11:03 桂湖山 阅读(209) | 评论 (0)编辑 收藏
Make it right before you make it faster.
  Keep it right when you make it faster.
  Make it clear before you make it faster.
  Do not sacrifice clarity for small gains in efficiency.
  Brian Kernighan

摘自“一个程序员的奋斗历程”

  http://topic.csdn.net/u/20090908/18/09923fa2-6ace-45dd-bac0-5551c19f21b4.html

posted @ 2009-10-09 10:05 桂湖山 阅读(97) | 评论 (0)编辑 收藏
  在使用ExtJs中,其
  <script> XXX.js </script>
  的放置位置将影响Ext.onReady()的执行;
  对于要使用jsp中的控件的onReady,需要将有关的<script>脚本放置到
  JSP文件的</body>后。
posted @ 2009-09-27 11:01 桂湖山 阅读(222) | 评论 (0)编辑 收藏
from
  http://www.queness.com/post/152/simple-jquery-image-slide-show-with-semi-transparent-caption


1. HTML

My ultimate objective is - to keep the html as simple as possible. So, the final product is as following. The first image has a class called "show". Class show has higher z-index, so image with this class will display on top, thus image with this class will always display on top of the rest. The second thing you need to know is the DIV with "caption" class. It has the highest z-index. That DIV will be used to display the caption. The caption is retrieve from the REL attribute in the img element. You can put html element in the REL attribute. Be aware of extra padding and margin of the html elements you used. (eg h1, p).

Have a look at the html code:

  1. <div id="gallery">  
  2.   
  3.     <a href="#" class="show">  
  4.     <img src="images/flowing-rock.jpg" alt="Flowing Rock" alt="" title="" width="580" height="360" rel="<h3>Flowing Rock</h3>You can put html element   
  5.     inside the REL attribute."/></a>  
  6.     </a>  
  7.       
  8.     <a href="#">  
  9.         <img src="images/grass-blades.jpg" alt="Grass Blades" alt="" title="" width="580" height="360" rel="<h3>Grass Blades</h3>description"/>  
  10.     </a>  
  11.       
  12.     ......  
  13.     ......  
  14.     ......  
  15.   
  16.     <div class="caption"><div class="content"></div></div>  
  17. </div>  
  18. <div class="clear"></div> 

2

CSS

In this section, I declared a container #gallery for this image slide show. The CSS for this tutorial is pretty straight foward, the most importance thing is the z-index. You have to make sure the "show" class z-index is lower than the "caption" z-index.

  1. body{  
  2.     font-family:arial  
  3. }  
  4.   
  5. .clear {  
  6.     clear:both  
  7. }  
  8.   
  9. #gallery {  
  10.     position:relative;  
  11.     height:360px  
  12. }  
  13.     #gallery a {  
  14.         float:left;  
  15.         position:absolute;  
  16.     }  
  17.       
  18.     #gallery a img {  
  19.         border:none;  
  20.     }  
  21.       
  22.     #gallery a.show {  
  23.         z-index:500  
  24.     }  
  25.   
  26.     #gallery .caption {  
  27.         z-index:600;   
  28.         background-color:#000;   
  29.         color:#ffffff;   
  30.         height:100px;   
  31.         width:100%;   
  32.         position:absolute;  
  33.         bottom:0;  
  34.     }  
  35.   
  36.     #gallery .caption .content {  
  37.         margin:5px  
  38.     }  
  39.       
  40.     #gallery .caption .content h3 {  
  41.         margin:0;  
  42.         padding:0;  
  43.         color:#1DCCEF;  
  44.     }  
  45.      

3. Javascript

Finally, the Javascript code. I have added comments in each line to explain what it does. My concept for this image slide show:

  • Hide all the images
  • Display the first image and caption
  • Find the image with "show" class, and grab the next image using next() method
  • Add "show" class to next image
  • Animate the image (fadeout the current image, fadein next image)
  • And, it repeats above steps over and over again
  1. $(document).ready(function() {        
  2.       
  3.     //Execute the slideShow  
  4.     slideShow();  
  5.   
  6. });  
  7.   
  8. function slideShow() {  
  9.   
  10.     //Set the opacity of all images to 0  
  11.     $('#gallery a').css({opacity: 0.0});  
  12.       
  13.     //Get the first image and display it (set it to full opacity)  
  14.     $('#gallery a:first').css({opacity: 1.0});  
  15.       
  16.     //Set the caption background to semi-transparent  
  17.     $('#gallery .caption').css({opacity: 0.7});  
  18.   
  19.     //Resize the width of the caption according to the image width  
  20.     $('#gallery .caption').css({width: $('#gallery a').find('img').css('width')});  
  21.       
  22.     //Get the caption of the first image from REL attribute and display it  
  23.     $('#gallery .content').html($('#gallery a:first').find('img').attr('rel'))  
  24.     .animate({opacity: 0.7}, 400);  
  25.       
  26.     //Call the gallery function to run the slideshow, 6000 = change to next image after 6 seconds  
  27.     setInterval('gallery()',6000);  
  28.       
  29. }  
  30.   
  31. function gallery() {  
  32.       
  33.     //if no IMGs have the show class, grab the first image  
  34.     var current = ($('#gallery a.show')?  $('#gallery a.show') : $('#gallery a:first'));  
  35.   
  36.     //Get next image, if it reached the end of the slideshow, rotate it back to the first image  
  37.     var next = ((current.next().length) ? ((current.next().hasClass('caption'))? $('#gallery a:first') :current.next()) : $('#gallery a:first'));     
  38.       
  39.     //Get next image caption  
  40.     var caption = next.find('img').attr('rel');   
  41.       
  42.     //Set the fade in effect for the next image, show class has higher z-index  
  43.     next.css({opacity: 0.0})  
  44.     .addClass('show')  
  45.     .animate({opacity: 1.0}, 1000);  
  46.   
  47.     //Hide the current image  
  48.     current.animate({opacity: 0.0}, 1000)  
  49.     .removeClass('show');  
  50.       
  51.     //Set the opacity to 0 and height to 1px  
  52.     $('#gallery .caption').animate({opacity: 0.0}, { queue:false, duration:0 }).animate({height: '1px'}, { queue:true, duration:300 });   
  53.       
  54.     //Animate the caption, opacity to 0.7 and heigth to 100px, a slide up effect  
  55.     $('#gallery .caption').animate({opacity: 0.7},100 ).animate({height: '100px'},500 );  
  56.       
  57.     //Display the content  
  58.     $('#gallery .content').html(caption);  
  59.          


posted @ 2009-08-21 10:08 桂湖山 阅读(524) | 评论 (0)编辑 收藏

Struts Menu中基于角色的权限管理

参见其文档;
 /docs/security.html
或学网的中文翻译
  http://www.xue5.com/itedu/200702/92774.html

posted @ 2009-06-22 08:54 桂湖山 阅读(267) | 评论 (0)编辑 收藏
 将project's properties 中的java Build Path 中的错误路径删除掉,并加入足够的类库即可。
posted @ 2009-06-10 15:50 桂湖山| 编辑 收藏

转自:http://support.microsoft.com/kb/274188/zh-cn

解决孤立用户问题的步骤

  1. 为前一步中的孤立用户运行以下命令:
    Use Northwind
    go
    sp_change_users_login 'update_one', 'test', 'test'
    这样,就将服务器登录“test”与 Northwind 数据库用户“test”重新连接起来。sp_change_users_login 存储过程还可以使用“auto_fix”参数对所有孤立用户执行更新,但不推荐这样做,因为 SQL Server 会尝试按名称匹配登录和用户。大多数情况下这都是可行的;但是,如果用户与错误登录关联,该用户可能拥有错误的权限。
  2. 在上一步中运行代码后,用户就可以访问数据库了。然后用户可以使用 sp_password 存储过程更改密码:
    Use master 
    go
    sp_password NULL, 'ok', 'test'
    此存储过程不能用于 Microsoft Windows NT 安全帐户。通过 Windows NT 网络帐户连接到 SQL Server 服务器的用户是由 Windows NT 授权的;因此,这些用户只能在 Windows NT 中更改密码。

    只有 sysadmin 角色的成员可以更改其他用户的登录密码。

posted @ 2008-12-22 11:23 桂湖山 阅读(93) | 评论 (0)编辑 收藏

1 use Cache Var such as
  detailE1
 
2 use Class
  contentPanel
     default contains all the items such as below:
      items:[
        //from basic.js
        start,absolute,accordion,anchor,border,cardTabs,cardWizard,column,fit,form,table,
        //form custom.js
        rowLayout,centerLayout,
        //from combination.js
        absoluteForm,tabsNsetedLayouts
      ]
  treePanel
     use “loader:new Ext.tree.TreeLoader ({dataUrl:'tree-date.json'})” property the load the data
  detailsPanel

3 use Viewport to contain all the panels
   items:[treePanel,detailsPanel]

4 use treePanel.on('click',function(n){...}) to deal the event
  in event handle:
  use Ext.getCmp('content-panel').layout.setActiveItem(n.id+'-panel') to active the selected Item
  use detailE1.hide().update(Ext.getDom(n.id+'-details').innerHTML).slideIn('1',{stopFx:true,duration:.2})
  to show the notes of the treeNode.
 

类的定义
Employee = function(name){  
  1.     this.name = name;  
  2.     this.addEvents({  
  3.         "fired" : true,  
  4.         "quit" : true  
  5.     });  

各控件的定义
 如 arv={
      id:  ..
      title: ..
      layout: ..
      xtype:  see below
      items: [ json,json2,... ]};

All visual widgets that require rendering into a layout should subclass Component (or Ext.BoxComponent if managed box model handling is required).

Every component has a specific xtype, which is its Ext-specific type name, along with methods for checking the xtype like getXType and isXType. This is the list of all valid xtypes:
  
  1. xtype            Class  
  2. -------------    ------------------  
  3. box              Ext.BoxComponent  
  4. button           Ext.Button  
  5. colorpalette     Ext.ColorPalette  
  6. component        Ext.Component  
  7. container        Ext.Container  
  8. cycle            Ext.CycleButton  
  9. dataview         Ext.DataView  
  10. datepicker       Ext.DatePicker  
  11. editor           Ext.Editor  
  12. editorgrid       Ext.grid.EditorGridPanel  
  13. grid             Ext.grid.GridPanel  
  14. paging           Ext.PagingToolbar  
  15. panel            Ext.Panel  
  16. progress         Ext.ProgressBar  
  17. propertygrid     Ext.grid.PropertyGrid  
  18. slider           Ext.Slider  
  19. splitbutton      Ext.SplitButton  
  20. statusbar        Ext.StatusBar  
  21. tabpanel         Ext.TabPanel  
  22. treepanel        Ext.tree.TreePanel  
  23. viewport         Ext.Viewport  
  24. window           Ext.Window 

  1. Toolbar components  
  2. ---------------------------------------  
  3. toolbar          Ext.Toolbar  
  4. tbbutton         Ext.Toolbar.Button  
  5. tbfill           Ext.Toolbar.Fill  
  6. tbitem           Ext.Toolbar.Item  
  7. tbseparator      Ext.Toolbar.Separator  
  8. tbspacer         Ext.Toolbar.Spacer  
  9. tbsplit          Ext.Toolbar.SplitButton  
  10. tbtext           Ext.Toolbar.TextItem  
  11.   
  12. Form components  
  13. ---------------------------------------  
  14. form             Ext.FormPanel  
  15. checkbox         Ext.form.Checkbox  
  16. combo            Ext.form.ComboBox  
  17. datefield        Ext.form.DateField  
  18. field            Ext.form.Field  
  19. fieldset         Ext.form.FieldSet  
  20. hidden           Ext.form.Hidden  
  21. htmleditor       Ext.form.HtmlEditor  
  22. label            Ext.form.Label  
  23. numberfield      Ext.form.NumberField  
  24. radio            Ext.form.Radio  
  25. textarea         Ext.form.TextArea  
  26. textfield        Ext.form.TextField  
  27. timefield        Ext.form.TimeField  
  28. trigger          Ext.form.TriggerField      
//显式创建所容纳的组件
var panel = new Ext.Panel({
...
items: [
new Ext.Button({
text: 'OK'
})
]
};
 
//使用xtype创建
var panel = new Ext.Panel({
...
items: [{
xtype: 'button',
text: 'OK'
}]
};

第一个例子中,面板初始化的同时,按钮总是会立即被创建的。如果加入较多的组件,这种方法很可能界面的渲染速度。第二例子中,按钮直到面板真正在浏览器上显示才会被创建和渲染。

如果面板从未显示(例如有个tab一直是隐藏的),那么按钮就不会被创建,不会消耗任何资源了。

 



posted @ 2008-11-25 10:07 桂湖山 阅读(1403) | 评论 (1)编辑 收藏
仅列出标题
共7页: 1 2 3 4 5 6 7