<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[coder_duhg的专栏]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/coder_duhg</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; coder_duhg]]></copyright><item><title><![CDATA[关于java控制台输入（转载）]]></title><link>https://blog.youkuaiyun.com/coder_duhg/article/details/8489245</link><guid>https://blog.youkuaiyun.com/coder_duhg/article/details/8489245</guid><author>coder_duhg</author><pubDate>Thu, 10 Jan 2013 11:54:58 +0800</pubDate><description><![CDATA[1.　JDK 1.4 及以下版本读取的方法JDK 1.4 及以下的版本中要想从控制台中输入数据只有一种办法，即使用System.in获得系统的输入流，再桥接至字符流从字符流中读入数据。示例代码如下：
import java.io.IOException;import java.io.InputStreamReader;
public class Test1 {
    public stat]]></description><category></category></item><item><title><![CDATA[java数据结构表的学习]]></title><link>https://blog.youkuaiyun.com/coder_duhg/article/details/8489244</link><guid>https://blog.youkuaiyun.com/coder_duhg/article/details/8489244</guid><author>coder_duhg</author><pubDate>Thu, 10 Jan 2013 11:54:56 +0800</pubDate><description><![CDATA[1、表ADT（abstract data type）
    1）数组
    2）链表
2、java Collections API中的表（位于java.util）
1）Collection接口
Collection接口扩展了iterable接口，实现Iterable接口的那些类可以有增强的for循环，该循环施于这些类之上以观察他们的所有项。  
（表一）




例：（在]]></description><category></category></item><item><title><![CDATA[另一个博客]]></title><link>https://blog.youkuaiyun.com/coder_duhg/article/details/8489243</link><guid>https://blog.youkuaiyun.com/coder_duhg/article/details/8489243</guid><author>coder_duhg</author><pubDate>Thu, 10 Jan 2013 11:54:54 +0800</pubDate><description><![CDATA[在csdn上http://blog.youkuaiyun.com/import/apply.html]]></description><category></category></item><item><title><![CDATA[用java写的TrieTree]]></title><link>https://blog.youkuaiyun.com/coder_duhg/article/details/8489242</link><guid>https://blog.youkuaiyun.com/coder_duhg/article/details/8489242</guid><author>coder_duhg</author><pubDate>Thu, 10 Jan 2013 11:54:51 +0800</pubDate><description><![CDATA[用java写的trie tree主要是在写spider的时候，需要存储解析出的网页的url，判断是否已经处理过或已经加入等待处理的url队列，避免出现网页的url出现循环，使用trietree的最大的有点就是节约存储空间；包括两个方法：一是find，查找相应的string是否已经出现过；二是add，把不存在的string加入到TrieTree。
下面是源代码：

 1 package com]]></description><category></category></item><item><title><![CDATA[解决java用url中读取html源码时的乱码问题]]></title><link>https://blog.youkuaiyun.com/coder_duhg/article/details/8489241</link><guid>https://blog.youkuaiyun.com/coder_duhg/article/details/8489241</guid><author>coder_duhg</author><pubDate>Thu, 10 Jan 2013 11:54:49 +0800</pubDate><description><![CDATA[1、主要应用getContentType获取相应的网页编码方式：
pageUrl=new URL(urlString);
HttpURLConnection uc = (HttpURLConnection) pageUrl.openConnection();
String encoding=uc.getContentType();
2、再提取charset子串（这里使用"charset="]]></description><category></category></item><item><title><![CDATA[毕业设计想做一个垂直搜索引擎，关于手机方面]]></title><link>https://blog.youkuaiyun.com/coder_duhg/article/details/8489240</link><guid>https://blog.youkuaiyun.com/coder_duhg/article/details/8489240</guid><author>coder_duhg</author><pubDate>Thu, 10 Jan 2013 11:54:46 +0800</pubDate><description><![CDATA[我毕业设计打算做一个垂直搜索引擎，关于手机方面的，抓取几个主流电商的网站的手机信息，导入到自己的搜索引擎主要实现搜索的比价，以及相关手机的性能参数。导师说最大的困难时抓取信息，这几天分析了京东商城手机方面的html页面原码，发现还是很有规律的：
1）手机展览的页面公27页（到目前为止），格式是：http://www.360buy.com/products/652-653-655-0-0-0-0-]]></description><category></category></item><item><title><![CDATA[windows下hadoop伪分布式模式开发环境的搭建(Cygwin)以及Eclipse集成开发环境下的搭建]]></title><link>https://blog.youkuaiyun.com/coder_duhg/article/details/8489239</link><guid>https://blog.youkuaiyun.com/coder_duhg/article/details/8489239</guid><author>coder_duhg</author><pubDate>Thu, 10 Jan 2013 11:54:44 +0800</pubDate><description><![CDATA[1、首先是搭建开发环境：我建议搭建看视频吧，讲的比较清楚，我是看了好几遍的视频搭建起来的（http://v.youku.com/v_show/id_XMzc5MzM1NDQw.html）：
Windows下搭建Hadoop开发环境
2、在Eclipse下写第一个MapReduce程序，这个写的过程很详细：
还是建议读别人的文章：http://phz50.iteye.com/blog/9323]]></description><category></category></item><item><title><![CDATA[利用微软翻译API做自己的翻译的工具（java）]]></title><link>https://blog.youkuaiyun.com/coder_duhg/article/details/8489237</link><guid>https://blog.youkuaiyun.com/coder_duhg/article/details/8489237</guid><author>coder_duhg</author><pubDate>Thu, 10 Jan 2013 11:54:42 +0800</pubDate><description><![CDATA[这是helloworld级的入门步骤：
一、下载微软api的jar包，并他们引入到工程；
    a:json-simple-1.1.jar
    b:microsoft-translator-java-api-0.6.1.jar
   （大家可以到我的快盘的分享链接下载：http://www.kuaipan.cn/file/id_7978915364603025.htm）
