- 博客(62)
- 资源 (2)
- 收藏
- 关注
原创 金字塔原理
金字塔原理是一种思维方式,一种表达方法。阐述事情的时候需要做到以下三点,第一,抛出结论,结论先行第二,正确的表达结论第三,结论要使对方产生我们希望的动作和反馈
2017-11-12 16:11:47
971
原创 MapReduce
1、定义MapReduce 是google提出的一个软件架构,用于大规模数据集的并行计算。当前的软件实现是指定一个Map(映射)函数,用来把一组键值对映射成一组新的键值对,指定并发的Reduce(归纳)函数,用来保证所有映射的键值对中的每一个共享相同的键值【维基百科】。2、例子【单词个数统计】1.1 输入一段文本1.2 任务分发给每个节点1.3 节点对各自收到的文本进行
2017-11-07 20:55:49
312
原创 c++内存模型
1、内存重排在不影响单线程的执行结果的前提下,编译器会对程序指令进行重排执行,也就是指令的执行顺序并不是编程人员看起来的顺序。读操作的时钟周期一般比较长,在不影响单线程计算结果的前提下,会被提前执行。写操作的值一般会在缓冲区县缓存,延缓写入内存。例如:x = 1; //指令1r1 = y; //指令2在编译器和cpu因为优化重排后,指令2会优先于指令1执行。在单线程编程
2017-11-04 15:53:04
340
原创 Linux 常用命令
1、创建软链接ln -s source_file[源文件] dest_file[软链接符号] ln -s /data/log/data_travler/ ./log
2017-09-18 20:06:03
366
原创 IO多路复用机制
上篇文章讲到IO模式,这篇文章讲其中一种模式-IO多路复用模式。IO多路复用技术根据实现不同,分为三种,select、poll、epoll。1、selectint select (int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);select把监听的文件描述符分
2017-09-17 16:07:01
267
原创 Linux IO模式
1、一次IO过程当一次读IO操作发生时,它会经历两个阶段step1:内核等待数据准备,将数据保存在内存缓冲区step2:内湖将数据从内核缓冲区拷贝到进程空间2、IO模式2.1 阻塞模式阻塞模式的特定是两个阶段都阻塞。换句话说,step1:如果内核缓冲区没有数据,进程阻塞step2: 如果数据还没从内核缓冲区拷贝到进程空间,进程阻塞2.2 非阻塞模
2017-09-17 15:26:54
314
原创 c++模板编程
1、什么是模板编程1.1 模板编程可以使你的代码独立于类型1.2 模板编程是一种在编译时期用代码生成代码的方式1.3 function 模板借由参数化手段表现一整个族群的functions1.4 class模板可以用来管理不同型别的元素
2017-09-15 20:24:10
351
原创 理解字节序
1、什么是字节序举个例子: uint32_t value = 0x44332211; buf[4] = {0}; memcpy(buf,&value,sizeof(uint32));那么 ,buf中的值是什么?在小端序列的主机中,buf[0] = 0x11, buf[1] = 0x22, buf[2] = 0x33, buf[3
2017-09-13 20:19:28
325
原创 unix ip 地址值
这篇文章记录unix中ip地址的相关操作。此次总结后,希望能避免每次用到都要临时去查找的烦恼。1、相关数据结构 1.1 struct sockaddr struct sockaddr {unsigned short sa_family;char sa_data[14]};sockaddr 是通用地址结构,一般用 sockaddr_in 来解析,也就是解析sa_data
2017-09-11 20:01:57
964
原创 apache2 + mysql + thinkphp
1 环境搭建http://imcn.me/html/y2012/12401.html2 thinkphp shouc
2014-08-28 15:24:37
762
原创 ubuntu dns 配置
http://www.linuxidc.com/Linux/2009-08/21425.htmsudo vim /etc/resolvconf/resolv.conf.d/base
2014-05-14 09:54:13
507
原创 update-alternatives 命令
update-alternatives creates, removes, maintains and displays information about the symbolic links comprising the Debian alternatives system. It is possible for several programs fulfilling
2014-05-04 11:47:05
892
转载 正态分布的前世今生
http://cos.name/2013/01/story-of-normal-distribution-1/http://songshuhui.net/archives/77386
2014-04-30 11:38:56
570
转载 最大流和二分匹配
http://blog.youkuaiyun.com/akof1314/article/details/4421262http://kukumayas.iteye.com/blog/1075610http://chhaj5236.blog.163.com/blog/static/1128810812009910102617216/http://chhaj5236.blog.163.
2014-04-26 22:03:28
514
原创 unix socket 的缓冲区大小
1 默认大小tcp : cat /proc/sys/net/ipv4/tcp_rmem 4096 87380 4161536其中87380为默认接收缓冲的大小cat /proc/sys/net/ipv4/tcp_wmem4096 16384 4161536其中16384为默认发送缓冲的大小 udp:cat /proc/sys/ne
2014-04-21 16:30:14
4905
原创 rc.local
The sytem will exec the script rc.local when it start upecho "/etc/rc.local" echo "sudo insmod /lib/modules/3.5.0-23-generic/kernel/drivers/uio/uio_ivshmem.ko" sudo insmod /lib/modules/3.5.0-23-
2014-01-10 17:42:28
574
原创 信号,进程,线程
1 信号和进程 Reference APUE P240 #include typedef void (*sighandler_t)(int); sighandler_t signal(int signum, sighandler_t handler);#include int sigemptyset(sigset_t *set);int sigfillset(si
2014-01-07 18:34:14
666
原创 capture sigsegv produced from the io thread in the main thread
In the file qemu/util/qemu-thread-posix.c line 294add the statemnet "sigdelset(&set,SIGSEGV)"
2014-01-07 16:29:00
526
转载 linux-test.c
/* * linux and CPU test * * Copyright (c) 2003 Fabrice Bellard * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License
2014-01-03 10:48:26
750
转载 Linux X11 Connection Rejected Because of Wrong Authentication Error and Solution
0 Refrencehttp://www.cyberciti.biz/faq/x11-connection-rejected-because-of-wrong-authentication/1Q. I'm trying to login to my remote Ubuntu Linux server from Mac OS X desktop using following
2013-12-25 19:39:01
2392
原创 环境变量 DISPLAY
0Refrencehttp://blog.chinaunix.net/uid-23072872-id-3388906.html每个 图形界面程序就是一个 xclient每台主机上都会运行一个 xserverxclient 在哪里显示(链接到哪个xserver)和它的终端环境变量DISPLAY 有关DISPLAY环境变量格式如下host:NumA.NumB, host
2013-12-25 16:17:20
5180
原创 catch sigsegv
0 Reference http://blog.youkuaiyun.com/chenjin_zhong/article/details/6129628http://blog.sina.com.cn/s/blog_566f698201017dty.htmlhttp://blog.chinaunix.net/uid-24098129-id-312659.html1 Edit sudo
2013-12-17 22:12:40
851
转载 SSH在本地执行远程机器上的命令
在本地使用 ssh $RemoteNode 可以在执行远程机器上的命令.例如 ssh user@node ls /local 会执行远程机器上的 ls /local 命令.如果想在远程机器上连续执行多条命令,可以用单引号或者双引号将这些命令括起来, 例如:ssh user@node "cd /local; pwd;ls" 如果想在本地启动远程机器上的命令
2013-12-11 16:32:04
1540
原创 Use sha1
0 Reference http://blog.youkuaiyun.com/liuhong135541/article/details/8138525http://blog.youkuaiyun.com/shahongzhou/article/details/6586303http://blog.sina.com.cn/s/blog_4c451e0e0100zf2j.html1 Instal
2013-11-27 18:24:58
931
原创 /etc/hosts configure
0 Refrencehttp://www.jb51.net/LINUXjishu/77329.html1 test program#include #include #include #include #include #include int main(int argc, char *argv[]){ int i; struct host
2013-11-12 19:24:32
697
原创 login shell and non-login shell
bash与sh bash 和 sh都是 linux shell ,相当于只是它们版本不同。一般情况下,在控制台终端登录或在图形界面下开启“终端”,默认都会启动一个shell来接待使用者。具体流程:可以认为终端是父进程getty先启动,该getty会执行login程序,以处理登录的动作,登陆完成以后,login就会执行用户的 shell,这时就是为用户默认分配了一个shell。该shell执
2013-10-25 16:12:15
811
转载 Make ARM cross compiler tool chain using crosstool-ng
0 Referencehttp://jarson.asia/2012/12/04/%E4%BD%BF%E7%94%A8crosstool-ng%E5%88%B6%E4%BD%9Carm%E4%BA%A4%E5%8F%89%E7%BC%96%E8%AF%91%E5%B7%A5%E5%85%B7%E9%93%BE
2013-09-24 10:17:16
648
原创 Add user in ubuntu
sudo addgroup hadoopsudo adduser --ingroup hadoop hdusersudo visudo ( add hduser ALL=(ALL:ALL) ALL similar to root)
2013-09-24 10:09:35
502
原创 Compatible problem in JIAJIA
In 32-bite system, the size of long and point is 4 Bytes;In 64-bite system, the size of long and point is 8 Bytes;There is the key point.Solution:We still user the long as the type of address,
2013-08-29 14:45:14
621
原创 Check the bits in linux
#include #include int main() { #if __WORDSIZE==32 printf("The system is 32 bits\n"); #endif #if __WORDSIZE==64 printf("The system is 64 bits\n"); #endif return 0;
2013-08-29 10:09:21
463
原创 How to write makefile
http://wiki.ubuntu.org.cn/%E8%B7%9F%E6%88%91%E4%B8%80%E8%B5%B7%E5%86%99Makefile:%E4%B9%A6%E5%86%99%E8%A7%84%E5%88%99#.E8.87.AA.E5.8A.A8.E7.94.9F.E6.88.90.E4.BE.9D.E8.B5.96.E6.80.A7
2013-08-25 21:25:35
1001
原创 sudo without password
login as rootchmod 740 /etc/sudoerssudo vim /etc/sudoersAdd at the last lineixzl ALL=NOPASSWD:ALLchmod 440 /etc/sdouers
2013-08-02 11:07:21
1013
原创 Hadoop install and set up
0 Refrencehttp://www.linuxidc.com/Linux/2011-11/47672.htmhttp://www.2cto.com/os/201202/118992.htmlhttp://blog.youkuaiyun.com/shirdrn/article/details/7166513
2013-08-02 10:59:31
833
原创 Bug in JIAJIA
JIAJIA can not catch the fault address in sigsevg_handler for x86_64http://us.generation-nt.com/answer/sigsegv-signal-handler-help-183484481.htmlhttp://comp.os.linux.development.apps.narkive.com
2013-07-23 20:43:33
614
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人