随笔-77  评论-5  文章-2  trackbacks-0
  2011年12月16日
class Square{
public:
 Square(int x ) :value(x*x){
 }

Square(const Square& other) = delete;//rule 1

const Square & operator = (const Square& other) == delete;//rule 2
const Square & operator = (Square&& other) = delete;//rule3 

..
}

Square s = 9; //因为s没有初始化,会先用9 调用构造函数 Square(int x ) , 然后调用Square(const Square& other),和rule1 违背
Square s2(8);
 s= s2;//对应rule 2
 s= Square(9);//对应 rule3 
posted @ 2019-12-31 21:11 huohuo 阅读(1041) | 评论 (0)编辑 收藏
其实一直想学ruby,总是拖拖拉拉推了几年。 很多ruby的教材要么老厚一本 要么是东一榔头西一斧头,逻辑性不清楚 ruby语法还没说清楚就上rails了 这个教材挺好。 今天才发现argument 是实参,parameter是形参
posted @ 2014-07-07 22:20 huohuo 阅读(229) | 评论 (0)编辑 收藏
小新看到妈妈用订书机订了一个盒子,他就从打印机上面拿了几张a4纸,钉了一个像盒子的东西,当作他的百宝箱,把他的一些零零碎碎的东西放到他的百宝箱中。 有一天他看到了妈妈的首饰盒,他觉得很漂亮,就和妈妈说:妈妈,我把你这个盒子里面的东西放到我的那个百宝箱里面,你这个盒子给我当百宝箱吧。 妈妈当然不同意。小新很希望要个百宝箱,爸爸就问他:“你需要一个多大的百宝箱?” 小新比划了一个大小,他希望大一点,能装很多东西。爸爸问他是不是希望箱子能有很多分隔? 小新说不要分隔,但是百宝箱要有锁。 爸爸明白了---你就是要个能锁住的箱子嘛,我给你找个皮箱,带密码锁的。 第二天,爸爸上班回来,发现他平时用的笔记本电脑被小新锁在他的"新百宝箱"----密码锁皮箱里面了,密码是小新设的。 爸爸不知道密码,打不开皮箱,爸爸就和小新说:"帮爸爸把电脑拿出来,爸爸要给你查一个睡觉前讲的故事,不然今天就没故事听了"。 小新说:“你用手机也可以查的嘛,别以为我不知道”
posted @ 2014-01-20 21:49 huohuo 阅读(207) | 评论 (0)编辑 收藏
1 解析utf-8的中文字符问题,我修改了 ReportTask类里面的一个方法,增加了一个getJava().setVmArgs("-Dfile.encoding=utf-8")
2.覆盖率出不了数据   一方面注意制定datafile,把cubertura-instrument和cobertura-report的datafile设置为一个,另外junit里面也要设置一个系统属性,制定cubertura的datafile属性.  不制定datafile时,可能生成文件在当前运行ant的目录.但是我们ant任务中的junit测试任务,可能会使用不同的目录来作工作路径.这样会导致datafile不一致.

另外一个是要记得将javac 任务的debug="yes" ,因为只有debug =yes时,编译的代码才带有行信息,能显示覆盖.  当然常见的问题是junit的classpath中的instrument class目录放到原来被测class之前.




posted @ 2013-08-18 22:37 huohuo 阅读(479) | 评论 (0)编辑 收藏
下载putty的安装版本,安装之后有一个plink pscp程序。
plink程序负责调用ssh命令
pscp负责上传文件。

plink -l user -pw pass   hostname

但是因为plink会提示是否要保存密码,不能保证自动批处理运行,此时利用管道的能力来输入提示的结果

echo Y >yes.txt
plink -l user -pw pass   hostname <yes.txt
posted @ 2012-03-04 06:31 huohuo 阅读(582) | 评论 (0)编辑 收藏
/Files/lijinglin/storm.pdf
posted @ 2011-12-21 01:27 huohuo 阅读(277) | 评论 (0)编辑 收藏
/Files/lijinglin/zookeeper.ppt
posted @ 2011-12-21 00:33 huohuo 阅读(313) | 评论 (0)编辑 收藏
kafka pdf

/Files/lijinglin/F_1330_Narkhede_Kafka.pptx
posted @ 2011-12-20 22:53 huohuo 阅读(304) | 评论 (0)编辑 收藏
/Files/lijinglin/stormsrc.rar
posted @ 2011-12-19 02:15 huohuo 阅读(233) | 评论 (0)编辑 收藏

zookeeper集群安装

测试环境redhat5.5:
vmware建两台虚拟机(btw,似乎双核系统只能建俩,3个就死掉了)
192.168.229.129
192.168.229.130


下载2011年12月15日的最新zookeeper
加压到
/opt/zookeeper-3.4.0/
配置/opt/zookeeper-3.4.0/conf/zoo.cfg
可以把那个例子考过来
Java代码 复制代码 收藏代码
  1. # The number of milliseconds of each tick   
  2. tickTime=2000  
  3. # The number of ticks that the initial    
  4. # synchronization phase can take   
  5. initLimit=10  
  6. # The number of ticks that can pass between    
  7. # sending a request and getting an acknowledgement   
  8. syncLimit=5  
  9. # the directory where the snapshot is stored.   
  10. do not use /tmp for storage, /tmp here is just    
  11. # example sakes.   
  12. dataDir=/opt/zookeeper-3.4.0/data/zookeeper   
  13. dataLogDir=/opt/zookeeper-3.4.0/data/log   
  14. # the port at which the clients will connect   
  15. clientPort=2181  
  16. #   
  17. # Be sure to read the maintenance section of the    
  18. # administrator guide before turning on autopurge.   
  19. #   
  20. # http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance   
  21. #   
  22. # The number of snapshots to retain in dataDir   
  23. #autopurge.snapRetainCount=3  
  24. # Purge task interval in hours   
  25. # Set to "0" to disable auto purge feature   
  26. #autopurge.purgeInterval=1  
  27. server.1=192.168.229.129:2888:3888  
  28. server.2=192.168.229.130:2888:3888  

修改/opt/zookeeper-3.4.0/bin/zkServer.sh
Java代码 复制代码 收藏代码
  1. status)   
  2.     # -q is necessary on some versions of linux where nc returns too quickly, and no stat result is output   
  3.     #STAT=`echo stat | nc -q 1 localhost $(grep "^[[:space:]]*clientPort" "$ZOOCFG" | sed -e 's/.*=//'2> /dev/null| grep Mode`   
  4.     STAT=`echo stat | nc localhost $(grep "^[[:space:]]*clientPort" "$ZOOCFG" | sed -e 's/.*=//'2> /dev/null| grep Mode`  

以上这些多台机器一样

log和data都在dataDir下面
如果找不到log了用大招:
ps -ef|grep zookeeper
ls -l /proc/123123/fd
其中有一个是log
然后dataDir建立一个文件myid
在192.168.229.129上
echo 1 >/opt/zookeeper-3.4.0/data/zookeeper/myid
在192.168.229.130上
echo 2 >/opt/zookeeper-3.4.0/data/zookeeper/myid
对应zoo.cfg里面的
注意一定是数字


然后zkServer.sh start 
启动
zkServer.sh status
看状态
echo ruok|nc localhost 2181         
//are you ok?
echo dump|nc localhost 2181
echo stat|nc localhost 2181
echo srst|nc localhost 2181
zkServer.sh stop
posted @ 2011-12-16 03:48 huohuo 阅读(1318) | 评论 (0)编辑 收藏