最近的我容易感动
来北京一年多了,时间过得飞快,感觉很紧迫,收获却不少。最近变得很容易感动,有时候还想家,呵呵 ,越来越没出息了[@more@]
Jakarta Commons 组件
For more information concerning Commons, see the Commons site. Commons Attributes Commons BeanutilsCommons Betwixt Commons Chain Commons CLI Commons CodecCommons CollectionsCommons Configuration Commons Daemon Commons DBCP Commons DbUtilsCommons DigesterCommons Discovery Commons EL Commons Email Commons FileUploadCommons HttpClientCommons IO Commons Jelly Commons JEXLCommons JXPath Commons Lang Commons Latka Commons LauncherCommons Logging Commons Math Commons Modeler Commons Net Commons Pool Co
php 汉字转换成拼音 程序
注意:只能编码为GBK的汉子才能正常转化为对应的拼音。<? $d=array( array("a",-20319), array("ai",-20317), array("an",-20304), array("ang",-20295), array("ao",-20292), array("ba",-20283), array("bai",-20265), array("ban",-20257), array("bang",-20242), array("bao",-20230), array("bei",-20051), array("ben",-20036), array("beng",-20032), array("bi",-20026), arra
php 生成静态页面
利用ob系列的函数。这里用到的函数主要是 ob_start(), ob_end_flush(), ob_get_content(),其中ob_start()是打开浏览器缓冲区的意思,打开缓冲后,所有来自PHP程序的非文件头信息均不会发送,而是保存在内部缓冲区,直到你使用了ob_end_flush().而这里最重要的一个函数,就是ob_get_contents(),这个函数的作用是获取缓冲区的内容,相当于上面的那个fetch(),道理一样的。代码:<?phpob_start();echo "Hello World!";$content = ob_get_contents();//取得php页面输出的全部内容$fp = fopen("archives/2005/05/19/0001.html
对XML 进行 parse 时的Invalid Unicode character (0x0) 分析
XML 在搜索引擎的低端起到了非常重要的作用,可是由于相当多数的网络上的Rss feed或者XML feed都是直接从数据库文件生成的,因此极有可能包含有一些非常字符,而这些字符在XML进行Parse的时候就会带来 Invalid Unicode character (0x0) 这样的错误或者是org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x0) was found,如何解决这样的错误?先看看Unicode的一些基础知识:Unicode 最初设计是作为一种固定宽度的 16 位字符编码。在 Java 编程语言中,基本数据类型 char 初衷是通过提供一种简单的、能够包含任何字符的
Unable to connect to any hosts due to exception
java.sql.SQLException: Unable to connect to any hosts due to exception: java.lang.ArrayIndexOutOfBoundsException: 40at com.mysql.jdbc.Connection.createNewIO(Connection.java:1797)at com.mysql.jdbc.Connection.<init>(Connection.java:562)at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:361)at java.sql.DriverManager.getConnection(DriverManager.java:525)at java.sql.DriverManager.getConnection(DriverManager.java:171)at org.apache.commons.dbcp.DriverManagerConnectionFactory
java正则表达式实例
Java正则表达式实例详解 [转]创建正则表达式你可以从比较简单的东西入手学习正则表达式。要想全面地掌握怎样构建正则表达式,可以去看JDK文档的java.util.regex的Pattern类的文档。 字符 B 字符B xhh 16进制值0xhh所表示的字符 uhhhh 16进制值0xhhhh所表示的Unicode字符 t Tab n 换行符 r 回车符 f 换页符 e Escape 正则表达式的强大体现在它能定义字符集(character class)。下面是一些最常见的字符集及其定义的方式,此外还有一些预定义的字符集: 字符集 . 表示任意一个字符 [abc] 表示字符a,b,c中的任意一个(与a
XPath 教程
para 选择上下文节点的 para 元素孩子* 选择上下文节点的所有的元素孩子text() 选择上下文节点的所有的正文节点孩子@name 选择上下文节点的 name 属性@* 选择上下文节点的所有的属性para[1] 选择上下文节点的第一个 para 孩子para[last()] 选择上下文节点的最后一个 para 孩子*/para 选择上下文节点的所有的 para 孙子/doc/chapter[5]/section[2] 选择doc的第五个 chapter 的第二个 section chapter//para 选择上下文节点的 chapter 元素孩子的所有 para 元素子孙//para 选择文档根的所有的 para 子孙,也就是选择上下文节点所在的文档中所
sql left join 和 right join解释
给个通俗的解释吧. 例表a aid adate 1 a1 2 a2 3 a3 表b bid bdate 1 b1 2 b2 4 b4 两个表a,b相连接,要取出id相同的字段 select * from a inner join b on a.aid = b.bid这是仅取出匹配的数据. 此时的取出的是: 1 a1 b1 2 a2 b2 那么left join 指: select * from a left join b on a.aid = b.bid 首先取出a表中所有数据,然后再加上与a,b匹配的的数据 此时的取出的是: 1 a1 b1 2 a2 b2 3 a3 空字符 同样的也有right join 指的是首先取出b表中所有数据,然后再加上与a,b匹配的的数据 此时的取出的是: 1 a1 b1 2 a2 b2 4 空字符 b4 “Outer Jo
(定时任务)crontab 的用法
关键词: crontab 定时 crontab task 格式 * * * * * task分 时 日 月 周 task第1列 分钟1~5 9 (0表示0分)第2列 小时1~2 3(0表示子夜)第3列 日1~3 1 第4列 月1~1 2 第5列 星期0~6(0表示星期天)第6列 要运行的命令一些例子:30 21* * * /apps/bin/cleanup.sh上面的例子表示每晚的2 1 : 3 0运行/ a p p s / b i n目录下的c l e a n u p . s h。45 4 1,10,22 * * /apps/bin/backup.sh上面的例子表示每月1、1 0、2 2日的4 : 4 5运行/ a p p s / b i n目录下的b a c k u p . s h。10 1 * * 6,0 /bin/find -name "core" -exec
HttpClient 简单例子
private boolean sendURL(String url) { boolean right = false; HttpClient client = new HttpClient(); GetMethod method = new GetMethod(url); try { client.executeMethod(method); right = true; }catch (Exception e) { log.error(e, e.fillInStackTrace()); right = false; } finally { method.releaseConnection(); } return right; }[@more@]
freemarker 基本指令
一:if指令:<#if condition>...<#elseif condition2>...<#elseif condition3>......<#else>...</#if>二:switch<#switch value><#case refValue1>...<#break><#case refValue2>...<#break>...<#case refValueN>...<#break><#default>...</#switch>三:list,break<#list sequence as item>...</#list>两个特殊的循环变量:item_index: 当前变量的索引值。item_has_next: 是否存在下一个对象。可以用<#break/>指令离开loop循环。
js cookie操作
cookieObj=function(){}cookieObj.prototype.clearCookie = function() {var now = new Date();var yesterday = new Date(now.getTime() - 1000 * 60 * 60 * 24);this.setCookie('co'+this.obj, 'cookieValue', yesterday);this.setCookie('cs'+this.obj, 'cookieValue', yesterday);};// [Cookie] Sets value in a cookiecookieObj.prototype.setCookie = function(cookieName, cookieValue, expires, path, domain, secure) {document.cookie =escape(cookieName) + '=' + escape(cookieValue)+ (expires ? '; expires=' + expires.toGM
jsquery简单体验
http://www.javaeye.com/topic/34087Jquery是继prototype之后又一个优秀的Javascript框架。对prototype我使用不多,简单了解过。但使用上jquery之后,马上被她的优雅吸引住了。有人使用这样的一比喻来比较prototype和jquery:prototype就像Java,而jquery就像ruby.实际上我比较喜欢java(少接触Ruby罢了)但是jquery的简单的实用的确有相当大的吸引力啊!在项目里我把jquery作为自已唯一的框架类包。使用其间也有一点点心得,其实这些心得,在jquery的文档上面也可能有讲,不过还是记下来,以备忘罢。 一,找到你了! 还记得$()这个东西吧
prototype.js函数介绍
函数名解释举例Element.toggle交替隐藏或显示Element.toggle(''div1'',''div2'')Element.hide隐藏Element.hide(''div1'',''div2'')Element.show显示Element.show(''div1'',''div2'')Element.remove删除Element.remove(''div1'',''div2'')Element.getHeight取得高度Element.getHeight(''div1'')Toggle.display和Element.toggle相同Toggle.display(''div1'',''div2'')Insertion.Before在DIV前插入文字Insertion.Before(''div1'',''my content'')Insertion.After在DIV后插入文字Insertion.After(''div1'',''my content'')Insertion.Top在DIV里
javascript事件查询综合
click() 对象.click() 使对象被点击。closed 对象.closed 对象窗口是否已关闭true/falseclearTimeout(对象) 清除已设置的setTimeout对象clearInterval(对象) 清除已设置的setInterval对象confirm("提示信息") 弹出确认框,确定返回true取消返回falsecursor:样式 更改鼠标样式 hand crosshair text wait help default auto e/s/w/n-resizeevent.clientX 返回最后一次点击鼠标X坐标值;event.clientY 返回最后一次点击鼠标Y坐标值;event.offsetX 返回当前鼠标悬停X坐标值event.offsetY 返回当前鼠标悬停Y坐标值docu
js读取xml文件,用了Microsoft.XMLDOM
<script language="javascript">/**载入xml文件生成xml对象返回**/loadXML = function(xmlFile) { var xmlDoc; if(window.ActiveXObject) { xmlDoc = new ActiveXObject('Microsoft.XMLDOM'); xmlDoc.async = false; xmlDoc.load(xmlFile); } else if (document.implementation&&document.implementation.createDocument) { xmlDoc = document.implementation.createDocument('', '', null); xmlDoc.load(xmlFile); } else
FreeMarker Eclipse Plugin的安装!
如果使用的是Eclipse2.x, 安装方法如下:Open the Window menu, then Open Perspective -> Install/Update Click with the right mouse button on the Feature Updates view, then select New -> Site Bookmark In the displayed dialog box, type "FreeMarker" for Name and "http://www.freemarker.org/eclipse/update" for URL. Leave the "Bookmark type" radio buttons on "Eclipse update site". Click Finish Open the tree node under the newly created update site named "F
java 链接sql server 2000 问题
java 链接sql server 2000 总结Context envContext = (Context)initCtx.lookup("java:/comp/env");DataSource ds = (DataSource)envContext.lookup("jdbc/jieba");conn = ds.getConnection();执行后总是出现:java.lang.NoSuchMethodError: com.microsoft.util.UtilDebug.setPrintWriter(Ljava/io/PrintWriter;)Vat com.microsoft.jdbc.base.BaseDriver.setupDebugging(Unknown Source)at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)at org.apache.commons.dbcp.DriverConnectionFactory.createConn
现在股市里人人都在赚钱!!到底谁在亏钱?我讲一个故事来告诉大家谁亏钱了
[转]现在股市里人人都在赚钱!!到底谁在亏钱?我讲一个故事来告诉大家谁亏钱了[@more@]假设一个市场,有两个人在卖烧饼,有且只有两个人,姑且称他们为烧饼甲、烧饼乙。 假设他们的烧饼价格没有物价局监管。 假设他们每个烧饼卖一元钱就可以保本(包括他们的劳动力价值) 假设他们的烧饼数量一样多。 ——经济模型都这样,假设需要很多。 再假设他们生意很不好,一个买烧饼的人都没有。这样他们很无聊地站了半天。 甲说好无聊。 乙说好无聊。 看故事的你们说:好无聊。