JUST DO IT ~

我只想当个程序员

2015年1月30日

     摘要: 检查宏定义
WIN32
_DEBUG
_WINDOWS
_USRDLL  阅读全文
posted @ 2017-08-16 10:43 小高 阅读(356) | 评论 (0)编辑 收藏

GDB笔记

概览

基础

用户态会话

调试模式

  • 转储文件调试

    瞬间静态分析,进程死状态。
    gdb –core=file

  • 交互调试

    1. 调试新进程
      gdb exe
      gdb –args exe [args]

    2. 调试已经运行的进程
      gdb –pid= 进程号

    3. 内核调试

3种调试已有进程

gdb exe

.

gdb –args exe [args]

.

gdb
file exe
run [args]

.

gdb –args gcc a.c -o a

命令行参数

show args

set args 多次运行设置命令行参数

环境变量和执行路径

path directory

.

show paths

.

show environment [varname]

.

set environment varname[=value] 清除或者设置环境变量

工作目录

继承进入gdb工作目录

改变工作目录

cd dirctory

显示路径

pwd

输入输出

info terminal
run > a.txt
tty /dev/ttyb

远程调试可用这些辅助。

inferior 下层 多个进程调试

inferior gdb维护的一系列对象,每个inf对应一个调试目标进程。

info inferior 显示下层信息
NULL 程序没有跑或者已经终止
clone-inferior -copies 2 复制当前下层2份

(gdb) info inferiors
Num Description Executable
* 1 process 10087 /home/gao/code/a
(gdb) clone-inferior -copies 2
Added inferior 2.
Added inferior 3.
(gdb) info inferiors
Num Description Executable
3 程序没有跑或者已经终止 /home/gao/code/a
2 /home/gao/code/a
* 1 process 10087 /home/gao/code/a
(gdb)

切换下程

inferior 2 切换2这个下程。
进程号是0,没开始运行。
run 运行起来。

.

增加一个运行下层

add-inferior -exec executeable 增加一个运行下层
比如说调试一个服务端程序,一个客户端程序。

remove-inferior n 删掉一个下层
detach inferior 继续运行 quit
kill inferior 调试进程退了,但是inferior纪录还在。

Tab 帮助

(gdb) remove-
remove-inferiors remove-symbol-file
(gdb) remove-
remove-inferiors remove-symbol-file
(gdb) remove-

file 命令

file a.exe 可自行文件和符号文件是一个文件

可自行文件和符号文件分开

exec-file 指定目标文件

.

symbol-file 指定符号文件

run 开始运行
可以支持 run > >> < 重定向

set args 清理命令行参数

附加到进程

gdb –pid= pid

attach pid

终止调试进程

detach pid 分离进程继续运行

.

quit 进程退出

.

q
ctrl + D

执行控制

断点

软件断点

break 普通
tbreak 一次性
rbreak 正则表达式一批断点

  • 基于cpu断点指令,x86 int3机器码0xcc。
  • 替换断点位置的指令
  • CPU自执行这里触发断点异常。
  • 没有断点数量限制。

硬件断点

  • 基于cpu调试寄存器,dr0~dr7,数量限制。x86可以设定4个断点。数量限制。
  • 不修改代码,在只读内存上设置断点。EEPROM上的代码设置。
  • 有数量限制。

location

  • linespec

  1. 行号
  2. -/+ 偏移
  3. 文件名 :行号
  4. 函数名
  5. 函数:标号
  6. 文件名:函数
  7. 标号

  • explicit

  1. -source linename
  2. -function function
  3. -label label
  4. -line number

  • address location break * address

实践

file banner
b main 中断在main函数
info funciton useage 显示useage函数地址
info *0x88888e4 直接写地址设定断点
info b 显示所有断点
list usage 显示useage函数
b line.c:11
b +2 当前显示到14行+2行所以设定在17行

虚拟机设定硬件断点会失败.
(gdb)hbreak hd_ioctl
(gdb) info b
物理机可以设定.

(gdb) hbreak v
Hardware assisted breakpoint 2 at 0x40053a: v. (2 locations)
(gdb) info b
Num Type Disp Enb Address What
1 breakpoint keep y
breakpoint already hit 1 time
1.1 y 0x000000000040054f in main at a.c:10 inf 1
1.2 y 0x000000000040054f in main at a.c:10 inf 2
2 hw breakpoint keep y
2.1 y 0x000000000040053a in v at a.c:4 inf 1
2.2 y 0x000000000040053a in v at a.c:4 inf 2
(gdb)

管理断点

info b 显示断点
delete 1 删除
disable 1
enable 1
delete 删除所有的断点
clear sum 删除sum函数入口的所有断点

扩展断点

watchpoint 监视一个表达式,值变化中断。

watch a*b+c/d
watch *( int * )

