2013年12月13日

mahout安装/运行20newsgroup例子

摘要: 安装1.下载解压2.配置环境变量3.测试运行20newsgroup例子准备工作下载http://qwone.com/~jason/20Newsgroups/http://qwone.com/~jason/20Newsgroups/20news-bydate.tar.gz解压上传到hadoop解压到20news目录下mkdir 20news-allcp -R 20news/*/* 20news-all在hadoop下创建目录并把解压好的文件上传到hadoophadoop fs -mkdir ./20newshadoop fs -put /home/hduser/20news-all ./20ne 阅读全文

posted @ 2013-12-13 13:04 ukouryou 阅读(452) 评论(0) 推荐(0) 编辑

2013年11月27日

install pig --simple operation

摘要: 1.下载pig-0.12.0.tar.gz,并解压2.设置环境变量vi .bash_profileexport PIG_HOME=/home/hduser/pigexport PATH=$PIG_HOME/bin:$HADOOP_HOME/bin:$HOME/bin:$PATH#PATH=$PATH:$HOME/binexport PATHexport PIG_CLASSPATH=$HADOOP_HOME/conf$HADOOP_HOME/bin一定要在PATH中2.pig -x localA = LOAD '/home/hduser/hadoop/access_log.txt' 阅读全文

posted @ 2013-11-27 12:37 ukouryou 阅读(133) 评论(0) 推荐(0) 编辑

2013年11月18日

Lexical Structure

摘要: 1.underscorehttp://docs.oracle.com/javase/7/docs/technotes/guides/language/underscores-literals.htmlfloat pi1 = 3_.1415F; // Invalid; cannot put underscores adjacent to a decimal pointfloat pi2 = 3._1415F; // Invalid; cannot put underscores adjacent to a decimal pointlong socialSecurityNum... 阅读全文

posted @ 2013-11-18 13:09 ukouryou 阅读(198) 评论(0) 推荐(0) 编辑

2013年11月15日

Linux 开发工具

摘要: Linux开发工具===========================================获取在线帮助:man/xman、info、whatis源程序阅读器:SourceNavigator源代码编辑器:vim/gvim、emacs/xemacs、jed工程自动管理:make、imake/xmkmf、autoconf宏处理工具:m4版本控制工具:CVS、RCS源程序的补丁:diff、patch包创建和管理:rpm、install*GNU编译链接器:gcc/g++、ld、as/as86C语法检查工具:lintC语言预处处理:cpp、cdecl、ctagC语言美化工具:indent函数 阅读全文

posted @ 2013-11-15 17:41 ukouryou 阅读(135) 评论(0) 推荐(0) 编辑

2013年11月4日

basic questions