二、在微软]]></description><category></category></item><item><title><![CDATA[OpenSessionInViewFilter失效问题]]></title><link>https://blog.youkuaiyun.com/coder_duhg/article/details/8489236</link><guid>https://blog.youkuaiyun.com/coder_duhg/article/details/8489236</guid><author>coder_duhg</author><pubDate>Thu, 10 Jan 2013 11:54:39 +0800</pubDate><description><![CDATA[在使用struts2+hibernate+spring时使用OpenSessionInViewFilter解决懒加载问题，但是使用的时候总是could not initialize proxy - no Session，看看别人的文章发现时web.xml配置的问题：
我在ssh2框架下使用OpenSessionInViewFilter过滤器，让spring控制session的开关。出现了使用la]]></description><category></category></item><item><title><![CDATA[第一次用hql语句显示：QuerySyntaxException]]></title><link>https://blog.youkuaiyun.com/coder_duhg/article/details/8489235</link><guid>https://blog.youkuaiyun.com/coder_duhg/article/details/8489235</guid><author>coder_duhg</author><pubDate>Thu, 10 Jan 2013 11:54:37 +0800</pubDate><description><![CDATA[String hql="from Employee where name=:name and pass_word=:passWord";
        Query q=sessionFactory.openSession().createQuery(hql);

注意红色标记的地方，写的时候应该和类名相对应，而不是和表名相对应，]]></description><category></category></item><item><title><![CDATA[Mysql常用命令行大全]]></title><link>https://blog.youkuaiyun.com/coder_duhg/article/details/8489234</link><guid>https://blog.youkuaiyun.com/coder_duhg/article/details/8489234</guid><author>coder_duhg</author><pubDate>Thu, 10 Jan 2013 11:54:34 +0800</pubDate><description><![CDATA[第一招、mysql服务的启动和停止
net stop mysql
net start mysql
第二招、登陆mysql
语法如下： mysql -u用户名 -p用户密码
键入命令mysql -uroot -p， 回车后提示你输入密码，输入12345，然后回车即可进入到mysql中了，mysql的提示符是：
mysql>
注意，如果是连接到另外的机器上，则需要加入一个参数-h机器IP]]></description><category></category></item><item><title><![CDATA[struts2自定义拦截器]]></title><link>https://blog.youkuaiyun.com/coder_duhg/article/details/8489233</link><guid>https://blog.youkuaiyun.com/coder_duhg/article/details/8489233</guid><author>coder_duhg</author><pubDate>Thu, 10 Jan 2013 11:54:32 +0800</pubDate><description><![CDATA[整个过程是：
    通过user.jsp登陆，就是在session中添加（user,name）使用的命令是：request.getSession().setAttribute("user", "du");然后登到MyDefInterceptor，则进入到hello.jsp，通过quit.jsp退出，即request.getSession().removeAttribute("user");
]]></description><category></category></item><item><title><![CDATA[根据地区和时区获取当地时间]]></title><link>https://blog.youkuaiyun.com/coder_duhg/article/details/8489231</link><guid>https://blog.youkuaiyun.com/coder_duhg/article/details/8489231</guid><author>coder_duhg</author><pubDate>Thu, 10 Jan 2013 11:54:29 +0800</pubDate><description><![CDATA[本例创建一个处理GET请求和POST请求的servlet
servlet TimeForm中的GET方法显示一个窗体：

Submit后的结果：

源代码：

 1 import javax.servlet.*;
 2 import javax.servlet.http.*;
 3 import java.io.*;
 4 import java.text.DateFormat]]></description><category></category></item><item><title><![CDATA[一个通用的SQL客户程序]]></title><link>https://blog.youkuaiyun.com/coder_duhg/article/details/8489230</link><guid>https://blog.youkuaiyun.com/coder_duhg/article/details/8489230</guid><author>coder_duhg</author><pubDate>Thu, 10 Jan 2013 11:54:27 +0800</pubDate><description><![CDATA[能够与任何关系数据库建立连接，并且交互地执行SQL命令，该客户程序能够连接任何jdbc数据源，也可以提交要执行的sqlSELECT命令和非SELECT命令。对于SELECT查询命令，显示执行结果；对于非select命令，显示执行状态。（我的电脑上只有mysql，所以只测了mysql，没有问题）