watch fd 监控局部变量fd
c 继续运行
info b //
注意,x86硬件调试,写操作,执行过这一行,gdb显示下一行,要看上一行。hw watchpoint,在x86平台wachtpoint基于硬件实现,其他平台可能是基于软件实现。 vc6纯软件执行,执行目标速度低。
执行位置超过当前区域,无效监视点会被删除。

访问监视点
rwatch 读停下来。
awatch 读或写停下来。 awatch fd
watch -l

b hd_ioctl thread 1

info threads 带* 当前线程

繁忙函数解决方案

b hd_ioctl thread 1 if fd > 0

当断点,断了后执行命令
()command 12
()silent
()print “fd is %d\n”,fd
()continue
()end

动态ping不修改代码。

tracepoint 远程主机通讯调试,前端stub立刻恢复执行,但会记录下来。

catchpoint

执行控制

进入子函数内部。单步 step

汇编 stepi

stepi 4
类似nexti

不要进入子函数

next

继续执行

continue

跑起来直到3号断点命中

until 3
跑起来直到3号断点命中,快捷禁止其他断点。

恢复执行直到函数返回。

finish

调用函数!

gdb 杜撰代码调用函数。
call sum(1,2) …

强制返回

强制main函数 return。
return 1

触发中断

异常或断点进入调试器。
调试器发起中断,让程序中断下来。ctrl+C,app收到中断信号,进入调试器。

符号

调试器读区 调试符号。

二进制-调试符号-源码

linux dwarf 存储调试符号信息。gcc

readelf -h filename
里面如果有line location debug标示

readelf -w 导出调试文件

gcc -g 才能输出符号

ubuntu 符号服务器
< ddebs.ubuntu.com/pool/main/>
分离操作
strip

安装ubunte的linux 内核符号
https://askubuntu.com/questions/197016/how-to-install-a-package-that-contains-ubuntu-kernel-debug-symbols

安装libc符号

dpkg -s /lib/x86_64-linux-gun/libc-2.15.so
dpkg -s libc.so.6
sudo apt-get -c aptproxy.conf install libc6-dbg

libc 调试符号

sudo apt-get install libc6-dbg

符号路径

gdb 使用file 或 symbol-file 加载符号文件
自动搜索 path 路径

(gdb)i share
* 共享库没调试信息

搜索符号
info vaiables regex 类名/函数名/变量名

内存地址与符号互换

info addriess 函数名

info symbol 地址

(gdb) info address main
Symbol “main” is a function at address 0x400547.
(gdb) info symbol 0x400547
main in section .text of /home/gao/code/a

.

info os

查看加载的文件内存位置

info files

列出全局变量

info variable
info va

显示源码

list
list -
dir 源码路径
show dir

常用命令源码

安装系统工具源码和调试

apt-get source coreutils
sudo apt-get install coreutils-dbgsym
gdb /bin/ls
list main
dir ~/src/coreutils-7.4/src
list main

libc

sudo apt-get source libc6-dev
/home/ge/eglibc-2.15

dir 搜索路径 :分割
$cdir 编译路径
cwd 当前工作路径

查看调试目标

观察寄存器
info reg


子函数返回地址
函数参数
局部变量

bt n 观察函数返回地址
frame n 切换栈帧
up n
down n
info frame [address]
info args
info locals

注意,切换栈帧之后可能会发生,本地变量值不准确,因为值存在寄存器中需要小心。

观察内存
print

p /f 表达式 表达式要打印位置
xduotcf

x

x /Nuf
N 打印几个单元
u 每个单元大小 b-1byte w-2byte h-4byte g-8byte

f s字符串i指令格式

x/s 0xfffff81946000 打印字符串

x /32bx arg bit 16禁制

(gdb) x /32bx &i
0x7fffffffc76c: 0x01 0x00 0x00 0x00 0x70 0x05 0x40 0x00
0x7fffffffc774: 0x00 0x00 0x00 0x00 0x40 0xfa 0xa2 0xf7
0x7fffffffc77c: 0xff 0x7f 0x00 0x00 0x58 0xc8 0xff 0xff
0x7fffffffc784: 0xff 0x7f 0x00 0x00 0x58 0xc8 0xff 0xff
(gdb)

p arg[0]
p arg[i]

p *&a[0]@10 a0数组开始的10个元素

反汇编

disas main main反汇编代码
x/5i schedule 这个地址开始的5条汇编指令。

gdb mov 从左往右赋值at&t汇编。

高级技巧

信号

  • info signals 异常/同步/中断

stop 要不要中断下来看
printf 打印信息
pass 要不要传递给应用程序。

  • handle 修改规则 handle signal act print noprint stop nostop pass nopass

handle SIGPIPE 不要中断下来,打印一个信息,网络程序常用

(gdb) handle SIGPIPE nostop
Signal Stop Print Pass to program Description
SIGPIPE No Yes Yes Broken pipe

Thread

info threads

LWP-light weight process 线程编号。
* gdb当前线程

切换当前线程