摘要: Map map = new HashMap(); map.put("1", 100); if (map.containsKey(1)) { System.out.println(map.get(1)); } if (map.containsKey("1")) { System.out.println("this one:" + map.get("1")); } Integer sx = null; if (sx == 3) { System.o... 阅读全文

posted @ 2013-11-04 17:36 ukouryou 阅读(96) 评论(0) 推荐(0) 编辑

2013年11月1日

linux下邮件winmail.dat

摘要: sudo apt-get install tneftnef winmail.datconvmv -f gbk -t utf8 --notest * 阅读全文

posted @ 2013-11-01 17:15 ukouryou 阅读(179) 评论(0) 推荐(0) 编辑

maven no Maven Dependencies view

摘要: mvn eclipe:cleanm2e>Update Project 阅读全文

posted @ 2013-11-01 13:34 ukouryou 阅读(130) 评论(0) 推荐(0) 编辑

2013年10月29日

kindle 安装词典

摘要: 是有字典啊,连接USB看\DK_System\xKindle\res\dict里面字典是否还在安装字典方法:A. 字典下载地址:http://bbs.xiaomi.cn/forum.php?mod=viewthread&tid=7994942&page=1&extra=#pid144029125B. 选择自己所需的字典进行下载。C. 下载完成后,其格式为.tar.bz的压缩包,如:stardict-gaojihanyudacidian_fix-2.4.2.tar.bz2,选中该压缩包,右键,选择”解压文件”。D. 解压后生成三个文件,后缀分别为.dz、.idx、.ifo 阅读全文

posted @ 2013-10-29 12:36 ukouryou 阅读(2053) 评论(0) 推荐(0) 编辑

2013年10月25日

hadoop namenode secondaryNamenode 分离

摘要: 1.hdfs-site.xml dfs.replication 2 Default block replication. dfs.http.address master:50070 dfs.secondary.http.address slave1:50090 2.master记录secondaryNamenode节点地址#slave1为secondaryNamenodeslave1check 阅读全文

posted @ 2013-10-25 15:41 ukouryou 阅读(193) 评论(0) 推荐(0) 编辑

2013年10月24日

protobuf maven integration

摘要: com.github.igor-petruk.protobuf protobuf-maven-plugin 0.6.3 generate-sources run install ${basedir}/src/protobuf/ ... 阅读全文

posted @ 2013-10-24 11:53 ukouryou 阅读(417) 评论(0) 推荐(0) 编辑

2013年10月21日

Index sample

摘要: 1 public void createIndex() throws IOException { 2 DIRECTORY = FSDirectory.open(new File("/home/andy/work/lucene/index/1")); 3 Analyzer chineseanalyzer = new SmartChineseAnalyzer(Version.LUCENE_42); 4 IndexWriterConfig indexWriterConfig = new IndexWriterConfig(Version... 阅读全文

posted @ 2013-10-21 14:01 ukouryou 阅读(130) 评论(0) 推荐(0) 编辑

2013年10月17日

Hadoop 开发环境(CentOS6.4)

摘要: configure ssh1.add a dedicated hadoop system usersudo groupadd hadoopsudo useradd -G hadoop hdusersudo passwd hduser2.generate ssh private keyssh-keyg... 阅读全文

posted @ 2013-10-17 15:21 ukouryou 阅读(180) 评论(0) 推荐(0) 编辑

2013年10月12日

CentOS6.4 java environment

摘要: 1.Download jdk rpm package:jdk-7u40-linux-i586.rpm2.sudo rpm -ivh jdk-7u40-linux-i586.rpm3.update-alternatives --install /usr/bin/java java /usr/java/jdk1.7.0_40/bin/java 300 update-alternatives --remove java /usr/java/jdk1.7.0/bin/java4.alternatives --config java5.vi /etc/profile#java environmentex 阅读全文

posted @ 2013-10-12 17:55 ukouryou 阅读(114) 评论(0) 推荐(0) 编辑

2013年10月9日

Lucene query:not clause

摘要: Test(+NOT+userId%3A5791)+AND+is_visible%3Atrue+AND+...the result is 0+NOT+userId%3A5791+AND+is_visible%3Atrue+AND+...the result is 4bracket changed sth? 阅读全文

posted @ 2013-10-09 15:41 ukouryou 阅读(137) 评论(0) 推荐(0) 编辑

VirtualBox 下安装CentOS6.4

摘要: 折腾了一天终于安装成功啦!1.安装映像的选择开始的时候我选择的是CentOS-6.4-x86_64-LiveCD.iso,但是死活安装不成功,遇到的主要问题是安装的时候直接通过LiveCD启动系统而没有安装;后来问了群里的几个兄弟,一些人用的是CentOS-6.4-i386-bin-DVD1.iso,后来我也选择了这个安装映像文件,并且成功安装成功了。2.网络配置刚安装好的CentOS是不能访问网络的,配置如下:sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0修改为ONBOOT=yes3.配置host 阅读全文

posted @ 2013-10-09 12:24 ukouryou 阅读(101) 评论(0) 推荐(0) 编辑

2013年9月22日

Protobuffer

摘要: Controller@RequestMapping(value={"/get/test"}, method = {RequestMethod.GET}) public void userSearch(HttpServletResponse response, @RequestParam(value = "name", required = false) String name, @RequestParam(value = "page",required = false) int page)... 阅读全文

posted @ 2013-09-22 15:17 ukouryou 阅读(189) 评论(0) 推荐(1) 编辑

2013年9月7日

文件处理

摘要: open('filename')file('filename','mode')mode:a,w,r,a+,w+,r+methods:readline(),readlines()write('')seek(n)truncate(n) 阅读全文

posted @ 2013-09-07 18:00 ukouryou 阅读(67) 评论(0) 推荐(0) 编辑

Python 数据结构

摘要: split(),join()函数Listcount(''),index('')append(''),insert(index,item),extend('')remove(''),pop(index),pop()sort()if item in List: print itemtuplecount(''),index('')del tupleDictionaryPhone = {'alex':'135','ch':'136 阅读全文

posted @ 2013-09-07 17:19 ukouryou 阅读(151) 评论(0) 推荐(0) 编辑

python 控制语句

摘要: 1 for i in range(1,10,2): 2 print 'my number is ', i 3 if i == 5: 4 print 'got it!' 5 break 6 else: 7 print 'class is dismiss' 8 9 10 while True:11 input = int(raw_input('input code:'))12 if input == 5:13 print 'success'14 elif input == 0:15 ... 阅读全文

posted @ 2013-09-07 10:18 ukouryou 阅读(110) 评论(0) 推荐(0) 编辑

2013年8月20日

Ubuntu 挂载代理

摘要: sudo apt-get -o Acquire::http::proxy="http://127.0.0.1:8087/" update 阅读全文

posted @ 2013-08-20 11:58 ukouryou 阅读(160) 评论(0) 推荐(0) 编辑

2013年8月19日

Ubuntu crontab

摘要: crontab-eselect-editorsudoservicecronrestart crontab记录日志修改rsyslogsudo vim /etc/rsyslog.d/50-default.confcron.* /var/log/cron.log #将cron前面的注释符去掉重启rsyslogsudo service rsyslog restart查看crontab日志less /var/log/cron.logcrontab问题定位查看日志/var/log/cron.log 和 /var/mail/$user因为crontab运行日志记录在cron.log,开启send... 阅读全文

posted @ 2013-08-19 11:57 ukouryou 阅读(150) 评论(0) 推荐(0) 编辑

2013年8月13日

solr fieldType

摘要: 1 2 3 4 7 8 9 10 阅读全文

posted @ 2013-08-13 12:23 ukouryou 阅读(84) 评论(0) 推荐(0) 编辑

Integer

摘要: samples:Integer x = 500; Integer y = 500; System.out.println(x == y + 0); //true System.out.println(x == y); //falseInteger x = 127; Integer y = 127; System.out.println(x == y + 0); //true System.out.println(x == y); //true1.Integer + int :autounboxing This ... 阅读全文

posted @ 2013-08-13 10:26 ukouryou 阅读(149) 评论(0) 推荐(0) 编辑

2013年7月31日

FreeMarker grammer

摘要: 1. MapRender the values of a MapThe following code snippet shows how to get the values of a Map (e.g. HashMap) from within a Freemarker template.${myObject.myPropery} Render the keys of a MapYou can do a similar thing with the keys of a map as shown below.${key} //friendId 是int类型 ... 阅读全文

posted @ 2013-07-31 11:40 ukouryou 阅读(181) 评论(0) 推荐(0) 编辑

2013年7月7日

函数

摘要: extern引用其他文件的全局变量一定要加extern在本文件里定义的全局变量加extern,它的作用域为从变量定义处开始,到本程序文件的末尾 阅读全文

posted @ 2013-07-07 12:16 ukouryou 阅读(81) 评论(0) 推荐(0) 编辑

2013年6月20日

R语言与数据挖掘学习笔记

摘要: (转)http://www.chinakdd.com/article-QN017Yx0Om34f53.html今天发现一个很不错的博客(http://www.RDataMining.com), 博主致力于研究R语言在数据挖掘方面的应用,正好近期很想系统的学习一下R语言和数据挖掘的整个流程,看了这个博客的内容,心里久久不能平静。决定从今天 开始,只要晚上能在11点之前把碗洗好,就花一个小时的时间学习博客上的内容,并把学习过程中记不住的信息记录下来,顺便把离英语四级的差距尽量缩小。下面列出了可用于数据挖掘的R包和函数的集合。其中一些不是专门为了数据挖掘而开发,但数据挖掘过程中这些包能帮我们不少忙, 阅读全文

posted @ 2013-06-20 10:45 ukouryou 阅读(342) 评论(0) 推荐(0) 编辑

2013年6月19日

R in Action notes

摘要: chapter02向量:一维数组(存数值型、字符型、逻辑型数据)a <- c(2:8)a[2:5]矩阵:二维数组A matrix is a two-dimensional array where each element has the same mode (numeric,character, or logical). Matrices are created with the matrix function. The general for-mat ismyymatrix <- matrix(vector, nrow=number_of_rows, ncol=number_of 阅读全文

posted @ 2013-06-19 18:25 ukouryou 阅读(167) 评论(0) 推荐(0) 编辑

connect to mysql by odbc in linux

摘要: 原文:http://asteriskdocs.org/en/3rd_Edition/asterisk-book-html-chunk/installing_configuring_odbc.htmlsudo apt-get install unixODBC unixODBC-devsudo apt-get install libmyodbcOn Ubuntu, the/etc/odbcinst.inifile will be blank, so you’ll need to add the data to that configuration file. Add the following t 阅读全文

posted @ 2013-06-19 17:45 ukouryou 阅读(359) 评论(0) 推荐(0) 编辑

2013年6月9日

Lucene source Vint 写入

摘要: 代码位置org.apache.lucene.store.DataOutput 1 /** Writes an int in a variable-length format. Writes between one and 2 * five bytes. Smaller values t... 阅读全文

posted @ 2013-06-09 12:00 ukouryou 阅读(183) 评论(0) 推荐(0) 编辑

2013年6月4日

程序员技术练级攻略

摘要: 转载自http://coolshell.cn/articles/4990.html月光博客6月12日发表了《写给新手程序员的一封信》,翻译自《An open letter to those who want to start programming》,我的朋友(他在本站的id是Mailper)告诉我,他希望在酷壳上看到一篇更具操作性的文章。因为他也是喜欢编程和技术的家伙,于是,我让他把他的一些学习Python和Web编程的一些点滴总结一下。于是他给我发来了一些他的心得和经历,我在把他的心得做了不多的增改,并根据我的经历增加了“进阶”一节。这是一篇由新手和我这个老家伙根据我们的经历完成的文章。我 阅读全文

posted @ 2013-06-04 09:48 ukouryou 阅读(87) 评论(0) 推荐(0) 编辑

2013年5月31日

ubuntu下java开发环境配置

摘要: 1.进入/etc/profile.d目录2.建立dev.sh脚本3.在dev.sh脚本里配置java开发环境#set java environment#JAVA_HOME=/usr/local/javaenv/jdk1.6.0_37M2_HOME=/home/andy/maven#export CLASSPATH=$JAVA_HOME/lib:$CLASSPATH#export PATH=$JAVA_HOME/bin:$M2_HOME/bin:$PATHexport JAVA_HOME=/usr/local/development/jdk1.7.0_17export JRE_HOME=$JAV 阅读全文

posted @ 2013-05-31 10:52 ukouryou 阅读(108) 评论(0) 推荐(0) 编辑

2013年5月16日

Gerrit

摘要: git clone ssh://andy@url:29418/project_namegit checkout -b devgit branchscp -P 29418 andy@review.tianji.com:hooks/commit-msg .git/hooks/git statusgit add .git commit -m "some modification"git checkout mastergit pullgit checkout devgit rebase mastergit loggit statusgit push origin HEAD:refs 阅读全文

posted @ 2013-05-16 09:59 ukouryou 阅读(149) 评论(0) 推荐(0) 编辑

2013年5月12日

预处理器

摘要: 1.文件包含 #include "filename" #include <filename> <>先去系统目录中找头文件,如果没有在到当前目录下找。所以像标准的头文件 stdio.h、stdlib.h等用这个方法。 而""首先在当前目录下寻找,如果找不到,再到系统目录中寻找。 这个用于include自定义的头文件,让系统优先使用当前目录中定义的。2.宏替换 #define name 替换文本 若换行则在待续的行末尾加上反斜杠\ 文本可以是表达式 define存在一些缺陷(max(a++,b++)) 宏定义函数(高效),可以通过#u 阅读全文

posted @ 2013-05-12 10:35 ukouryou 阅读(135) 评论(0) 推荐(0) 编辑

2013年5月10日

mysql 命令

摘要: 导出mysql -uroot -p databaseName tableName>file.dump导入mysql -uroot -p databaseName r_test.dumpsudo apt-get remove --purge mysql-server mysql-client mysq... 阅读全文

posted @ 2013-05-10 11:19 ukouryou 阅读(220) 评论(0) 推荐(0) 编辑

2013年4月17日

Moving property files outside jar in spring standalone application

摘要: In one of Spring standalone project, we needed to move the property files out of the jar for easy configurability.I followed following steps:1. Move property files out of JAR and put in a directory say “target/lib”<plugin><artifactId>maven-antrun-plugin</artifactId><executions&g 阅读全文

posted @ 2013-04-17 13:42 ukouryou 阅读(316) 评论(0) 推荐(0) 编辑

2013年3月27日

maven eclipse 工程缺少build path怎么办?

摘要: 现象在eclipse里用subeclipe从svn上拖下来的项目,看不见java build path怎么办?原因那是因为你的两个配置文件:.project .classpath没有内容或者缺失。解决以一个maven管理的java项目为例。用下面内容替换掉.project文件Xml代码<?xmlversion="1.0"encoding="UTF-8"?><projectDescription><name>fastjson_source</name><comment></comment&g 阅读全文

posted @ 2013-03-27 15:45 ukouryou 阅读(1487) 评论(0) 推荐(0) 编辑

2013年3月19日

Broken pipe

摘要: 这个异常是由于以下几个原因造成。1、客户端再发起请求后没有等服务器端相应完,点击了stop按钮,导致服务器端接收到取消请求。通常情况下是不会有这么无聊的用户,出现这种情况可能是由于用户提交了请求,服务器端相应缓慢,比如业务逻辑有问题等原因,导致页面过了很久也没有刷新出来,用户就有可能取消或重新发起请求。2、Tomcat服务器在接受用户请求的时候,有其自身的处理能力,线程、服务器等各个资源限制,超出Tomcat承载范围的请求,就会被tomcat停掉,也可能产生该错误。3、linux的线程机制会产生JVM出错的问题,特别是在连接高峰期间经常出现这样的问题,tomcat在linux下也出现类似情况。 阅读全文

posted @ 2013-03-19 11:55 ukouryou 阅读(635) 评论(0) 推荐(0) 编辑

2013年3月14日

Get Started

摘要: What would you do?When Jessica took over the department, she turned to Mary, her mentor and boss, for support. On several occasions, Jessica asked Mary where she saw the department going. Each time Mary would make a vague comment or suggestion and then turn the question around, and ask her—"Whe 阅读全文

posted @ 2013-03-14 15:08 ukouryou 阅读(266) 评论(0) 推荐(0) 编辑

Skills and Characteristics of Leaders

只有注册用户登录后才能阅读该文。 阅读全文

posted @ 2013-03-14 14:58 ukouryou 阅读(2) 评论(0) 推荐(0) 编辑

What Leaders Really Do

只有注册用户登录后才能阅读该文。 阅读全文

posted @ 2013-03-14 14:56 ukouryou 阅读(2) 评论(0) 推荐(0) 编辑

导航