http://www.blogjava.net/wmcoo/articles/333345.html [cra…
不静之心
作者:<span class="vcard">不静之心</span>
Spring,Hibernate注解
<context:component-scan />指定Bean扫描的包,多个包逗号隔开,任何标注…
关于注解的参考
参考: http://sducxh.iteye.com/blog/639761 http://zhangli-…
SVN库搜索引擎 SupoSE
http://www.oschina.net/p/supose Subversion Repository S…
移动文件夹
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
function move_d($source, $target) { if (is_dir ( $source )) { $dest_name = basename ( $source ); if (! mkdir ( $target . $dest_name )) { return false; } $d = dir ( $source ); while ( ($entry = $d->read ()) !== false ) { if (is_dir ( $source . $entry )) { if ($entry == "." || $entry == "..") { continue; } else { move_d ( "$source$entry\\", "$target$dest_name\\" ); } } else { if (! copy ( "$source$entry", "$target$dest_name\\$entry" )) { return false; }else{ unlink($source); } } } } else { if (! copy ( "$source$entry", "$target$dest_name\\" )) { return false; } } return true; } |
删除文件夹
强制删除:[第二个参数true的时候是强制删除] [crayon-6a880f77c1201651227308…
php创建文件
|
1 2 3 4 5 6 |
<?php $counter_file = 'aa.txt ';//文件名及路径,在当前目录下新建aa.txt文件 $fopen = fopen($counter_file, 'wb ');//新建文件命令 fputs($fopen, 'aaaaaa ');//向文件中写入内容; fclose($fopen); ?> |
PHP 过滤HTML代码空格,回车换行符的函数
|
1 2 3 4 5 6 7 8 9 10 11 |
function deletehtml($str) { $str = trim($str); $str=strip_tags($str,""); $str=preg_replace("{\t}","",$str); $str=preg_replace("{\r\n}","",$str); $str=preg_replace("{\r}","",$str); $str=preg_replace("{\n}","",$str); $str=preg_replace("{ }","",$str); return $str; } |
Thinkphp开发时关闭缓存的方法
因在开发中需要经常修改,从而要经常删除缓存,才能看到效果。 所以为了开发的方便,可以把缓存给去除。 1.找到\…
Table 中Td为空时 显示边框的方法
Table 中Td为空时 显示边框的方法 你的table {border-collapse:collapse;…
JQuery应用三:菜单效果
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
<%@ page language="java" import="java.util.*" pageEncoding="GBK"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>JQuery菜单</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <link rel="stylesheet" type="text/css" href="css/menu.css"> <script type="text/javascript" src="js/jquery-1.4.2.js"></script> <script language="javascript"> $(document).ready(function(){ //查找所有主菜单 //$(".main > a,.hmain > a").click(function(){ $(".main > a").click(function(){ //当前菜单已经展开,取消确事件 if($(this).css("background-image").indexOf("expanded.gif")>=0){ changeIcon($(this));//改变左边的图标 var ulNode = $(this).next("ul"); ulNode.slideToggle(); return; } //把其它展开的都关闭 $(".main >a ").each(function(index){ if($(this).css("background-image").indexOf("expanded.gif")>=0){ changeIcon($(this)); var ulNode = $(this).next("ul"); //slideUp():通过高度变化(向上减小)来动态地隐藏所有匹配的元素,在隐藏完成后可选地触发一个回调函数。 ulNode.slideUp(); } }); changeIcon($(this));//改变左边的图标 var ulNode = $(this).next("ul"); /* if(ulNode.css("display")=="none"){ ulNode.css("display","block"); }else{ ulNode.css("display","none"); } */ //JQuery动画效果 //ulNode.show("slow");//slow,normal,fast //ulNode.hide(300); //ulNode.toggle("slow"); //ulNode.slideDown("normal"); //ulNode.slideUp(); //slideToggle():通过高度变化来切换所有匹配元素的可见性,并在切换完成后可选地触发一个回调函数 ulNode.slideToggle(); }); //hover:一个模仿悬停事件(鼠标移动到一个对象上面及移出这个对象)的方法 $(".hmain").hover(function(){ var liNode = $(this); var aNode = liNode.children("a"); if(aNode.css("background-image").indexOf("collapsed.gif")>=0){ //延迟处理,防止用户不小心划动 timeoutid = setTimeout(function(){ changeIcon(aNode); //slideDown():与slideUp()相反 liNode.children("ul").slideDown(); },300); } },function(){ clearTimeout(timeoutid); var aNode = $(this).children("a"); if(aNode.css("background-image").indexOf("expanded.gif")>=0){ changeIcon(aNode); $(this).children("ul").slideUp(); } }); }); //改变当菜单项的background-image function changeIcon(mainNode){ if(mainNode){//不为空 if(mainNode.css("background-image").indexOf("collapsed.gif")>=0){ mainNode.css("background-image","url(images/expanded.gif)"); }else{ mainNode.css("background-image","url(images/collapsed.gif)"); } } } </script> </head> <body> <div> <ul> <li class="main"> <a href="#">菜单项1</a> <ul> <li><a href="#">子菜单项11</a></li> <li><a href="#">子菜单项12</a></li> <li><a href="#">子菜单项13</a></li> </ul> </li> <li class="main"> <a href="#">菜单项2</a> <ul> <li><a href="#">子菜单项21</a></li> <li><a href="#">子菜单项22</a></li> <li><a href="#">子菜单项23</a></li> </ul> </li> <li class="main"> <a href="#">菜单项3</a> <ul> <li><a href="#">子菜单项31</a></li> <li><a href="#">子菜单项32</a></li> <li><a href="#">子菜单项33</a></li> </ul> </li> </ul> </div> <br><br><br> <hr width="80%"> <div> <ul> <li class="hmain"> <a href="#">菜单项1</a> <ul> <li><a href="#">子菜单项11</a></li> <li><a href="#">子菜单项12</a></li> <li><a href="#">子菜单项13</a></li> </ul> </li> <li class="hmain"> <a href="#">菜单项2</a> <ul> <li><a href="#">子菜单项21</a></li> <li><a href="#">子菜单项22</a></li> <li><a href="#">子菜单项23</a></li> </ul> </li> <li class="hmain"> <a href="#">菜单项3</a> <ul> <li><a href="#">子菜单项31</a></li> <li><a href="#">子菜单项32</a></li> <li><a href="#">子菜单项33</a></li> </ul> </li> </ul> </div> </body> </html> |
[crayon-6a880f77c250c7…
ThinkPHP分页
1.下载官方有例子的包,然后找到例子下面的Page例子。 2. 找到Page.class.php,复制到你自己…
FileInputStream,FileOutputStream文件拷贝之性能比较
http://www.iteye.com/topic/409525 [crayon-6a880f77c3cde…
java创建zip文件
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
public String createZip(String zipFileName,List<String> fileList,String speSymbols){ ZipOutputStream out = null; File zipFile = new File(zipFileName); try { if(!zipFile.exists()){ zipFile.createNewFile(); }else{ zipFile.delete(); zipFile.createNewFile(); } out = new ZipOutputStream(new FileOutputStream(zipFile)); for(String filePath: fileList){ File file = new File(filePath); ZipEntry ent = new ZipEntry(file.getName()); FileInputStream ins = new FileInputStream (file); out.putNextEntry(ent); int b = 0; while((b=ins.read())!=-1){ out.write(b); } ins.close(); } out.close(); } catch (Exception e) { // TODO: handle exception e.printStackTrace(); } return null; } |
遍历JavaScript对象的所有属性
http://www.javatang.com/archives/2006/09/13/442864.html…
ThinkPHP Ajax for JQuery
ThinkPHP Ajax for JQuery A: [crayon-6a880f77c4920119107…
PHP 页面编码声明方法详解(header或meta)
http://hi.baidu.com/mengqingaaa/blog/item/d294283dd3aad…
文件夹是否为空
1:
|
1 2 3 4 5 6 7 8 9 10 |
function isEmptyDir( $path ) { $dh= opendir( $path ); while(false !== ($f = readdir($dh))) { if($f != ". " && $f != ".. " ) return true; } return false; } |
2: [crayon-6a880f77…
php内部字符串编码转换函数mb_convert_encoding使用方法介绍
http://hi.baidu.com/get52/blog/item/56f4d80336bf8ee208f…
PHP判断字符串编码是否为utf8的函数
http://it.oyksoft.com/post/49/ [crayon-6a880f77c5235201…
JavaScript判断浏览器类型及版本
http://www.cnblogs.com/leadzen/archive/2008/09/06/12857…
写一个函数,算出两个文件的相对路径 (b相对于a)
http://hi.baidu.com/ken00821/blog/item/6a4cf8d48dc7a4ce…
PHP 文件上传
http://www.w3school.com.cn/php/php_file_upload.asp 创建一个…
PHP获取网站域名和地址的代码
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
function PMA_getenv($var_name) { if (isset ( $_SERVER [$var_name] )) { return $_SERVER [$var_name]; } elseif (isset ( $_ENV [$var_name] )) { return $_ENV [$var_name]; } elseif (getenv ( $var_name )) { return getenv ( $var_name ); } elseif (function_exists ( 'apache_getenv' ) && apache_getenv ( $var_name, true )) { return apache_getenv ( $var_name, true ); } return ''; } if (empty ( $HTTP_HOST )) { if (PMA_getenv ( 'HTTP_HOST' )) { $HTTP_HOST = PMA_getenv ( 'HTTP_HOST' ); } else { $HTTP_HOST = ''; } } //echo htmlspecialchars($HTTP_HOST ); |
php遍历文件夹(获得文件名)
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
function listFile($dir) { $fileArray = array(); $cFileNameArray = array(); if($handle = opendir($dir)) { while(($file = readdir($handle)) !== false) { if($file !="." && $file !="..") { if(is_dir($dir."\\".$file)) { $cFileNameArray = listFile($dir."\\".$file); for($i=0;$i<count($cFileNameArray);$i++) { $fileArray[] = $cFileNameArray[$i]; } } else { $fileArray[] = $file; } } } return $fileArray; } else { echo "111"; } } $aaa = listFile("E:\java chm"); var_dump($aaa); |
php遍历文件夹(获得文件名)
用CSS控制 ul / li标记样式:list-style-type各属性的含义
http://hi.baidu.com/uuxuan/blog/item/8669b3271c3d2b0790…
jquery 图片循环显示
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <script src="http://www.cssrain.cn/demo/JQuery+API/jquery-1[1].2.1.pack.js" type="text/javascript"></script> <style type="text/css"> * {margin:0;padding:0;font-size:12px;font-family:Verdana;} img {border:0} #pic{margin:5px;width:300px;height:200px;overflow:hidden;cursor:pointer;} #play{position:absolute;margin-left:200px;margin-top:-30px;} #play a{text-decoration: none;border:1px solid #CEDEF7;background-color:#E8FCEB;width:20px;height:20px;color:#2F49DF;display:block;float:left;text-align:center;line-height:20px;margin-right:3px;} </style> <script type="text/javascript"> var _c = _h = 0; $(function(){ $('#play > a').click(function(){ var i = $(this).attr('alt') - 1; clearInterval(_h); _c = i; play(); change(i); }) $("#pic img").hover(function(){clearInterval(_h)}, function(){play()}); play(); }) function play() { _h = setInterval("auto()", 1000); } function change(i) { $('#play > a').css('background-color','#E8FCEB').eq(i).css('background-color','#C6FF5E').blur(); $("#pic img").hide().eq(i).fadeIn('slow'); } function auto() { _c = _c > 2 ? 0 : _c + 1; change(_c); } </script> <title>js图片播放轮换</title> </head> <body> <div id="pic"> <img src="http://www.cssrain.cn/demo/pic/cssrain-logo.JPG" width="300" height="200" alt="" /> <img src="http://www.cssrain.cn/demo/pic/usbmingpian.jpg" width="300" height="200" alt="" /> <img src="http://www.cssrain.cn/demo/pic/ganyingdeng2.jpg" width="300" height="200" alt="" /> <img src="http://www.cssrain.cn/demo/pic/ganyingdeng.jpg" width="300" height="200" alt="" /> </div> <div id="play"> <a href="###" alt="1" style="background-color:#C6FF5E">1</a> <a href="###" alt="2" >2</a> <a href="###" alt="3" >3</a> <a href="###" alt="4" >4</a> </div> <br/><br/><br/><br/> <div>转:<a href="http://koyoz.com">koyoz.com</a> </div> </body> </html> |
让FireFox始终显示右边滚动条scrollbar的方法
http://www.codehorde.com/thread-93-1-1.html body, html …
Please use the date.timezone setting
http://blog.sina.com.cn/s/blog_541f0d350100e1pz.html PH…
VBA语句集100句 (Word VBA)
http://bbs.csdn.net/topics/300226686 VBA语句集100句 (Word V…
CSS图片垂直居中方法整理集合
CSS图片垂直居中方法整理集合 http://bbs.blueidea.com/thread-2666987-…
java追加内容到文件末尾
http://www.java3z.com/cwbwebhome/article/article5/51290…
Oracle中查询表的信息
查询oracle表的信息:http://hi.baidu.com/winlei/blog/item/01ef0…
关于网页中显示php查询数据库结果乱码问题
http://blog.csdn.net/yishiyichen/article/details/577518…
php异常处理
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
function onError($errCode, $errMesg, $errFile, $errLine) { echo "Error Occurred\n"; throw new Exception($errMesg); } function onException($e) { echo $e->getMessage(); } set_error_handler("onError"); set_exception_handler("onException"); try { $mm=0/0; echo $mm; } catch (Exception $e) { echo $e->getCode()."\n"; echo $e->getMessage()."\n"; } |
一定要定义和调用 set_error_han…