thread 2

打印所有线程

thread apply all bt 针对一群线程的命令避免切换来看。

线程改名字

thread name [name]

我自己经验 LWP 可以很好的观察线程负载情况。

posted @ 2017-05-24 14:18 小高 阅读(293) | 评论 (0)编辑 收藏
     摘要: 绘图控件重绘->其他操作->绘图控件重绘

进入了这样一个死循环,函数堆栈空间分配不足够.  阅读全文
posted @ 2017-04-18 10:32 小高 阅读(148) | 评论 (0)编辑 收藏
eclipse 配置遇到 object 找不到问题 ?
The type java.lang.object cannot be resolved - Eclipse buildpath not working

因为替换了 jvm版本.
解决办法: 
build->library -> add library->add jre library.


tomcat部署问题.?
1.清理 部署 重启.  
2.先删掉部署项目,可以重新配置config.

tomcat 找不到oracle 驱动程序?
Tomcat error: java.sql.SQLException: No suitable driver found for jdbc
catalina_home/lib 中已经放入了jar文件后还是报错.
请在 context.xml 中配置
 <WatchedResource>WEB-INF/web.xml</WatchedResource>
 <ResourceLink global="jdbc/oracle" name="jdbc/oracle" type="javax.sql.DataSource"/>
 
在 server.xml

       <Resource
        name="jdbc/oracle"
        auth="Container"
        type="javax.sql.DataSource"
        maxActive="100" maxIdle="30" maxWait="10000"
        driverClassName="oracle.jdbc.OracleDriver"
        url="jdbc:oracle:thin:@10.243.140.111:1521:test"
        username="core"
        password="core"/>

eclipse 项目属性, web deployment assembly设置   source: /webcontent   deploypath: / 


    
tomcat 开启gzip压缩
http://blog.csdn.net/hbcui1984/article/details/5666327



Setting property 'source' to 'org.eclipse.jst.jee.server 这个不是问题.

解决Setting property 'source' to 'org.eclipse.jst.jee.server的问题.
http://blog.csdn.net/foreversilent/article/details/11147847

posted @ 2017-03-09 10:02 小高 阅读(175) | 评论 (1)编辑 收藏
     摘要:   阅读全文
posted @ 2016-12-15 09:34 小高 阅读(472) | 评论 (0)编辑 收藏
     摘要: qt ubuntu 安装和中文  阅读全文
posted @ 2016-12-01 16:30 小高 阅读(311) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2016-05-13 15:59 小高 阅读(222) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-12-27 17:07 小高 阅读(472) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-12-15 15:57 小高 阅读(249) | 评论 (0)编辑 收藏
     摘要: 解决socket 太多问题.  阅读全文
posted @ 2015-12-10 10:39 小高 阅读(302) | 评论 (0)编辑 收藏

C面向对象编程汇集

参考资料:
Object-oriented Programming with ANSI-C
1993年,第一份c如何编写OO的资料,free.
OOC.PDF
https://www.cs.rit.edu/~ats/books/ooc.pdf

中文翻译:
https://code.google.com/p/ooc/downloads/detail?name=ooc-translate-preview-r26.pdf&can=2&q=

轻量级的C语言面向对象编程框架
http://sinojelly.blog.51cto.com/479153/281184

UML—OOPC嵌入式C语言开发精讲
里面有一套框架可以 c写OO.
http://pan.baidu.com/share/link?shareid=3402978666&uk=3188261067&adapt=pc&fr=ftw#path=%252FC%25E8%25AF%25AD%25E8%25A8%2580

你试过这样写C程序吗 --函数式编程
< >

我所偏爱的 C 语言面向对象编程范式--云风
http://blog.codingnow.com/2010/03/object_oriented_programming_in_c.html

C语言面向对象编程 -- 6篇专栏
http://blog.csdn.net/column/details/object-orient-c.html

posted @ 2015-11-24 23:32 小高 阅读(398) | 评论 (0)编辑 收藏

测试代码的locality。
数组的读区方式不同,按照行读,被cache也是按行连续加载的。
如果按照列读区,那么效率很低,除非cache足够大,而且也要遍历所有的数据,并且cache hash算法也好,实现的硬件还是多路组相联的cache硬件实现。

** valgrind --tool=cachegrind ./test2**

code1:

#include <stdio.h>
#define MAXROW 8000
#define MAXCOL 8000
int main () {
int i,j;
 static int x[MAXROW][MAXCOL];
 printf ("Starting!\n");
       for (i=0;i<MAXROW;i++)
       for (j=0;j<MAXCOL;j++)
              x[i][j] = i*j;
             printf("Completed!\n");
return 0;                                                    
 }

code2:

