asflex
lean1252 · 共 88 篇文章
[置顶] java处理json数据格式
首先下载json-simple-1.1.jar包 主要的类为:JSONArray,JSONObject,JSONValue 代码示例: public static void testJSON() { String jsString = "[\"129653\",\"129664\",\"129660\",\"129665\"]"; //解析json数组字符串 JSONArray ja = (JSONArray)JSONValue.parse(jsString); for(int i = 0; i < ja.size(); i++) { System.out.println(ja.get(i)…
2010-02-05 17:48 · ui · 评论(2)
(转)spring3+mybatis 使用MapperScannerConfigurer时context:property-placeholder载不进属性
如题,使用spring3+mybatis时,使用mybatis官方提供的动态加载自动注入Mapper方法时,写在配置文件里的数据源信息加载滞后,导致加载失败。这个问题在:http://www.oschina.net/question/188964_32305有比较多的讨论,但我仔细测试过,都不能达到我想的结果,这里我参考了mybatis的官方论坛:http://code.google.com/p/mybatis/issues/detail?id=414第17楼的想法,做到了自动注入Mapper到Spring容器中,自动加载sqlMapper的XML文件。 下面贴出我的配置: Xml代码 收藏…
2014-12-30 18:34 · spring · 评论(0)
批量修改库表字符串脚本
生成可执行语句 mysql -uroot -p67457e226a1a15bd -e 'use jira636;show tables;'|awk -F'|' '{print "mysql -uroot -p67457e226a1a15bd -e \"use jira636;alter table "$1 " default character set utf8;\""}' >[color=orange]batch_mysql_table_charset.sh[/color] chmod 755 batch_mysql_table_charset.sh 执行脚本batch_mysql_tab…
ubuntu14 WIFI热点设置
已按照下面文章配置成功,好开森 :D http://jingyan.baidu.com/article/d8072ac4414864ec95cefdaf.html
ubuntu金山快盘安装
先將 原來安裝的 金山快盘套件 移除 安裝新的 金山快盘 kuaipan4uk 套件 2-1. 添加 金山快盘 套件庫 sudo gedit /etc/apt/sources.list.d/kuaipan.list deb http://archive.ubuntukylin.com:10006/ubuntukylin trusty main deb-src http://archive.ubuntukylin.com:10006/ubuntukylin trusty main 儲存 2-1-1. 如果是 第一次 使用 gksudo 請先安裝 gksu 套件 2-2. 如果以前因為安裝別的套…
2014-12-04 11:19 · 错误记录 · 评论(0)
ubuntu apt-get安装chrome
生成key wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - 添加源 sudo vi /etc/apt/sources.list.d/google.list deb http://dl.google.com/linux/chrome/deb/ stable main 源更新 sudo apt-get update 安装 sudo apt-get install google-chrome-stable
2014-12-01 18:25 · linux · 评论(0)
xubuntu网络故障
安装完xubuntu后,打不开百度/javaeye等一些站点 修改/etc/nsswitch.conf hosts: files mdns4_minimal [notfound=return] dns 最终如下 hosts: files dns
2014-12-01 18:16 · linux · 评论(0)
ubuntu public key
一种方法如下: Try this as root: gpg --recv-keys 4D270D06F42584E6 gpg --export 4D270D06F42584E6 | apt-key add - That should download the key from a public keyserver and then the second command adds it to apt. You may need to specify a keyserver if the default doesn't work. There are several public ones av…
2014-11-04 01:22 · linux · 评论(0)
单个tomcat多实例部署shell脚本
步聚 下载tomcat,解压安装 2.将tomcat下的webapps,conf,temp等目录分别拷至根目录www下A,B,C目录下 3.新建如下脚本restart_tomcat.sh 4.使用restart_tomcat.sh A/B/C #!/bin/sh if then echo "\033; then echo -e "\033 or the is no a directory, please check it...\033; then echo -e "\033 or the is not a file, please check it...\033; then echo -e …
2014-09-29 19:44 · linux · 评论(0)
ubuntu svn1.7安装
http://www.sysads.co.uk/2014/05/install-configure-svn-1-7-ubuntu-14-04/ Step 1: Add following lines to source.list sudo add-apt-repository "deb http://de.archive.ubuntu.com/ubuntu/ saucy main universe restricted multiverse" echo libsvn1 hold | sudo dpkg --set-selections ```java echo libserf1 hold |…
2014-09-15 11:05 · linux · 评论(0)
yum简单安装配置的svn1.7
以下操作均使用root帐号执行: yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm yum install --enablerepo=rpmforge,rpmforge-extras subversion 建立启动svn运行用户: useradd svn passwd svn 回车后输入两次密码。 mkdir -p /home/svn/svndata cd /home/svn/svndata svnadmin create test 配置: vi …
2014-09-03 13:18 · linux · 评论(0)
Linux下Chrome标题栏中文乱码
在使用Linux的时候你会遇到一些奇奇怪怪的问题,不过,你会在解决这些问题的过程当中就不知不觉都学到很多东西 比如说最近我把系统的一些包更新后,发现Chrome浏览器的标题栏的中文部分全部为乱码,但FireFox就没有这个问题 网上有人给出这个问题的解决是通过修改文件/etc/fonts/conf.d/49-sansserif.conf倒数第四行为自己喜欢的字体就行了,如我的改为ubuntu view plaincopy在CODE上查看代码片派生到我的代码片 但原理是什么呢?这是一个问题!!!
2014-08-31 12:39 · linux · 评论(0)
java实现单链表逆转
class Node { Node next; String name; public Node(String name) { this.name = name; } /** * 打印结点 */ public void show() { Node temp = this; do { System.out.print(temp + "->"); temp = temp.next; }while(temp != null); System.out.println(); } /** * 递归实现单链表反转,注意:单链表过长,会出现StackOverflowError * @param n * @r…
2014-06-25 16:18 · data structure · 评论(0)
ssh-agent免登陆shell脚本
新建ssh-attach.sh脚本 #!/bin/bash un=`id | awk '{print substr($0,index($0,"(")+1, index($0,")")-index($0,"(")-1)}'` sas=0 for i in `find /tmp -user ${un} -type s 2>/dev/null` do sas=$i SSH_AUTH_SOCK=$i done if [ $sas != 0 ] then export SSH_AUTH_SOCK=$sas export SSH_AGENT_PID=`echo $SSH_AUTH_SOCK | awk …
2014-05-13 16:18 · linux · 评论(0)