前端_随时更新资料

intellij idea 快捷键

ctrl+shift+space(new 后面自动提示)
ctrl+shift+/ (注释)
itar后面tab (for循环)
it后面ctrl+j(很多智能代码生成)
Alt+Insert(自动生成构造函数,get,set方法)
ctrl+alt+t(自动生成try,catch)
alt+enter(创建测试类和子类)
ctrl+shift+backspace(最后编辑的地方)
ctrl+e(查看所有文件)
ctrl+shift+v(粘贴)
alt+shift+c(最近变更历史)
ctrl+shift+enter(智能完善代码 如 if())
ctrl+shift+i(快速查看实现)
ctrl+shift+up/down(移动行、合并选中行)

 

 

部署web项目一些简单的步骤 

   icq在线通讯工具嵌入,
    邮箱Apache james嵌入
    http://blog.csdn.net/zxingchao2009/article/details/7656167
    天气预报接口
    http://blog.csdn.net/zxingchao2009/article/details/7915572
    lucene搜索引擎
    http://blog.csdn.net/zxingchao2009/article/details/7662269
    微信接口
    java 发送短信
    使用webservice接口发送手机短信,这个可以使用sina提供的webservice进行发送,但是需要进行注册;(2)使用短信mao的方式进行短信的发送,这种方式应该是比较的常用,前提是需要购买硬件设备,呵呵(3)使用中国网建提供的SMS短信平台(申请账号地址:http://sms.webchinese.cn/default.shtml)
    http://blog.csdn.net/zxingchao2009/article/details/7662379
    installanywhere打包安装
    http://blog.csdn.net/zxingchao2009/article/details/6535709
    实现图片上传
    http://blog.csdn.net/zxingchao2009/article/details/6534261
    生成条形码http://blog.csdn.net/zxingchao2009/article/details/5848326
    实现自动登录
    http://blog.csdn.net/zxingchao2009/article/details/6365344
    log4j配置
    http://www.blogjava.net/kit-soft/archive/2009/08/28/292977.html
    第一步:加入log4j-1.2.8.jar到lib下。

    第二步:在CLASSPATH下建立log4j.properties。内容如下:
    第四步:在要输出日志的类中加入相关语句:

    定义属性:protected final Log log = LogFactory.getLog(getClass());
    tomcat配置;请看tomcat 开发一栏
     
    第三方账户登录
    http://huangqiqing123.iteye.com/blog/2062152
     web系统就完善了额

 

 

web前台一些常用的工具

 

snap ci 它是一个持续集成工具,能够帮助我们非常轻松的将github中的代码,部署到Heroku上,
 

web开发前台后台都要会,前台css,不需要你精通,但是一般的小问题要会改。js最好学会,很多动态的效果都需要js来做,比如图片切换,滑动菜单,ajax。页面的原型一般有专业美工写,技术人员负责把页面放进项目。后台方面数据库要会,mvc三层架构要懂。这些都会了,当个实习生没问题,
初期就这么多,以后会有更多线程安全,性能方面的东西,如何操作服务器,服务器负载均衡,还有各种索引,查找,数据统计,也许还要用到python脚本。做程序员这个真的是学无止境了。

掌握Java和Python之后,你会发现用Python写这类程序的速度会比Java快上许多.例如操作本地文件时你仅需要一行代码而不需要Java 的许多流包装类.各种语言有其天然的适合的应用范围.用Python处理一些简短程序类似与操作系统的交互编程工作最省时省力.

图片兼容ie6

<a style="background:url(http://gtms02.alicdn.com/tps/i2/T1QCl2FBtdXXb3b3_p-83-23.png);_background:none;
_filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://gtms02.alicdn.com/tps/i2/T1QCl2FBtdXXb3b3_p-83-23.png', sizingMethod='scale');" title="" href="http://wanke.etao.com/site/81.html" data-stat="" class="intro-in"></a>

生活_windows7专业版升级到旗舰版

49PB6-6BJ6Y-KHGCQ-7DDY6-TF7CD --- xxxxx-OEM-8992662-00015 --- SAMSUNG 三星

342DG-6YJR8-X92GV-V7DCV-P4K27 --- xxxxx-OEM-8992662-00400 --- DELL 戴尔

22TKD-F8XX6-YG69F-9M66D-PMJBM --- xxxxx-OEM-8992662-00497 --- IBM-LENOVO 联想

6K2KY-BFH24-PJW6W-9GK29-TMPWP-----lenovo 新的 key 联想

聊斋摘录

1.彼虽异物,情亦犹人,况又慧丽,娶之亦不为戚党笑

 

 人生感悟

 

对自己好点,一辈子不长;对身边的人好点,下辈子你们不一定能够遇见;

内伤于喜怒忧思悲恐惊七情,外伤于风寒暑湿燥火六淫所以得病;

 

如果你真正喜欢什么东西,就别让它成为你的专业,这是什么逻辑,确实不明白

noscript的写法

 <noscript> <div style="height: 45px;text-align: center;background: #31546f url('http://assets.tumblr.com/images/site_notice_bg.png') bottom repeat-x;color: #fff;font:normal 17px 'Lucida Grande',Verdana,sans-serif;line-height:45px;"> <a href="https://www.google.com/adsense/support/bin/answer.py?hl=en&amp;answer=12654" style="color:#fff;text-decoration: none;border-bottom: solid 1px #5E809C;">Javascript</a> is required to view this site. </div> </noscript>

 

table的复制_jquery实现方法


复制用 clone()
  $("#table1 tr").slice(0, 1).clone().insertAfter($("#table2 tr:eq(0)"))

$(function(){
    $("table:eq(0) tr:eq(1)")//获取第一个表格的第二行N
        .clone()//复制
        .insertAfter("table:eq(1) tr:eq(0)");//插入到第二个表格的第一行后面
    })
    
     var tr = $("#tb tr").eq(0).clone();   
     tr.appendTo("#tb");   
    
     $("#tb_id tr").eq(index).remove();
     //控制某一行程序不可见
     <input onclick="document.all.a.style.display=(document.all.a.style.display=='none')?'':'none'" type=button>

 

jquery封装的置顶效果

$(function() { 


     $.fn.manhuatoTop = function(options) { 


         var defaults = {             


             showHeight : 150, 


             speed : 1000 


         }; 


         var options = $.extend(defaults,options); 


         $("body").prepend("<div id='totop'><a>返回</a></div>"); 


         var $toTop = $(this); 


         var $top = $("#totop"); 


         var $ta = $("#totop a"); 


         $toTop.scroll(function(){ 


             var scrolltop=$(this).scrollTop();       


             if(scrolltop>=options.showHeight){                


                 $top.show(); 


             } 


             else{ 


                 $top.hide(); 


             } 


         });  


         $ta.hover(function(){        


             $(this).addClass("cur");     


         },function(){            


             $(this).removeClass("cur");      


         });  


         $top.click(function(){ 


             $("html,body").animate({scrollTop: 0}, options.speed);   


         }); 


     } 


 });

js控制图片大小

 


//最新javascript自动按比例显示图片,按比例压缩图片显示
<script type="text/javascript">
function AutoResizeImage(maxWidth,maxHeight,objImg){
var img = new Image();
img.src = objImg.src;
var hRatio;
var wRatio;
var Ratio = 1;
var w = img.width;
var h = img.height;
wRatio = maxWidth / w;
hRatio = maxHeight / h;
if (maxWidth ==0 && maxHeight==0){
Ratio = 1;
}else if (maxWidth==0){//
if (hRatio<1) Ratio = hRatio;
}else if (maxHeight==0){
if (wRatio<1) Ratio = wRatio;
}else if (wRatio<1 || hRatio<1){
Ratio = (wRatio<=hRatio?wRatio:hRatio);
}
if (Ratio<1){
w = w * Ratio;
h = h * Ratio;
}
objImg.height = h;
objImg.width = w;
}
</script>
//用法
//<img src="1.jpg" border="0" width="0" height="0" onload="AutoResizeImage(0,250,this)"/>

高级浏览器选中改变背景色


::-moz-selection{background:#93C; color:#FCF;}
::selection {background:#93C; color:#FCF;}


这样,就可以在 firefox 和 google chrome 中实现改变鼠标选中时的颜色和背景色了。只能在高级浏览器里使用

修复IE6背景缓存bug

修复IE6背景缓存bug


 /*
* 缓存正确的变量引用
*/
var document = window.document;
/*
* 修复IE6背景缓存bug
*/
try{document.execCommand("BackgroundImageCache", false, true);}catch(e){}

禁止在网页做任何操作

<body onmouseup="try{document.selection.empty()}catch(e){}" 
onbeforecopy="try{return false}catch(e){}"
oncopy="try{document.selection.empty()}catch(e){}"
onselect="try{document.selection.empty()}catch(e){}"
onselectstart="try{return false}catch(e){}"
ondragstart="try{return false}catch(e){}"
oncontextmenu="try{return false}catch(e){}"></body>

禁止将网页被iframe嵌套包含

<script>
if(self!=top){top.window.location.href=self.window.location.href}
</script> 

angularJs学习





 

 

spring多数据源问题(转载摘录)


多数据源问题可以打个比喻:假设有个工厂原来可以生产汽车,现在也想这个工厂可以生产火车。 
在这个时候,有两个解决办法:

第一种是改造这个工厂的生产设备,使得一个工厂就可以同时生产汽车和火车。

第二种是新建一个工厂,这个工厂专门生产火车。原来的工厂保持不变。



LZ 和 atianchen 用的是第一种方法。还是用一个 BeanFactory ,然后里面声明多个的 DataSource 。用这种方法就需要修改 spring 相关的类。



 spring 多数据源解决方案  

这里用的就是第二种方法,直接使用多个 BeanFactory ,每个 BeanFactory 使用的 DataSource 不同。使用这种方法,不需修改 spring 的类,而是需要修改上层调用 BeanFactory 的地方。



两种方法的差异在于:

第一种方法使用隐式的参数传递(ThreadLocal,或者SessionContext),希望对上层调用者隐藏多数据源的事实;把多数据源的功能封装在了 BeanFactory 内部。

第二种方法是直接曝露接口给上层调用者,由调用者决定怎么使用。

如果从灵活性角度来说,第二种会更好。因为调用者可以直接通过 Registry.getBeanFacrtory(xxx).getBean(yyy) 来获得相应的 bean 。对于上面有人提到一次请求中需要用到两个 DataSource 的问题,也可以解决。



由于有 servlet 的 filter 机制,或者 webwork 的 interceptor 机制,所以修改上层调用 BeanFactory 的地方也能够得到很大的简化,并不复杂。


Oracle Instant Client 配置方法

 

Oracle网站下载对应版本的Instant Client;


1.解压到D:/instantclient_10_2


2.将D:/instantclient_10_2增加到PATH环境变量中


3.增加以下环境变量:


TNS_ADMIN=D:/instantclient_10_2


NLS_LANG=SIMPLIFIED CHINESE_CHINA.ZHS16GBK (*)


ORACLE_HOME=D:/instantclient_10_2 (*)


(*):可选


4.编辑tnsnames.ora设置本地NET服务名


 


使用sqlplus进行测试:


sqlplus 用户名/密码@本地NET服务名


我觉得搜技术问题,坚决不能用百度搜索引擎,深有体会


process terminated with exit code 3 intellij idea 


以此问题为例。搜了十多分钟(百度),一直没有答案。后来换了(bing),谷歌还没用(终极神器)。问题的解决方案就出来了

 

 

 

 

 

CSS不同级别

    在属性后面使用 !important 会覆盖页面内任何位置定义的元素样式。
    作为style属性写在元素内的样式
    id选择器
    类选择器
    标签选择器
    通配符选择器
    浏览器自定义或继承   
--并不是所有的属性对行内元素都能够生效
--(所以最好不要把样式写在行内标签里,大部分能改变width/height相关的一些属性可能会失效)
    行内元素不会应用width属性,其长度是由内容撑开的
    行内元素不会应用height属性,其高度也是由内容撑开的,但是高度可以通过line-height调节
    行内元素的padding属性只用padding-left和padding-right生效,padding-top和padding-bottom会改变元素范围,但不会对其它元素造成影响
    行内元素的margin属性只有margin-left和margin-right有效,margin-top和margin-bottom无效
    行内元素的overflow属性无效,这个不用多说了
    行内元素的vertical-align属性无效(height属性无效)

一些互斥的元素
对于absolute和fixed定位的(固定大小,设置了width和height属性)元素,如果设置了top和left属性,那么设置bottom和right值就没有作用了,应该是top和left优先级高,否则同时写了浏览器怎么知道按照谁定位
    对于absolute和fixed定位的元素,如果设置了top、left、bottom、right的值后margin属性也就不起作用了
    对于absolute和fixed定位的元素,如果设置了top、left、bottom、right的值后float属性同样会失效
    块元素如果设置了float属性或者是absolute、fixed定位,那么vertical-align属性不再起作用

    

单例模式


单例模式:(
单例模式应用的场景一般发现在以下条件下:

  (1)资源共享的情况下,避免由于资源操作时导致的性能或损耗等。如上述中的日志文件,应用配置。

  (2)控制资源的情况下,方便资源之间的互相通信。如线程池等。
)
public class Singleton {
    private static Singleton instance;
 
    private Singleton(){
    }
 
    public static Singleton getInstance() {
        if (instance == null){
            synchronized(Singleton.class){
                if(instance == null) {
                     instance = new Singleton();
                }
            }
        }
        return instance;
    }
}

工厂模式



(统一管理对象的创建过程。。 统一管理对象的实例化,   使用工厂模式就象使用new一样频繁.)

结构模式

 设计模式之Adapter(使用类再生的两个方式:组合(new)和继承(extends)
将一个类的接口转换成客户希望的另外一个接口,从而使得原本由于接口不兼容而不能一起工作的类可以一起工作。)
(牵涉到 对象模式实现和类模式实现方式,前者通过构造函数(在这里new),后者通过继承extends)
public class Point {
  private int coordinateX;
  private int coordinateY;

  public Point(int coordinateX, int coordinateY){
    this.coordinateX = coordinateX;
    this.coordinateY = coordinateY;
  }
  public String toString(){
    return "Point[x=" + coordinateX + ",y=" + coordinateY + "]";
  }
  public int getCoordinateX() {
    return coordinateX;
  }
  public int getCoordinateY() {
    return coordinateY;
  }
}
public class TextView {

  public int getCoordinateX() {
    System.out.println("TextView.getCoordinateX()...");
    return 10;
  }
  public int getCoordinateY() {
    System.out.println("TextView.getCoordinateY()...");
    return 20;
  }
  public int getHeight() {
    System.out.println("TextView.getHeight()...");
    return 30;
  }
  public int getWidth() {
    System.out.println("TextView.getWidth()...");
    return 40;
  }
  public boolean isEmpty(){
    return false;
  }
}
public interface Shape {
  public Point getBottomLeftPoint();
  public Point getTopRightPoint();
}

public class TextShape2 extends TextView implements Shape {

  //通过所继承的TextView,进行协调实现
  public Point getBottomLeftPoint() {
    System.out.println("TextShape2.getBottomLeftPoint()...");
    int coordinateX = getCoordinateX();
    int coordinateY = getCoordinateY();
    return new Point(coordinateX, coordinateY);
  }

  //通过所继承的TextView,进行协调实现
  public Point getTopRightPoint() {
    System.out.println("TextShape2.getTopRightPoint()...");
    int coordinateX = getCoordinateX();
    int coordinateY = getCoordinateY();
    int height = getHeight();
    int width = getWidth();
    return new Point(coordinateX + width, coordinateY + height);
  }

  //注意: 这一点体现了类模式的优势,可以很方便地重定义父类TextView中的方法
  public int getCoordinateX() {
    System.out.println("TextShape2.getCoordinateX()...");
    return 100;
  }
}

 

BRIDGE(桥梁模式


BRIDGE(桥梁模式:将抽象化与实现化脱耦,使得二者可以独立的变化,也就是说将他们之间的强关联变成弱关联,也就是指在一个软件系统
的抽象化和实现化之间使用组合/聚合关系而不是继
承关系,从而使两者可以独立的变化。)

Boy类要追求MM类,通过赠送不同类型的礼物:warm和wild型,具体礼物有Flower和Ring。

代码:

//Gift抽象类,含有对GiftIml的一个引用变量

public class Gift {
    protected GiftImpl impl;
}

public class WarmGift extends Gift{
    public WarmGift(GiftImpl impl) {
        this.impl = impl;
    }
}

public class WildGift extends Gift {
    public WildGift(Ring ring) {
        this.impl = impl;
    }
}

//GiftIml类,表示具体的礼物类

public class GiftImpl {
}

public class Flower extends GiftImpl {
}

public class Ring extends GiftImpl {
}

//MM类,表示一个美眉

public class MM {
    private String name;
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
}

//Boy类,追求MM的男孩

public class Boy {
    private String name;
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public void pursue(MM mm) {
        //Gift g = new WarmGift(new Flower());
        Gift g = new WildGift(new Ring());
        //give(g, mm);
    }
    public void give(Gift g, MM mm) {
    }
}
Gift g = new WildGift(new Ring());

这样就可以实现不同类型礼物和具体礼物之间的组合啦~


posted @ 2014-11-12 17:54  logep  阅读(313)  评论(0)    收藏  举报