#include <stdio.h>                                                         
 #define MAXROW 8000
 #define MAXCOL 8000
 int main () {
 int i,j;
 static int x[MAXROW][MAXCOL];
 printf ("Starting!\n");
          for (j=0;j<MAXCOL;j++)
                         for (i=0;i<MAXROW;i++)
                 x[i][j] = i*j;
 printf("Completed!\n");
 return 0;
 }
 ```

##结果

Command: ./test1
Starting!
Completed!

I refs: 905,721,688
I1 misses: 4,177
LLi misses: 2,808
I1 miss rate: 0.00%
LLi miss rate: 0.00%

D refs: 514,830,867 (386,118,735 rd + 128,712,132 wr)
D1 misses: 4,025,828 ( 23,565 rd + 4,002,263 wr)
LLd misses: 4,008,456 ( 6,997 rd + 4,001,459 wr)

D1 miss rate: 0.8% ( 0.0% + 3.1% )
LLd miss rate: 0.8% ( 0.0% + 3.1% )

LL refs: 4,030,005 ( 27,742 rd + 4,002,263 wr)
LL misses: 4,011,264 ( 9,805 rd + 4,001,459 wr)
LL miss rate: 0.3% ( 0.0% + 3.1% )

gcc -o test2 test2.c
** valgrind --tool=cachegrind ./test2**

I refs: 905,720,801
I1 misses: 4,113
LLi misses: 2,811
I1 miss rate: 0.00%
LLi miss rate: 0.00%

D refs: 514,830,348 (386,118,427 rd + 128,711,921 wr)
D1 misses: 64,025,705 ( 23,462 rd + 64,002,243 wr)
LLd misses: 4,016,427 ( 6,977 rd + 4,009,450 wr)
D1 miss rate: 12.4% ( 0.0% + 49.7% )
LLd miss rate: 0.8% ( 0.0% + 3.1% )

LL refs: 64,029,818 ( 27,575 rd + 64,002,243 wr)
LL misses: 4,019,238 ( 9,788 rd + 4,009,450 wr)
LL miss rate: 0.3% ( 0.0% + 3.1% )

Starting!
Completed!
```

参考:

valgrind调试CPU缓存命中率和内存泄漏
http://laoxu.blog.51cto.com/4120547/1395236

posted @ 2015-11-15 22:20 小高 阅读(252) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-09-23 11:26 小高 阅读(220) | 评论 (0)编辑 收藏
     摘要: <未完成>
容错系统的研究.
豆瓣可以搜索几本书.  阅读全文
posted @ 2015-09-16 14:05 小高 阅读(222) | 评论 (0)编辑 收藏
     摘要: 未完成.  阅读全文
posted @ 2015-08-26 14:49 小高 阅读(286) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-08-26 14:41 小高 阅读(296) | 评论 (0)编辑 收藏
     摘要: 待学.  阅读全文
posted @ 2015-08-26 13:33 小高 阅读(301) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-08-26 10:53 小高 阅读(275) | 评论 (0)编辑 收藏
     摘要: wget https://raw.github.com/trapd00r/LS_COLORS/master/LS_COLORS -O $HOME/.dircolors
echo 'eval $(dircolors -b $HOME/.dircolors)' >> $HOME/.bashrc
. $HOME/.bashrc   阅读全文
posted @ 2015-08-25 16:26 小高 阅读(1783) | 评论 (0)编辑 收藏
     摘要: 未完成.  阅读全文
posted @ 2015-08-25 15:38 小高 阅读(229) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-08-25 13:42 小高 阅读(765) | 评论 (0)编辑 收藏
     摘要: typedef struct AA
{
AA * ptr;
}AA ;  阅读全文
posted @ 2015-08-24 13:57 小高 阅读(4445) | 评论 (0)编辑 收藏
     摘要: sysctl.conf  阅读全文
posted @ 2015-08-20 18:24 小高 阅读(312) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-08-13 10:10 小高 阅读(208) | 评论 (0)编辑 收藏
     摘要: 未完成.  阅读全文
posted @ 2015-08-02 12:12 小高 阅读(208) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-07-28 16:51 小高 阅读(235) | 评论 (0)编辑 收藏
     摘要: EXEC sp_configure 'remote query timeout', 0 ;
GO
RECONFIGURE ;
GO  阅读全文
posted @ 2015-07-28 13:54 小高 阅读(247) | 评论 (0)编辑 收藏
     摘要: ldd -r aa.so   阅读全文
posted @ 2015-07-26 18:08 小高 阅读(396) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-07-23 22:18 小高 阅读(278) | 评论 (0)编辑 收藏
     摘要: 未完成.  阅读全文
posted @ 2015-07-21 13:20 小高 阅读(215) | 评论 (0)编辑 收藏
     摘要: 1. 用户提交
2. 有1/3重做日志缓冲区未被写入磁盘
3. 有大于1M的重做日志缓冲区未被写入磁盘
4. 每隔3 秒钟
5. DBWR 需要写入的数据的SCN大于LGWR记录的SCN,DBWR 触发LGWR写入。   阅读全文
posted @ 2015-07-20 16:24 小高 阅读(825) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-07-19 23:11 小高 阅读(459) | 评论 (0)编辑 收藏
     摘要: 待完成.  阅读全文