如下图所示：

代码实现：

  1 import java.awt.*;
  2 impo]]></description><category></category></item><item><title><![CDATA[JDBC数据库程序连接MySQL]]></title><link>https://blog.youkuaiyun.com/coder_duhg/article/details/8489229</link><guid>https://blog.youkuaiyun.com/coder_duhg/article/details/8489229</guid><author>coder_duhg</author><pubDate>Thu, 10 Jan 2013 11:54:25 +0800</pubDate><description><![CDATA[下载一个MySQL，安装之后运行，下载一个MySQL的驱动（mysqljdbc.jar），set一下classpath（classpath不用配，直接在eclipse的项目上点击右键，选Build Path。选Configure Build Path里的libraries选项卡.add external jars.把mysql的驱动包加入就可以了）
整个程序连接数据库的过程基本上是：
1、使用]]></description><category></category></item><item><title><![CDATA[我的第一个JavaApplet程序]]></title><link>https://blog.youkuaiyun.com/coder_duhg/article/details/8489228</link><guid>https://blog.youkuaiyun.com/coder_duhg/article/details/8489228</guid><author>coder_duhg</author><pubDate>Thu, 10 Jan 2013 11:54:22 +0800</pubDate><description><![CDATA[Applet
WelcomeApplet类：

import javax.swing.*;


public class WelcomeApplet extends JApplet{
    public void init(){
        add(new JLabel("WelocomeApplet",JLabel.CENTER));
    }
}

写相应的Ht]]></description><category></category></item><item><title><![CDATA[Java程序显示正在运行的时钟(timer类)]]></title><link>https://blog.youkuaiyun.com/coder_duhg/article/details/8489227</link><guid>https://blog.youkuaiyun.com/coder_duhg/article/details/8489227</guid><author>coder_duhg</author><pubDate>Thu, 10 Jan 2013 11:54:20 +0800</pubDate><description><![CDATA[(本程序主要来自Java语言程序设计（基础篇）(Y.Daniel Liang))
类javax.swing.Timer是一个按照预定频率触发ActionEvent事件的源组件。一个Timer对象可以作为ActionEvent事件的源，监听器必须是ActionListener的实例并且要用Timer对象注册。利用给定的时延和监听器可以使用它唯一的构造方法创建Timer对象其中时延是两个事件行为之间]]></description><category></category></item><item><title><![CDATA[Java MessagePanel]]></title><link>https://blog.youkuaiyun.com/coder_duhg/article/details/8489226</link><guid>https://blog.youkuaiyun.com/coder_duhg/article/details/8489226</guid><author>coder_duhg</author><pubDate>Thu, 10 Jan 2013 11:54:17 +0800</pubDate><description><![CDATA[一个小测试，MessagePanel继承于Panel,显示结果为：


  1 import java.awt.*;
  2 
  3 import javax.swing.*;
  4 
  5 public class hello extends JFrame{
  6     public hello(){
  7         MessagePanel mp1=new ]]></description><category></category></item><item><title><![CDATA[Java编译错误“No enclosing instance of type AA is accessible. Must qualify the allocation with an enclosing instance of type SimpleTh]]></title><link>https://blog.youkuaiyun.com/coder_duhg/article/details/8489225</link><guid>https://blog.youkuaiyun.com/coder_duhg/article/details/8489225</guid><author>coder_duhg</author><pubDate>Thu, 10 Jan 2013 11:54:15 +0800</pubDate><description><![CDATA[这是因为AA是一个动态的内部类，创建这样的对象必须有实例与之对应，程序是在静态方法中直接调用动态内部类会报这样错误。 这样的错误好比类中的静态方法不能直接调用动态方法。可以把该内部类声明为static。或者不要在静态方法中调用。
那么为啥非静态方法不能调用动态方法呢，从面向对象的角度来说，动态方法与对象是联系密切的，比如发动是一个方法，它与汽车这个对象是关联的，所以只有new了汽车这个对象才能执]]></description><category></category></item><item><title><![CDATA[java中image显示图片，随上下左右键移动]]></title><link>https://blog.youkuaiyun.com/coder_duhg/article/details/8489224</link><guid>https://blog.youkuaiyun.com/coder_duhg/article/details/8489224</guid><author>coder_duhg</author><pubDate>Thu, 10 Jan 2013 11:54:12 +0800</pubDate><description><![CDATA[1 import java.awt.*;
 2 import java.awt.event.*;
 3 
 4 class FTest {
 5   public static void main(String[] args){
 6      final MyFrame form = new MyFrame();
 7     // form.setBounds(100, 100, ]]></description><category></category></item></channel></rss>