- 认识StringBuilder大概是在一年前的八九月份里,还是在JDK1.5从未正式发布始,一直都是关注的它的几大显著特性--泛型、静态引入、装拆箱和不定参等,某些比较细微的差别却没注意到。
大家都知道处理字符串连接时StringBuffer比String效率高,因为从编译的字节码中也可以看到String的相加也是要转换为StringBuffer来进行的。
比如对于这几句代码 ①String s = "Hello"; ②s=s+" Java"; ③s=s+" World!"; 反编译之后从字节码可以看出虚拟机实际是如何处理的(具体字节码这里就略去了,对于详细字节码的分析我想如果需要的时候以后会单独写一篇来介绍):
Read More - 2005-11-25
1) Don't go out by yourself at night!/晚上别一个人出门。
2)This is truly an eye opening experience for me./这经历真是令我大开眼界。
3)Hold the saliva!/不要把口水喷出来!
4)I am out of breath!/我喘不上气了!
5)You are singing off-key./你唱歌走调。 Read More
J2EE容器分为Servlet容器和EJB容器,例如Tomcat就是一个Servlet容器,WebLogic,WebSphere Application Server,JBoss就是EJB容器。他们都提供JNDI的支持,你可以把任何资源(如DataSource、JMS、Queue、Mail甚至是URL资源)都绑定到JNDI上下文中,这样可以降低组件间的耦合性。
通常的Servlet容器(如Tomcat、Resin)中的JNDI资源只能被容器中的程序查到、使用,而不能在容器外引用,也就是只能被容器所以进程所用;而EJB容器中的JNDI资源却可以在容器外,或者是另一台机器上的程序查找到并透明使用,因为EJB本来就是要为分布式服务的。EJB容器中的JNDI资源可以通过JNP、RMI、IIOP、T3或文件引用的方式发布出去。 Read More- 刚开始碰到的一个问题是我JDK安装的是1.5,启动jboss-3.2.3就有问题,出现的错误提示是
Failed to boot JBoss:
javax.management.InstanceNotFoundException: JMImplementation:service=LoaderRepository,name=Default
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(Unknown Source)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(Unknown Source)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(Unknown Source)
at org.jboss.system.server.ServerImpl.initBootLibraries(ServerImpl.java:499)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:335) Read More - 2005-11-17
老外不说:
1)What time is convenient for you?(fault) What time is good for you?(correct)/什么时间你有空?
2)I slept early.(fault) I went to bed early./我睡得早。
词组:
1)go jogging/慢跑(不说"run") Read More - 在公司加入了一个新的项目组,被分配去研究 WebSphere MQ Workflow,Workflow是有些基本的了解,但是MQ和JMS还不是很清楚,更主要的是环境不知道怎么去搭建,也不知道MQ与Workflow有什么关系。
最开始只知道有一个软件是WebSphere MQ Workflow,于是安装它吧,没想我无论是选择安装服务器端还是客户端都提示我需要MQSeries这个东西,我该到哪儿去找这个东西呢?而此时我旁边的同事却把Workflow给装上了,怎么回事呢?他说他的添加删除程序里有一个WebSphere MQ,他也不知道是几时安装的,查查安装路径才知道是WAS5.1自己带的一个MQ。于是我也装上WAS 5.1的MQ部件,果然Workflow也能安装上了。 Read More 许久没摸过吉他了,忽一拿来连调音时耳朵都不那么顺了,于是就想:应该有一种电脑调音软件,只要我把声音输入到电脑,就会显示输入声音的音高, 这样岂不是非常简单又实用。Google一下"电脑 吉他 调音软件",真找到了,是Dasein Guitar Tuner,一用,真是精彩超乎想象。
下载页面:http://web.my8d.net/gita2/soft.htm
下载地址1:http://web.my8d.net/gita/download/dgt.zip
下载地址2:http://web.my8d.net/gita2/download/dgt.zip
下载地址3:http://web.my8d.net/gita2/download/Ctuner2e.zip
地址1和2是英文版,释放Crack中文件到安装目录,执行其中的sdkill.exe就行了,地址3是一个中文乱码版,我用MagicWin都没能成功转码。 Dasein Guitar Tuner的使用界面如左边,多好啊,弹一下就知道是什么调,我用的是电箱琴,吉他直接连电脑,不用经MIC拾音。 看看左边我的E弦可是标准音了(指针指到正中央)。还有示范音,提供多种定调,如FADGBE、DADGBE和自定义方式。 就是你没有声卡都能从PC Speaker中发出声来,还有多种声音的显示方式,如Needle、Ellipse、Skyline。在某些有噪音背景下都能正常使用,真是考虑周到。快去体验一下吧!
六根弦全指向中央零,琶一下C和弦试,嗯!真是乐耳,这把破吉他恐怕是头一回让们所有的弦调到了标准音,感觉真是美妙极了。 以前的话别说每根弦上标准音,就连六根空弦音之间正确的间距度数都没达不到要求。
我还想,要是找不到类似的软件,我自己也可以试着开发一个这样的东西来玩玩,应该不难吧,对声卡采集到声音进行声谱分析,再深入一下,未必就很简单,还是需要一点点的专业知识的。
在上面那个下载页面中还有两个节拍器软件可以下载:
一个是:超方便的 http://web.my8d.net/gita2/download/lala.ZIP
另一个是:功能齐全的 http://web.my8d.net/gita2/download/metrotim.zip- 2005-11-8 出席会议/attending a meeting
1) I would like you to attend the meeting./我希望你能参加这个会议。
2)The president wish to see you at the meeting./总裁让你出席这次会议。
3)I think I can attend./我想我能出席。
4)I must be present./我一定出席。
5)I'm terribly sorry, but I can't attend it since I have to be with a client./非常抱歉,我无法参加,因为到时候我得陪一位客户。
6)Can I let others attend on my behalf?/我让别人代表我出席行吗? Read More
网上找了好些个关于CheckStyle的文章都是抄抄抄一大通,却没有一个build.xml着实可运行,
在这里我也是参考着一编,改改成能成功运行并能生成正确报告,发送 Email 的build.xml文件1<?xml version="1.0" encoding="gb2312"?> 2 3<!-- ANT make file checkstype --> 4 5<!-- See <a href="http://jakarta.apache.org/ant" data-mce-href="http://jakarta.apache.org/ant">http://jakarta.apache.org/ant</a> for info about ANT --> 6<!-- 网上下来的CheckStyle解压在d:/javalib/CheckStyle/checkstyle-4.1中 --> 7<project name="checkstyle" default="checkstyle" basedir="d:/javalib/CheckStyle/checkstyle-4.1"> 8 9 <!-- CheckStyle配置,这里你替换成你实际的环境 --> 10 <property name="project.docs.dir" value="${basedir}/contrib"/> 11 12 <!-- 源代码的目录是e:/eclipseworkspace/talupdate/src --> 13 <property name="project.src.dir" value="e:/eclipseworkspace/talupdate/src"/> 14 15 <!-- 建立了build目录在其中生成报告 --> 16 <property name="project.checkstyleReport.dir" value="${basedir}/build"/> 17 <property name="checkstyle.jar" value="${basedir}/checkstyle-all-4.1.jar"/> 18 19 <!-- 使用SUN的代码规范,可替换成公司自己的规范 --> 20 <property name="checkstyle.config" value="${basedir}/sun_checks.xml"/> 21 <property name="checkstyle.report.style" value="${project.docs.dir}/checkstyle-noframes.xsl"/> 22 <property name="checkstyle.result" value="${project.checkstyleReport.dir}/checkstyle_result.xml"/> 23 <property name="checkstyle.report" value="${project.checkstyleReport.dir}/checkstyle_report.html"/> 24 25 <!-- 定义发送邮件列表 --> 26 <property name="mail.list" value="(User1)user1@xxx.com,(User2)user2@xxx.com"/> 27 28 <target name="init"> 29 <tstamp/> 30 </target> 31 32 <!--CheckStyle脚步--> 33 <taskdef resource="checkstyletask.properties" classpath="${checkstyle.jar}"/> 34 35 <target name="checkstyle" depends="init" description="对java源代码进行检查并产生检查报告. "> 36 <checkstyle config="${checkstyle.config}" failOnViolation="false" failureProperty="checkstyle.failure"> 37 <formatter type="xml" tofile="${checkstyle.result}"/> 38 <fileset dir="${project.src.dir}" includes="**/*.java"/> 39 </checkstyle> 40 41 <!-- 生成报告,其格式取决于${checkstyle.report.style} --> 42 <style in="${checkstyle.result}" out="${checkstyle.report}" style="${checkstyle.report.style}"/> 43 </target> 44 45 <!-- 当有不规范的情况发生时将检查结果发送到 --> 46 <target name="checkstyle-nightly" depends="checkstyle" if="checkstyle.failure" 47 description="Sends email if checkstyle detected code conventions violations."> 48 49 <!-- 如果邮件服务器需要验证,则加上 user 和 password 属性 --> 50 <mail from="(Admin)admin@xxx.com" tolist="${mail.list}" mailhost="mail.xxx.com" 51 subject=" checkstyle result from project reports" files="${checkstyle.report}"/> 52 </target> 53</project>
<继续补充内容>