posted @ 2015-07-19 23:00 小高 阅读(327) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-07-19 22:40 小高 阅读(460) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-07-19 16:26 小高 阅读(235) | 评论 (0)编辑 收藏
     摘要: time dd if=/dev/zero bs=1024 count=1000000 of=./1Gb.file
dd if=./1Gb.file bs=64k |dd of=/dev/null
dd if=./1Gb.file bs=1MB |dd of=/dev/null  阅读全文
posted @ 2015-07-19 12:12 小高 阅读(487) | 评论 (0)编辑 收藏
     摘要: mac为什么主机名.local
搞不清楚为什么.也许区分本地网络,进程间通讯优化? 为了程序方便 /ect/hosts 添加127.0.0.1 指向主机名.
sudo vim /etc/hosts   阅读全文
posted @ 2015-07-19 10:59 小高 阅读(860) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-07-17 23:12 小高 阅读(2219) | 评论 (0)编辑 收藏
     摘要: 未完成.  阅读全文
posted @ 2015-07-17 21:34 小高 阅读(257) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-07-12 10:49 小高 阅读(189) | 评论 (0)编辑 收藏
     摘要: 待完成.  阅读全文
posted @ 2015-07-12 09:27 小高 阅读(320) | 评论 (0)编辑 收藏
     摘要: 待完成.  阅读全文
posted @ 2015-07-12 00:32 小高 阅读(182) | 评论 (0)编辑 收藏
     摘要: 待完成.  阅读全文
posted @ 2015-07-12 00:27 小高 阅读(330) | 评论 (0)编辑 收藏
     摘要: 待完成  阅读全文
posted @ 2015-07-12 00:17 小高 阅读(321) | 评论 (0)编辑 收藏
     摘要: 待完成.  阅读全文
posted @ 2015-07-12 00:13 小高 阅读(180) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-07-10 16:45 小高 阅读(305) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-07-10 15:39 小高 阅读(205) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-07-07 09:53 小高 阅读(985) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-07-06 15:20 小高 阅读(197) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-07-06 15:13 小高 阅读(287) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-07-06 15:08 小高 阅读(234) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-07-06 14:39 小高 阅读(202) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-07-06 14:39 小高 阅读(149) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-07-06 14:36 小高 阅读(254) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-07-06 14:09 小高 阅读(466) | 评论 (0)编辑 收藏
     摘要: #ifdef WIN32
WSADATA wsa_data;
WSAStartup(0x0201, &wsa_data);
#endif  阅读全文
posted @ 2015-07-06 12:33 小高 阅读(843) | 评论 (0)编辑 收藏
     摘要: 待填坑.  阅读全文
posted @ 2015-07-01 13:52 小高 阅读(269) | 评论 (0)编辑 收藏
     摘要: 在windows上编译openssl 和 libevent.
libevent-2.0.22-stable
openssl-1.0.2c   阅读全文
posted @ 2015-07-01 10:36 小高 阅读(2544) | 评论 (0)编辑 收藏
libevent windows构建
warning LNK4098: 默认库“LIBCMT”与其他库的使用冲突
问题原因:
exe 是debug版本.
静态库是release版本.
编译libevent 
C:\dev\mylibevent\libevent-2.0.22-stable>nmake /f Makefile.nmake

原来的修改 relase 版本多线程静态库  CFLAGS=    /MT

编译的时候需要配置合适的线程库 

拷贝出一个Makefile_D.nmake  多线程debug静态库
CFLAGS= ....    /MTd

工程中链接对应的版本的lib文件.

参考: 

https://msdn.microsoft.com/zh-cn/library/vstudio/abx4dbyh(v=vs.110).aspx

http://www.cnblogs.com/luxiaoxun/p/3603399.html
http://zyan.cc/libevent_windows/

posted @ 2015-06-30 11:21 小高 阅读(465) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-06-30 10:05 小高 阅读(264) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-06-29 14:48 小高 阅读(240) | 评论 (0)编辑 收藏
     摘要: 高性能Linux服务器构建实战:运维监控、性能调优与集群应用

构建高可用Linux服务器 2  阅读全文
posted @ 2015-06-28 20:37 小高 阅读(224) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-06-23 14:42 小高 阅读(211) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-06-23 14:39 小高 阅读(359) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-06-22 22:23 小高 阅读(271) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-06-22 21:21 小高 阅读(309) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-06-22 15:21 小高 阅读(297) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-06-21 14:28 小高 阅读(221) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-06-21 12:15 小高 阅读(201) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-06-21 11:54 小高 阅读(237) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-06-19 18:03 小高 阅读(266) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-06-18 10:28 小高 阅读(545) | 评论 (0)编辑 收藏
     摘要: 1.网络io文件大小未定,作为类库的设计者.
