北在北方

太白枝头看,花开不计年,杯中浮日月,楼外是青天。

导航

上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 20 下一页

2013年7月18日

摘要: 冒泡排序、选择排序和插入排序代码如下:package cn.luxh.app.test;public class SimpleSortUtil { /** * 冒泡排序 * 从小到大排序 * 思路: * 1)第一趟排序进行了len-1次比较,数组中的最大值元素排到了最末端,位置已固定,该元素不再参与下趟比较 * 2)第二趟排序进行了len-2次比较,因为只需要比较到第一个位置固定的元素(第一趟排序中的最大值元素)即可,数组中的第二大值元素位置也已固定,该元素不再参与下趟比较 * 3)第三趟排序进行了len-3次比较,因为只需要比较到... 阅读全文

posted @ 2013-07-18 16:02 CN.programmer.Luxh 阅读(456) 评论(1) 推荐(2) 编辑

2013年7月16日

摘要: 1、方式一:在server.xml中配置 1)tomcat安装路径下conf目录下的server.xml,在和标签之间加入下面的内容: 2)tomcat安装路径下conf目录下的context.xml,在和标签之间加入如下内容: 3)web.xml配置 app_DataSource jdbc/appDS javax.sql.DataSource Container 2、方式二:在context.xml中配置 1)tomcat安装路径下conf目录下的context.xml,在和标签之间加入如下内容: 2)web.xm... 阅读全文

posted @ 2013-07-16 15:44 CN.programmer.Luxh 阅读(2294) 评论(3) 推荐(4) 编辑

摘要: 使用spring提供的MailSender和JavaMailSender类。1、邮件对象类package cn.luxh.app.mail;import java.util.List;import org.springframework.core.io.AbstractResource;public class Email { //发件人 private String from; //收件人 private String[] to; //主题 private String subject; //邮件内容 private String text; ... 阅读全文

posted @ 2013-07-16 14:51 CN.programmer.Luxh 阅读(1208) 评论(1) 推荐(3) 编辑

2013年7月13日

摘要: 1、安装Tomcat 1)下载apache-tomcat-6.0.37.tar.gz,上传到服务器的/softs目录[root@h1 ~]# cd /softs[root@h1 softs]# lsapache-tomcat-6.0.37.tar.gz [root@h1 softs]# 2)进入/usr/local目录,执行如下明命令[root@h1 local]# tar -zxvf /softs/apache-tomcat-6.0.37.tar.gz 执行结束,Tomcat已经解压好[root@h1 local]# lsapache-tomcat-6.0.37 bin etc ... 阅读全文

posted @ 2013-07-13 22:30 CN.programmer.Luxh 阅读(612) 评论(1) 推荐(1) 编辑

2013年6月18日

摘要: 1、简单的配置<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mongo="http://www.springframework.org/schema/data/mongo" xsi:schemaLocation=& 阅读全文

posted @ 2013-06-18 15:10 CN.programmer.Luxh 阅读(1297) 评论(0) 推荐(0) 编辑

2013年6月15日

摘要: 1、查看用户授权表select user,host,password from mysql.user; 2、给用户设置密码update mysql.user set password=PASSWORD('root') where user='root';flush privileges; 3、登录MySQL[root@h2 ~]# mysql -uroot -proot 4、在从服务器(192.168.0.130)上登录到主服务器(192.168.0.129)[root@h2 ~]# mysql -uroot -proot -h192.168.0.129ERRO 阅读全文

posted @ 2013-06-15 12:18 CN.programmer.Luxh 阅读(586) 评论(0) 推荐(0) 编辑

2013年6月14日

摘要: package cn.luxh.app;import java.io.FileInputStream;import java.io.FileOutputStream;import java.io.IOException;import java.nio.ByteBuffer;import java.nio.channels.FileChannel;import java.nio.charset.Charset;import org.junit.Test;public class NioTester { /** * 读取文件 * 获取通道;创建缓冲区;让通道将数据读到... 阅读全文

posted @ 2013-06-14 10:28 CN.programmer.Luxh 阅读(402) 评论(0) 推荐(0) 编辑

2013年5月12日

摘要: 1、权限配置在数据库中,典型的五张表。 1)t_user 用户表 2)t_role 角色表 3)t_user_role 用户-角色关联表 4)t_resource 资源表 5)t_role_resource 角色-资源关联表 2、建表语句DROP TABLE IF EXISTS `t_resource`;CREATE TABLE `t_resource` (`id` int(11) NOT NULL AUTO_INCREMENT ,`name` varchar(32) CHARACTER SET utf8 COLLATE utf8_gener... 阅读全文

posted @ 2013-05-12 20:50 CN.programmer.Luxh 阅读(1592) 评论(3) 推荐(1) 编辑

2013年5月9日

摘要: 1、权限既然写在配置文件中,那么数据库中只需要三个表即可。 1)t_user 用户表 2)t_role 角色表 3)t_user_role 用户角色表 2、对应的领域实体 1)用户package cn.luxh.app.domain;/** * 用户 * @author Luxh */public class User { private Integer id; /**帐号*/ private String account; /**密码*/ private String password; @Ov... 阅读全文

posted @ 2013-05-09 22:50 CN.programmer.Luxh 阅读(1954) 评论(0) 推荐(0) 编辑

2013年5月7日

摘要: 数据仓库工具,可以把Hadoop下的原始结构化数据变成Hive中的表。 支持一种与SQL几乎完全相同的语言HiveQL,除了不支持更新、索引和事务。 可以看成是从SQL到Map-Reduce的映射器。 提供shell、JDBC/ODBC、thrift、Web等接口。一、内嵌模式安装 这样安装的元数据保持在内嵌的Derby数据库中,只能允许一个会话连接,只适用于简单的测试。 1、解压Hive[coder@h1 ~]$ tar -zxvf hive-0.10.0.tar.gz 2、配置环境变量/etc/profile 加入Hive的安装目录,并把Hive的bin目录配置到PA... 阅读全文

posted @ 2013-05-07 22:23 CN.programmer.Luxh 阅读(512) 评论(0) 推荐(0) 编辑

上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 20 下一页