小文件太多,不好.IO性能差.
单个文件太大,如果都用memorybuffer,内存占用会非常的大.
设计者考虑2边的灵活性.  阅读全文
posted @ 2015-06-17 21:12 小高 阅读(279) | 评论 (0)编辑 收藏
     摘要: 8.8.8.8
114.114.114.114
223.5.5.5
223.6.6.6  阅读全文
posted @ 2015-06-16 17:00 小高 阅读(222) | 评论 (0)编辑 收藏
     摘要: xee下载地址
https://code.google.com/p/xee/downloads/detail?name=Xee2.2.zip&can=1&q=
自己开了一个分支
https://github.com/gddg/xee   阅读全文
posted @ 2015-06-16 16:34 小高 阅读(985) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-06-08 14:41 小高 阅读(284) | 评论 (0)编辑 收藏
     摘要: 0.1000M 网络.
1.8口交换机
2.支持vlan
3.支持Qos
4.支持端口聚合.
Cisco SG200-08
5.POE 通过网线供电给USB CAM 功能.
  阅读全文
posted @ 2015-06-06 16:54 小高 阅读(296) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-05-29 18:16 小高 阅读(211) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-05-29 18:04 小高 阅读(204) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-05-20 17:21 小高 阅读(238) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-05-19 22:57 小高 阅读(297) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-05-15 15:51 小高 阅读(200) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-05-11 14:51 小高 阅读(233) | 评论 (0)编辑 收藏
Error running 'requirements_debian_libs_install gawk libreadline6-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 autoconf libgdbm-dev libncurses5-dev automake libtool',
showing last 15 lines of /home/gao/.rvm/log/1431136216_ruby-2.2.2/package_install_gawk_libreadline6-dev_libssl-dev_libyaml-dev_libsqlite3-dev_sqlite3_autoconf_libgdbm-dev_libncurses5-dev_automake_libtool.log
sudo:/var/lib/sudo 对非所有者可写(040777),模式应该为 0700
对不起,请重试。
正在读取软件包列表...
正在分析软件包的依赖关系树...
正在读取状态信息...
有一些软件包无法被安装。如果您用的是 unstable 发行版,这也许是
因为系统无法达到您要求的状态造成的。该版本中可能会有一些您需要的软件
包尚未被创建或是它们已被从新到(Incoming)目录移出。
下列信息可能会对解决问题有所帮助:
下列软件包有未满足的依赖关系:
 libssl-dev : 依赖: libssl1.0.0 (= 1.0.1f-1ubuntu2) 但是 1.0.1f-1ubuntu2.4 正要被安装
E: 无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系。
++ return 100
++ return 100

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
解决办法? 
posted @ 2015-05-09 09:53 小高 阅读(2262) | 评论 (0)编辑 收藏

Jumping Into C++ 完整英文版 
http://vdisk.weibo.com/s/lFnhClqHrmi
posted @ 2015-05-08 16:34 小高 阅读(230) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-05-08 10:47 小高 阅读(202) | 评论 (0)编辑 收藏
     摘要: http://askubuntu.com/questions/50704/sudo-error-is-mode-0777-should-be-0440
  阅读全文
posted @ 2015-05-07 22:48 小高 阅读(1364) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-05-07 22:35 小高 阅读(902) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-05-07 14:03 小高 阅读(207) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-05-07 14:01 小高 阅读(219) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-05-07 10:59 小高 阅读(366) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-05-06 07:50 小高 阅读(199) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-05-02 08:59 小高 阅读(239) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-05-01 22:43 小高 阅读(348) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-05-01 13:34 小高 阅读(955) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-04-28 13:27 小高 阅读(182) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-04-23 07:11 小高 阅读(650) | 评论 (0)编辑 收藏
     摘要: iconv -f gb2312 -t utf-8 20150422_0.log >>a.log  阅读全文
posted @ 2015-04-23 07:10 小高 阅读(244) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-04-20 18:00 小高 阅读(180) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-04-20 14:15 小高 阅读(367) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-04-15 16:17 小高 阅读(241) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-04-15 14:55 小高 阅读(290) | 评论 (0)编辑 收藏
     摘要: echo "IRB.conf[:PROMPT_MODE] = :DEFAULT" > ~/.irbrc

echo "IRB.conf[:PROMPT_MODE] = :SIMPLE" > ~/.irbrc  阅读全文
posted @ 2015-04-13 21:03 小高 阅读(171) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-04-12 21:58 小高 阅读(170) | 评论 (0)编辑 收藏
     摘要: 非常喜欢的一篇文章.介绍了execption c# 设计思路.  阅读全文
posted @ 2015-04-12 11:38 小高 阅读(192) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-04-11 22:46 小高 阅读(2348) | 评论 (0)编辑 收藏
     摘要: vim ~/.bash_profile
alias ls='ls -F'
alias cls='clear'
alias grep='grep --color=auto'
CLICOLOR="xterm-color"
LSCOLORS="gxfxcxdxcxegedabagacad"
export CLICOLOR LsCOLORS  阅读全文
posted @ 2015-04-11 22:28 小高 阅读(260) | 评论 (0)编辑 收藏
     摘要: 这个终端主题颜色配置很舒服.各种软件对应的主题都有.

http://ethanschoonover.com/solarized/files/solarized.zip  阅读全文
posted @ 2015-04-11 20:52 小高 阅读(602) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-04-11 15:30 小高 阅读(180) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-04-11 12:02 小高 阅读(228) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-04-10 18:25 小高 阅读(190) | 评论 (0)编辑 收藏
     摘要: 技术树概览

http://html5ify.com/fks/#index_内容贡献者

前端文摘:Web 开发模式演变历史和趋势
http://www.cnblogs.com/lhb25/p/web-development-mode-evolve.html

A brief history of web design for designers
http://blog.froont.com/brief-history-of-web-design-for-designers/  阅读全文
posted @ 2015-04-10 14:48 小高 阅读(214) | 评论 (0)编辑 收藏
     摘要: http://tonybai.com/2010/12/14/create-libraries-with-libtool/

使用 GNU Libtool 创建库
https://www.ibm.com/developerworks/cn/aix/library/1007_wuxh_libtool/  阅读全文
posted @ 2015-04-10 14:19 小高 阅读(240) | 评论 (0)编辑 收藏
     摘要: Git Community Book 中文版
http://gitbook.liuhui998.com/1_1.html

台湾ihower写的
https://ihower.tw/git/  阅读全文
posted @ 2015-04-09 21:36 小高 阅读(208) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-04-09 17:46 小高 阅读(247) | 评论 (0)编辑 收藏
     摘要: 七周七并发模型  阅读全文
posted @ 2015-04-09 17:41 小高 阅读(197) | 评论 (0)编辑 收藏
     摘要: Ruby on Rails 實戰聖經
https://ihower.tw/rails4/

笨方法學 Ruby
http://lrthw.github.io/  阅读全文
posted @ 2015-04-09 10:14 小高 阅读(213) | 评论 (0)编辑 收藏
     摘要: brew install coreutils
gun tools 替换掉osx
PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
MANPATH="/usr/local/opt/coreutils/libexec/gnuman:$MANPATH"  阅读全文
posted @ 2015-04-04 17:33 小高 阅读(423) | 评论 (0)编辑 收藏
     摘要: 下载key替换工具 karabiner
control_L to command_L
option_R to delete
FN 键盘+F1 F2 如果你想替换成直接按F1就调用的话,可以macosx 键盘里面找到。发现FN键盘无法移到别的键上。
目前还没看出来mac上option,control 键的原生用途。
键程和windows很不一样。  阅读全文
posted @ 2015-04-04 11:24 小高 阅读(600) | 评论 (0)编辑 收藏
     摘要: brew install libtool
brew install autoconf
brew install automake
glibtool --help
sh autogen.sh
./configure
make
make check  阅读全文
posted @ 2015-03-26 20:35 小高 阅读(1677) | 评论 (0)编辑 收藏
     摘要: cobertura   阅读全文
posted @ 2015-03-26 10:27 小高 阅读(1419) | 评论 (0)编辑 收藏
     摘要: Docroot is: /usr/local/var/www
/usr/local/etc/nginx/nginx.conf to 8080
ln -sfv /usr/local/opt/nginx/*.plist ~/Library/LaunchAgents
nginx  阅读全文
posted @ 2015-03-22 22:09 小高 阅读(209) | 评论 (0)编辑 收藏
     摘要: brew install ??   阅读全文
posted @ 2015-03-22 21:55 小高 阅读(187) | 评论 (0)编辑 收藏
     摘要: chmod -R 777 /usr/local/
GMac:~ XXXX$ brew install cmake  阅读全文
posted @ 2015-03-22 11:36 小高 阅读(5369) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-03-22 10:21 小高 阅读(218) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-03-21 23:16 小高 阅读(390) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-03-21 23:11 小高 阅读(261) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-03-21 23:07 小高 阅读(420) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-03-21 22:22 小高 阅读(392) | 评论 (0)编辑 收藏
     摘要: pmset -g
sudo pmset -a hibernatemode 3  阅读全文
posted @ 2015-03-21 22:18 小高 阅读(411) | 评论 (0)编辑 收藏
     摘要: Go to System Preferences -> Keyboard -> Keyboard tab -> Modifier keys
Swap the Control and Cmd keys  阅读全文
posted @ 2015-03-21 21:58 小高 阅读(420) | 评论 (0)编辑 收藏
     摘要: 目前知名的mq :
zeromq -- c++ 实现
ActiveMQ
JMS -- java的消息服务,j2ee 各家实现不同
MS Queue --
RabbitMQ
nanomsg
lightq  阅读全文
posted @ 2015-03-20 23:02 小高 阅读(734) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-03-20 09:39 小高 阅读(1895) | 评论 (0)编辑 收藏
     摘要: Sublime Text 2
安装插件:
https://gitcafe.com/ghosTM55/sublime-config  阅读全文
posted @ 2015-03-19 16:41 小高 阅读(174) | 评论 (0)编辑 收藏

1.vc  编译

V52$HM2(%G~9EQ7}NBWF%[5

头文件

#include <omp.h

omp_set_num_threads(threadNumber);
#pragma omp parallel default(shared) private(i,riskId) 
    {
#pragma  omp for   

}

}

 

GCC配置

1. 编译

-fopenmp
设定线程数量 export OMP_NUM_THREADS=6
 
 
 
参考

通过 GCC 学习 OpenMP 框架

http://www.ibm.com/developerworks/cn/aix/library/au-aix-openmp-framework/
 
posted @ 2015-03-19 16:31 小高 阅读(310) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-03-18 17:18 小高 阅读(176) | 评论 (0)编辑 收藏
     摘要: SQLnet.ora
DIAG_ADR_ENABLED=OFF
DIAG_SIGHANDLER_ENABLED=FALSE
DIAG_DDE_ENABLED=FALSE
  阅读全文
posted @ 2015-03-18 17:16 小高 阅读(534) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-03-16 18:37 小高 阅读(166) | 评论 (0)编辑 收藏
     摘要: 总结一些看法  阅读全文
posted @ 2015-03-15 13:07 小高 阅读(246) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-03-12 14:07 小高 阅读(269) | 评论 (0)编辑 收藏
     摘要: 待总结  阅读全文
posted @ 2015-03-12 13:55 小高 阅读(196) | 评论 (0)编辑 收藏
     摘要: 1.ms sql 的配置

安装了 sql- server2005 express ,安装默认会关闭网络连接的等.需要打开ip:1433端口.

账户密码需要使用,ms sql–server 登录登录.

2.sqlapi 的使用.

正确的sqlapi ++ ms sql server 串
char * dbname = "127.0.0.1\\SQL2005EXPRESS@master";
  阅读全文
posted @ 2015-03-10 17:19 小高 阅读(1029) | 评论 (0)编辑 收藏
     摘要: typedef unsigned short WORD;
#define WORD unsigned short
冲突
解决办法:
1.因为2个头文件来自不同项目. 修改源文件彻底解决掉这个问题.
2.先后引用位置 .
3.隐藏不必要的 .h文件,只有需要cpp才添加h引用.这样防止不必要的引用.  阅读全文
posted @ 2015-02-26 18:20 小高 阅读(2087) | 评论 (0)编辑 收藏
代码分支预判断
http://stackoverflow.com/questions/11227809/why-is-processing-a-sorted-array-faster-than-an-unsorted-array
给出了2段代码c和java:
1.随机数插入数组中。
2.sum统计相加 。

c 结果不sort 需要21秒,排序后7秒。
java  5秒。
问题在哪里? 



分支预测资料: 

Hidden Features and Dark Corners of C++/STL 

http://comp.lang.cpp.moderated.narkive.com/oZn86c9y/hidden-features-and-dark-corners-of-c-stl
http://en.wikipedia.org/wiki/Branch_predictor

http://zh.wikipedia.org/wiki/%E5%88%86%E6%94%AF%E9%A0%90%E6%B8%AC%E5%99%A8

 



posted @ 2015-02-24 21:13 小高 阅读(192) | 评论 (0)编辑 收藏
     摘要: 关闭oracle api 异常侦测 sqlnet.ora

DIAG_ADR_ENABLED=FALSE
DIAG_DDE_ENABLED=FALSE
DIAG_SIGHANDLER_ENABLED=FALSE
DIAG_RESTRICTED=FALSE
  阅读全文
posted @ 2015-02-05 16:28 小高 阅读(477) | 评论 (0)编辑 收藏

打开root 用户 

http://www.macx.cn/thread-2051799-1-1.html  
http://support.apple.com/zh-cn/HT1528

太难找了,竟然在菜单里,打开root 。 

su root 
whoami

sudo su
密码不对

Mac OS X:sudo 命令需要非空的管理员密码





posted @ 2015-01-31 13:14 小高 阅读(253) | 评论 (1)编辑 收藏
c# oledb odbc  foxpro driver win 64 驱动不兼容. 
解决办法:
c#工程里面选择 x86. 
安装foxpro odbc驱动.  
posted @ 2015-01-30 14:37 小高 阅读(199) | 评论 (0)编辑 收藏

导航

<2015年1月>
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567

统计

常用链接

留言簿(3)

随笔分类(352)

收藏夹(19)

关注的blog

手册

搜索

积分与排名

最新评论

阅读排行榜

评论排行榜