JUST DO IT ~

我只想当个程序员

2008年9月18日

     摘要: 检查宏定义
WIN32
_DEBUG
_WINDOWS
_USRDLL  阅读全文
posted @ 2017-08-16 10:43 小高 阅读(360) | 评论 (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 小高 阅读(294) | 评论 (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 小高 阅读(473) | 评论 (0)编辑 收藏
     摘要: qt ubuntu 安装和中文  阅读全文
posted @ 2016-12-01 16:30 小高 阅读(312) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2016-05-13 15:59 小高 阅读(223) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-12-27 17:07 小高 阅读(472) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-12-15 15:57 小高 阅读(249) | 评论 (0)编辑 收藏
     摘要: 解决socket 太多问题.  阅读全文
posted @ 2015-12-10 10:39 小高 阅读(303) | 评论 (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 小高 阅读(399) | 评论 (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 小高 阅读(253) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-09-23 11:26 小高 阅读(221) | 评论 (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 小高 阅读(302) | 评论 (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 小高 阅读(1784) | 评论 (0)编辑 收藏
     摘要: 未完成.  阅读全文
posted @ 2015-08-25 15:38 小高 阅读(229) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-08-25 13:42 小高 阅读(767) | 评论 (0)编辑 收藏
     摘要: typedef struct AA
{
AA * ptr;
}AA ;  阅读全文
posted @ 2015-08-24 13:57 小高 阅读(4455) | 评论 (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 小高 阅读(209) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-07-28 16:51 小高 阅读(236) | 评论 (0)编辑 收藏
     摘要: EXEC sp_configure 'remote query timeout', 0 ;
GO
RECONFIGURE ;
GO  阅读全文
posted @ 2015-07-28 13:54 小高 阅读(249) | 评论 (0)编辑 收藏
     摘要: ldd -r aa.so   阅读全文
posted @ 2015-07-26 18:08 小高 阅读(396) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-07-23 22:18 小高 阅读(279) | 评论 (0)编辑 收藏
     摘要: 未完成.  阅读全文
posted @ 2015-07-21 13:20 小高 阅读(216) | 评论 (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 小高 阅读(461) | 评论 (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 小高 阅读(863) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-07-17 23:12 小高 阅读(2223) | 评论 (0)编辑 收藏
     摘要: 未完成.  阅读全文
posted @ 2015-07-17 21:34 小高 阅读(258) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-07-12 10:49 小高 阅读(190) | 评论 (0)编辑 收藏
     摘要: 待完成.  阅读全文
posted @ 2015-07-12 09:27 小高 阅读(321) | 评论 (0)编辑 收藏
     摘要: 待完成.  阅读全文
posted @ 2015-07-12 00:32 小高 阅读(183) | 评论 (0)编辑 收藏
     摘要: 待完成.  阅读全文
posted @ 2015-07-12 00:27 小高 阅读(330) | 评论 (0)编辑 收藏
     摘要: 待完成  阅读全文
posted @ 2015-07-12 00:17 小高 阅读(322) | 评论 (0)编辑 收藏
     摘要: 待完成.  阅读全文
posted @ 2015-07-12 00:13 小高 阅读(180) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-07-10 16:45 小高 阅读(307) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-07-10 15:39 小高 阅读(205) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-07-07 09:53 小高 阅读(985) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-07-06 15:20 小高 阅读(198) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-07-06 15:13 小高 阅读(288) | 评论 (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 小高 阅读(467) | 评论 (0)编辑 收藏
     摘要: #ifdef WIN32
WSADATA wsa_data;
WSAStartup(0x0201, &wsa_data);
#endif  阅读全文
posted @ 2015-07-06 12:33 小高 阅读(846) | 评论 (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 小高 阅读(466) | 评论 (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 小高 阅读(225) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-06-23 14:42 小高 阅读(211) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-06-23 14:39 小高 阅读(360) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-06-22 22:23 小高 阅读(273) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-06-22 21:21 小高 阅读(310) | 评论 (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 小高 阅读(267) | 评论 (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 小高 阅读(990) | 评论 (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 小高 阅读(297) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-05-29 18:16 小高 阅读(212) | 评论 (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 小高 阅读(234) | 评论 (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 小高 阅读(2264) | 评论 (0)编辑 收藏

Jumping Into C++ 完整英文版 
http://vdisk.weibo.com/s/lFnhClqHrmi
posted @ 2015-05-08 16:34 小高 阅读(230) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-05-08 10:47 小高 阅读(203) | 评论 (0)编辑 收藏
     摘要: http://askubuntu.com/questions/50704/sudo-error-is-mode-0777-should-be-0440
  阅读全文
posted @ 2015-05-07 22:48 小高 阅读(1369) | 评论 (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 小高 阅读(368) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-05-06 07:50 小高 阅读(201) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-05-02 08:59 小高 阅读(241) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-05-01 22:43 小高 阅读(349) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-05-01 13:34 小高 阅读(957) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-04-28 13:27 小高 阅读(182) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-04-23 07:11 小高 阅读(652) | 评论 (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 小高 阅读(172) | 评论 (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 小高 阅读(2349) | 评论 (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 小高 阅读(261) | 评论 (0)编辑 收藏
     摘要: 这个终端主题颜色配置很舒服.各种软件对应的主题都有.

http://ethanschoonover.com/solarized/files/solarized.zip  阅读全文
posted @ 2015-04-11 20:52 小高 阅读(602) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-04-11 15:30 小高 阅读(181) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-04-11 12:02 小高 阅读(229) | 评论 (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 小高 阅读(248) | 评论 (0)编辑 收藏
     摘要: 七周七并发模型  阅读全文
posted @ 2015-04-09 17:41 小高 阅读(198) | 评论 (0)编辑 收藏
     摘要: Ruby on Rails 實戰聖經
https://ihower.tw/rails4/

笨方法學 Ruby
http://lrthw.github.io/  阅读全文
posted @ 2015-04-09 10:14 小高 阅读(215) | 评论 (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 小高 阅读(424) | 评论 (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 小高 阅读(1678) | 评论 (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 小高 阅读(210) | 评论 (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 小高 阅读(5371) | 评论 (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 小高 阅读(393) | 评论 (0)编辑 收藏
     摘要: pmset -g
sudo pmset -a hibernatemode 3  阅读全文
posted @ 2015-03-21 22:18 小高 阅读(413) | 评论 (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 小高 阅读(1896) | 评论 (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 小高 阅读(537) | 评论 (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 小高 阅读(1031) | 评论 (0)编辑 收藏
     摘要: typedef unsigned short WORD;
#define WORD unsigned short
冲突
解决办法:
1.因为2个头文件来自不同项目. 修改源文件彻底解决掉这个问题.
2.先后引用位置 .
3.隐藏不必要的 .h文件,只有需要cpp才添加h引用.这样防止不必要的引用.  阅读全文
posted @ 2015-02-26 18:20 小高 阅读(2105) | 评论 (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)编辑 收藏

Intellij IDEA和Android Studio默认使用JDK6,所以你有如下选择:

1,安装JDK6

2,安装其他版本的JDK,然后修改IDE的指向。

如果选择2,那么修改方式为:

打开应用的.app包,然后在Contents这个目录下,有个文件info.plist,修改JVMVersion这个key对应的value,从1.6*修改为你安装的版本即可。


1 用文本编辑器打开
/Applications/IntelliJ IDEA 13.app/Contents/Info.plist

2 搜索JVMVersion,将其值改为1.7*

3 再次运行应用即可看到应用成功运行

from :
http://www.zhihu.com/question/26086376


posted @ 2015-01-29 23:02 小高 阅读(417) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-01-05 10:43 小高 阅读(177) | 评论 (0)编辑 收藏
     摘要: 分析表空间
execute dbms_stats.gather_schema_stats('CORE');   阅读全文
posted @ 2015-01-04 18:03 小高 阅读(239) | 评论 (0)编辑 收藏
     摘要: 1.种方法
#define WIN32_LEAN_AND_MEAN
放在windows.h 之前.

2. 先引入socket2.h文件.

3. 项目 -> 属性 -> C/C++ -> 预处理器 -> 预处理器定义
在其中添加 : WIN32_LEAN_AND_MEAN  阅读全文
posted @ 2015-01-04 15:16 小高 阅读(900) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2015-01-01 21:08 小高 阅读(509) | 评论 (0)编辑 收藏
     摘要: 中间件  阅读全文
posted @ 2015-01-01 17:31 小高 阅读(242) | 评论 (0)编辑 收藏

linux DNS 设置 

sudo vim /etc/resolv.conf

http://www.alidns.com/setup/#linux

wget http://www.alidns.com/static/soft/SetAliDNS.sh -O SetAliDNS.sh && chmod +x SetAliDNS.sh && sudo ./SetAliDNS.sh

卸载

sudo ./SetAliDNS.sh restore



键盘修改 

xmodmap -e  "keycode 105=Delete"



posted @ 2015-01-01 13:39 小高 阅读(167) | 评论 (0)编辑 收藏

 

 

API对设计流程的影响——Joshua Bloch访谈

http://blog.sina.com.cn/s/blog_6310e0b20100o7cv.html 

 

工程师Joshua Bloch谈如何设计一款优秀的API【附PPT】

http://www.csdn.net/article/2014-02-18/2818441-How-to-design-a-good-API

 
《Effective Java》: Joshua Bloch访谈

http://eastsun.iteye.com/blog/195861

posted @ 2014-12-19 13:23 小高 阅读(208) | 评论 (0)编辑 收藏

 

The Java™ Tutorials

http://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html

 

1.5

New Features and Enhancements J2SE 5.0

http://docs.oracle.com/javase/1.5.0/docs/relnotes/features.html

Experiences with the New Java 5 Language Features

Pages: 1, 2, 3, 4

 

1.6

Highlights of Technology Changes in Java SE 6

http://www.oracle.com/technetwork/java/javase/features-141434.html

 

1.7

Highlights of Technology Changes in Java SE 7

http://www.oracle.com/technetwork/java/javase/jdk7-relnotes-418459.html

 

http://www.javacodegeeks.com/2014/05/java-8-features-tutorial.html

posted @ 2014-12-17 17:19 小高 阅读(239) | 评论 (0)编辑 收藏

学习步骤
1.c 
2.c object 
3. stl
4. linux os api
5. socket  
6. 分布式
7. web html5 
8. mac UI  
9. obj c
10.算法。


一些想法:
微博上关注的人很多淘宝系的很多都不搞技术了,原因是阿里上市了,足够的钱退休了,还有些人离职去创业了,
可能氛围比较好,看来创业的都有滋有味。大规模的系统搞过了,心里有底气了,知道方向,估计成功率也会比较高。
一些人技术人靠知乎刷存在感,靠名气说话 。
一些2流技术角色投稿文章csdn,写专题blog。很多毫无营养。
国内的技术书,还是一如既往类似官方教程的翻译版。

 

blog

http://preshing.com/ 

 

Jeff Atwood 大stackoverflo

http://blog.codinghorror.com/

https://github.com/coding-horror

 

陈皓

http://coolshell.cn/ 

 

云风

http://blog.codingnow.com/ 

 

何_登成

http://weibo.com/2216172320/BcUmvbyvW?type=repost#_rnd1418722416088

 

http://ifeve.com/

 

http://www.importnew.com/14105.html

 

网络教学:

http://www.codecademy.com/

 

PLSQL

http://plsql-tutorial.com/plsql-functions.htm

posted @ 2014-12-17 10:55 小高 阅读(265) | 评论 (0)编辑 收藏

 

先确保执行这个. win7 以上才支持 WER windows error report 功能 .

windows 弹出提示框, 然后进程管理器,右键手工导出也行.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps]
"DumpFolder"="c:\\"
"DumpCount"=dword:00000030
"DumpType"=dword:00000002
"CustomDumpFlags"=dword:00000000

c++ debug版本 + pdb文件

另外需要注意不是所有情况都生成core.

windows 改了注册表不生成core的原因:

Requirements and limitations

· Debugging dump files of optimized code can be confusing. For example, compiler inlining of functions can result in unexpected call stacks and other optimizations might change the lifetime of variables.

· Dump files from 64-bit machines must be debugged on an instance of Visual Studio that is running on a 64-bit computer.

· In versions of Visual Studio before VS 2013, dumps of 32-bit apps that were run on 64-bit machines that were collected by some tools (such as Task Manager and 64-bit WinDbg) could not be opened in Visual Studio. This limitation has been removed in VS 2013.

· Visual Studio can debug dump files of native apps from ARM devices. Visual Studio can also debug apps dump files of managed apps from ARM devices, but only in the native debugger.

· To debug kernel-mode dump files in Visual Studio 2013, download the Windows 8.1 Version of Debugging Tools for Windows. See Kernel Debugging in Visual Studio.

· Visual Studio can't debug dump files saved in the older dump format known as a full user-mode dump. Note that a full user-mode dump is not the same a dump with heap.

· To debug with the SOS.dll (SOS Debugging Extension) in Visual Studio, you must install the Debugging Tools for Windows that is part of the Windows Driver Kit (WDK). See Windows 8.1 Preview: Download kits, bits, and tools.

 

参考:

Collecting User-Mode Dumps   --注册表

http://msdn.microsoft.com/en-us/library/windows/desktop/bb787181(v=vs.85).aspx

 

Crash Dump Analysis  --- c++ 自己生成dump

http://msdn.microsoft.com/en-us/library/windows/desktop/ee416349(v=vs.85).aspx 

 

Use Dump Files to Debug App Crashes and Hangs in Visual Studio

http://msdn.microsoft.com/en-us/library/d5zhxt22.aspx#bkmk_requirements_and_limitations

 

Attach to Running Processes with the Visual Studio Debugger

http://msdn.microsoft.com/en-us/library/3s68z0b3.aspx

Just-In-Time Debugging in Visual Studio  ------- 还没看

http://msdn.microsoft.com/en-us/library/5hs4b7a6.aspx

posted @ 2014-12-17 10:44 小高 阅读(634) | 评论 (0)编辑 收藏

The Discipline and Method Architecture for Reusable Libraries (2000)



Citations

1489The C++ Programming Language - Stroustrup - 1991
1437Object-Oriented Software Construction - Meyer - 1997
861Design Patterns - Gamma, Helm, et al. - 1995
303Purify: Fast detection of memory leaks and access errors - Hastings, Joyce - 1991
232Rational design process: how and why to fake it - Parnas, Clements - 1986
118The Art of Computer Programming, Volume 1 - Knuth - 1998
89Scalable software libraries - Batory, Singhal, et al. - 1993
67The Library Scaling Problem and the Limits of Concrete Component Reuse - Biggerstaff - 1994
57Algorithm-oriented generic libraries - Musser, Stepanov - 1994
47Vmalloc: A general and efficient memory allocator - Vo - 1996
37Algorithms, 2nd edition - Sedgewick - 1988
30An Empirical Study of Delta Algorithms - Hunt, Vo, et al. - 1996
27Empirical measurements of six allocation-intensive C programs - Zorn, Grunwald - 1992
19Porting Unix to Windows NT - Korn
19Xept: A software instrumentation method for exception handling - Vo, Wang, et al. - 1997


18Worst case fragmentation of first fit and best fit storage allocation strategies - Robson - 1977
17libg++, the GNU C++ library - Lea - 1988
13On the external storage fragmentation produced by first-fit and best-fit allocation strategies - Shore - 1975
11C Interfaces and Implementation - Hanson - 1997
10National Standard for Information Systems { Programming Language C. Technical Report X3J11/89{159, ANSI Accredited Standards Committee, X3 Information Processing Systems - American - 1989
9Ksh - an extensible high level language - Korn - 1994
7Associative arrays - Koenig - 1988
5CDT: A Container Data Type Library - Vo - 1997
5Making a vector Fit for a Standard - Stroustrup - 1994
4Vdelta: Differencing and Compression - Korn, Vo - 1995
4Kiem-Phong Vo. Principles for Writing Reusable Library - Fowler, Korn - 1995
3Practical Reusable Unix Software - Krisnamurthy - 1995
2Negotiated Interfaces for Software Reuse - Clements, Parnas, et al. - 1992
1Concrete software libraries - Vo - 1998
1Sfio: A Buffered I/O Library. Software---Practice and Experience - Fowler, Korn, et al. - 199




posted @ 2014-08-26 13:36 小高 阅读(398) | 评论 (1)编辑 收藏


#include <sys/stat.h>
long file_length(char *f)
{
    struct stat st;
    stat(f, &st);
    return st.st_size;
}


If you have the file stream (FILE * f):
fseek(f, 0, SEEK_END); // seek to end of file
size = ftell(f); // get current file pointer
fseek(f, 0, SEEK_SET); // seek back to beginning of file
// proceed with allocating memory and reading the file
Or,
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
fd = fileno(f); 
struct stat buf;
fstat(fd, &buf);
int size = buf.st_size;
Or, use stat, if you know the filename:
#include <sys/stat.h>
struct stat st;
stat(filename, &st);
size = st.st_size;
posted @ 2014-08-08 16:00 小高| 编辑 收藏

 

 

relocation error: multiget: symbol _Z23wxHandleFatalExceptionsb, version WXU_2.8 not defined in file libwx_baseu-2.8.so.0

 

下载地址:

http://www.codeblocks.org/downloads/26 

http://sourceforge.net/projects/codeblocks/files/Binaries/13.12-RC1/Linux%20(64bit)/

codeblocks-13.12-1.el5.x86_64.tar.bz2

 

安装的关键

Note: On RedHat/CentOS 5 and older revisions of 6 (up to 6.2 as far as I know) you need to add repoforge (former rpmforge) to your repolist, to be able to install the needed wxGTK-package. Seehttp://repoforge.org/use for an instruction.

 

更新yum的源 很重要

http://repoforge.org/use/  下载对应的rpm

cat /etc/redhat-release

uname –a

 

wget http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm

rpm -ivh package-filename

 

# yum install gcc
# yum install gcc-c++
如果之前失败过  yum erase wxGTK
# yum install wxGTK
 
然后
 ]# ls
codeblocks-12.11-1.el6.i686.rpm
codeblocks-contrib-12.11-1.el6.i686.rpm
codeblocks-contrib-devel-12.11-1.el6.i686.rpm
codeblocks-devel-12.11-1.el6.i686.rpm
# rpm -ivh codeblocks*
 

1. 下载repo文件
    下载地址:http://mirrors.163.com/.help/CentOS6-Base-163.repo

2. 备份并替换系统的repo文件
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost ~]# mv CentOS-Base.repo CentOS-Base.repo.bak
[root@localhost ~]# mv /root/CentOS6-Base-163.repo CentOS-Base.repo

3. 执行yum源更新
[root@localhost ~]# yum clean all
[root@localhost ~]# yum makecache
[root@localhost ~]# yum update

 

yum install gcc gcc-g++ autoconfig automake 
 
 
参考:
http://blog.csdn.net/dupei/article/details/6428346
 
http://www.cnblogs.com/magialmoon/archive/2013/05/05/3061108.html
 
 
 
 
posted @ 2014-07-19 12:17 小高 阅读(228) | 评论 (0)编辑 收藏

sqlplus 外面执行正常.

tomcat调用老有问题.多调用几次久正常.

 

可能是包中的全局变量引起的.

 

 

If so, that's because your package is stateful:

The values of the variables, constants, and cursors that a package declares (in either its specification or body) comprise its package state. If a PL/SQL package declares at least one variable, constant, or cursor, then the package is stateful; otherwise, it is stateless.

When you recompile the state is lost:

If the body of an instantiated, stateful package is recompiled (either explicitly, with the "ALTER PACKAGE Statement", or implicitly), the next invocation of a subprogram in the package causes Oracle Database to discard the existing package state and raise the exception ORA-04068.

After PL/SQL raises the exception, a reference to the package causes Oracle Database to re-instantiate the package, which re-initializes it...

You can't avoid this if your package has state. I think it's fairly rare to really need a package to be stateful though, so you should revisit anything you have declared in the package, but outside a function or procedure, to see if it's really needed at that level. Since you're on 10g though, that includes constants, not just variables and cursors.

But the last paragraph from the quoted documentation means that the next time you reference the package in the same session, you won't get the error and it will work as normal (until you recompile again).

 

existing state of packages has been discarded means, that your Package had some sort of state.

This is caused by a global variable (or constant) stored in your Package Body.

Since the package has already been used in your session, Oracle assumes that this state is relevant for you. Some of these variables might have different values now, and when you recompile the Body, the values are reset.

This exception is thrown, so that your clients know that they can't rely on those variables any more.

You could try to remove all global variables and constants from the Package Body, or close your session and reconnect before calling the package again.

 

 

参考:

http://stackoverflow.com/questions/2502722/pl-sql-package-invalidated

 

http://stackoverflow.com/questions/19376440/ora-06508-pl-sql-could-not-find-program-unit-being-called

posted @ 2014-07-16 21:14 小高 阅读(1621) | 评论 (0)编辑 收藏

监听器配置少了.

lsnrctl

 

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = XE )
      (ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
      (SID_NAME =XE )
    )
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
      (PROGRAM = extproc)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
    )
  )

DEFAULT_SERVICE_LISTENER = (XE)

posted @ 2014-07-11 10:07 小高 阅读(298) | 评论 (0)编辑 收藏

 

1.安装 vnc-server

找包

http://www.rpmfind.net/linux/rpm2html/search.php?query=libtermcap&submit=Search+...&system=centos&arch=

如果window

 

vncserver :1

输入密码

vnc登录后

xhost +

解决display问题.

vncserver -kill :1

 

vnc 如果进入以后3个 提示选择 allow clipboard  .

修改/root/.vnc/xstartup文件,把最后一行 twm& 修改成"startkde &" 或者"gnome-session &"

不然的话连接linux时只出现了一个终端编辑器窗口。

 

exec gnome-session &

 

 

 

 

 

oracle 安装

http://blog.itpub.net/7719012/viewspace-1139996

http://lowendtalk.com/discussion/5396/how-to-install-vnc-on-centos

 

 

二:使用Xmanager实现xhost挂接图形

http://hi.baidu.com/hanyanlovejoy/item/564ed582accef0efe496e017

posted @ 2014-07-10 12:53 小高 阅读(147) | 评论 (0)编辑 收藏

删除

:g/.*ABC/m

:g/kernel32/d

:[range]g[lobal]/{pattern}/[cmd] :help :g

vim 查找一个文章段落, 开头字符 结尾字符

/.*#tag1\(.\+\n\+\)\{-}#tag2.*

 

删除掉 :

g/.*#tag1\(.\+\n\)\{-}#tag2.*/d

这句话\(.\+\n\+\) 采用分组

.\+  .任意字符 + 一个或多个

\n\+  回车  一个或多个

\+1 或更多

\{-} 0 或更多尽可能少. 任意字符

\n 换行符

为什么  /This\_.*text/ 不可以,因为\_. 是全缓冲区匹配模式的.

 

概念分组、捕获

http://i.linuxtoy.org/docs/guide/ch26s08.html#id3120909

abc123.456.def

\d{3}表示三个数字,(\d{3}\.)表示三个数字加“.”为一组,{2}表示这一组内容重复两次

 

 

 

参考:

http://vimcdoc.sourceforge.net/doc/pattern.html#search-pattern

^\(.\+\n\)\{-}#.*tag1

http://stackoverflow.com/questions/10076834/multi-line-regex-in-vim-filtering-out-blocks-of-text-in-a-file

Vim 中删除符合条件的行

http://timothyqiu.com/archives/delete-lines-matching-pattern-in-vim/ https://github.com/railsinstaller/railsinstaller-windows/releases

posted @ 2014-06-25 14:24 小高 阅读(175) | 评论 (0)编辑 收藏

 

源码

https://github.com/embedthis/goahead/blob/master/src/utils/gopass.c

goAhead 2.5嵌入式web服务器移植到arm9 2440 + linux中

http://blog.csdn.net/reille/article/details/6784809

goAhead上实现文件上传到嵌入式web服务器上

http://www.xuebuyuan.com/625754.html

 

3. 资料

3.1 http://blog.csdn.net/reille/article/details/6871827 本博客转载的文章

3.2
http://www.hackchina.com/r/57970/v2.1.1-_-web-_-upload.htm__html
   前端实现参考

3.3

http://www.hackchina.com/r/57970/v2.1.1-_-LINUX-_-upldForm.c__html 服务器端实现参考

posted @ 2014-06-20 11:01 小高 阅读(230) | 评论 (0)编辑 收藏

 

RiskUnit0001.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
obj/Debug/src/RiskUnit0001/RiskUnit0001.o: could not read symbols: Bad value

 

为什么需要

 

解决办法编译器已经提示了:recompile with -fPIC
但是我们应该重新编译谁带上这个参数呢?经过我几番折腾,发现如下情况:
1、编译.o文件的时候,没有加参数-fPIC,这问题个在gcc version 3.4.6版本没有发生,可能那个编译器默认都给加上吧。
2、当前程序中有用到某个静态库,那个静态库编译.o文件的时候没有加上-fPIC(静态库其实就是.o文件打包)。补充一点:我发现手写Makefile时即使不加-fPIC也没有这个问题,这一点很郁闷,这个只在用automake工具编译出.a文件时才出现过。
知道原因了,解决办法自然有了,保证你编译.o文件的时候,都加上-fPIC,这样你才能编译出动态库来。

 

引用

http://hi.baidu.com/duizhe_memory/item/c4ccbb0831a5998d3d42e212

posted @ 2014-04-18 11:15 小高 阅读(322) | 评论 (0)编辑 收藏

 

 

sqlplus "core/core@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=192.168.75.1)(Port=1521))(CONNECT_DATA=(SID=itmp)))"


sqlplus core/core@192.168.75.1:1521/itmp

 

参考一个 :

 

 

/***
*    ORACLE客户端liunx安装部署说明
*
*/

配置步骤:

1,将本文件夹拷贝到相应的服务器上。
2,配置环境变量如下: 文件夹所在路径(/kfts/tools/oracle)
(永久修改方式)
vi /etc/profile
在文件最后添加:
export LD_LIBRARY_PATH=/kfts/tools/oracle:$LD_LIBRARY_PATH
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export ORACLE_HOME=/kfts/tools/oracle/
export PATH=/kfts/tools/oracle/:$PATH
export TNS_ADMIN=/kfts/tools/oracle/network/admin

之后运行命令生效:
source /etc/profile

posted @ 2014-04-12 11:19 小高 阅读(1821) | 评论 (0)编辑 收藏

 

 

relocation error: multiget: symbol _Z23wxHandleFatalExceptionsb, version WXU_2.8 not defined in file libwx_baseu-2.8.so.0

 

下载地址:

http://www.codeblocks.org/downloads/26 

http://sourceforge.net/projects/codeblocks/files/Binaries/13.12-RC1/Linux%20(64bit)/

codeblocks-13.12-1.el5.x86_64.tar.bz2

 

安装的关键

Note: On RedHat/CentOS 5 and older revisions of 6 (up to 6.2 as far as I know) you need to add repoforge (former rpmforge) to your repolist, to be able to install the needed wxGTK-package. Seehttp://repoforge.org/use for an instruction.

 

更新yum的源 很重要

http://repoforge.org/use/  下载对应的rpm

cat /etc/redhat-release

uname –a

rpm -ivh package-filename

 

# yum install gcc
# yum install gcc-c++
如果之前失败过  yum erase wxGTK
# yum install wxGTK
 
然后
 ]# ls
codeblocks-12.11-1.el6.i686.rpm
codeblocks-contrib-12.11-1.el6.i686.rpm
codeblocks-contrib-devel-12.11-1.el6.i686.rpm
codeblocks-devel-12.11-1.el6.i686.rpm
# rpm -ivh codeblocks*
 
yum install gcc gcc-g++ autoconfig automake 
 
 
参考:
http://blog.csdn.net/dupei/article/details/6428346
 
http://www.cnblogs.com/magialmoon/archive/2013/05/05/3061108.html
 
 
 
 
posted @ 2014-04-11 16:19 小高 阅读(1451) | 评论 (1)编辑 收藏
     摘要:   阅读全文
posted @ 2013-10-21 11:10 小高 阅读(274) | 评论 (0)编辑 收藏

 

目标缓冲区 小于 实际缓冲区

 

char *name = "1234567890";
char name2[6]={0};

memcpy_s( name2 ,  sizeof(name2) ,  name, strlen(name));

动态执行失败 (DEBUG ASSERTION FAILED !) 运行库和调试库都会提示出错.

 

注意:    指针sizeof( 指针 ) = 4  

strncpy(name2,name ,sizeof(name) );             打印name2  1234 

 

strncpy(name2,name ,strlen(name) );            打印name2   123456IOIPNUUY

优化这个语句,尽量拷贝内容

strncpy(name2,name ,   strlen(name)>sizeof(name2)? sizeof(name2): strlen(name)   );

 

 

目标缓冲区 小于 实际缓冲区

strncpy(name2,name ,sizeof(name2)-1 );

sizeof(name2)-1 ------------>让最后一个name2字符留给\0 否则这个字符也被拷贝了.

 

 

 

看一下LINUX下的两个函数的源代码,印象会更加深刻一些
void * memcpy(void * dest,const void *src,size_t count)
{
    char *tmp = (char *) dest, *s = (char *) src;
    while (count--)
        *tmp++ = *s++;
    return dest;
}
char * strcpy(char * dest,const char *src)
{
    char *tmp = dest;
    while ((*dest++ = *src++) != '\0')
        /* nothing */;
    return tmp;
}
老实讲,这两个函数长得是很帅

 

 

参考

http://stackoverflow.com/questions/4593907/difference-between-strncpy-and-memcpy

 

http://www.cppblog.com/Tim/archive/2011/04/02/143259.aspx

posted @ 2013-09-18 00:12 小高 阅读(445) | 评论 (0)编辑 收藏

 

Visual Studio 2008 命令提示

cl /EHsc simple.cpp

 

参考:

http://msdn.microsoft.com/zh-cn/library/ms235639(v=vs.90).aspx 

http://msdn.microsoft.com/zh-cn/library/1370z17c.aspx

 

 

 

Visual C++ 示例应用程序

Visual Studio 2008

其他版本


通用示例

包含一些示例,这些示例可以在 Visual C++ 的所有版本(包括 Visual C++ 速成版)中使用。

Visual C++ 2008 中的演练

包含一些演练链接,这些演练重点演示了 Visual C++ 的功能。

STL 示例

包含演示标准模板库功能的一些示例。

ATL 示例

包含演示活动模板库 (ATL) 功能的一些示例。

编译器 COM 支持示例

包含一些示例,这些示例演示 Visual C++ 编译器对 COM 的内置支持。

自定义向导示例

包含一些示例,这些示例说明如何创建您自己的向导来优化与创建自定义应用程序或添加代码相关的任务。

事件处理示例

包含一些示例,这些示例演示 Visual C++ 中的事件处理。

扩展性

包含一些示例,这些示例演示如何扩展 Visual Studio 和 Visual C++。

国际示例

包含一些示例,这些示例演示如何针对国际市场编写代码。

互操作性示例

包含一些示例,这些示例演示 COM 和 .NET Framework 之间的互操作性。

MASM 示例

包含一些示例,这些示例演示 Visual C++ 中的 Microsoft Macro Assembler (MASM) 源文件支持。

MFC 示例

包含一些示例,这些示例演示 Microsoft 基础类 (MFC) 功能。

Windows SDK 示例

包含一个示例,此示例演示 Windows 图像获取 (WIA) 应用程序编程接口 (API)。

 

 

互操作性示例

http://msdn.microsoft.com/zh-cn/library/wd6032c3.aspx

 

标准模板库示例

http://msdn.microsoft.com/zh-cn/library/f1dtts6s.aspx

posted @ 2013-09-15 00:27 小高 阅读(729) | 评论 (0)编辑 收藏

 

warning MSB8012: TargetPath(C:\dev\APPFF_SQ2\APP\.\Release\APP_SQ1.exe) 与 Linker 的 OutputFile 属性值(C:\dev\APPFF_SQ2\APP\Release\MDU2FF_SQ.exe)不匹配。这可能导致项目生成不正确。若要更正此问题,请确保 $(OutDir)、$(TargetName) 和 $(TargetExt) 属性值与 %(Link.OutputFile) 中指定的值匹配。

warning MSB8012: TargetName(MDU2FF_SQ1) 与 Linker 的 OutputFile 属性值(MDU2FF_SQ)不匹配。这可能导致项目生成不正确。若要更正此问题,请确保 $(OutDir)、$(TargetName) 和 $(TargetExt) 属性值与 %(Link.OutputFile) 中指定的值匹配。
1>  MD .vcxproj -> C:\dev\APPFF_SQ2\APP\.\Release\ .exe

 

project name 修改名字.

另外工程配置,链接生成--->输出文件统一.

posted @ 2013-09-12 14:51 小高 阅读(1273) | 评论 (0)编辑 收藏
posted @ 2013-09-12 14:09 小高 阅读(301) | 评论 (0)编辑 收藏
     摘要:   一般来说,如果你不是MFC工程,需要引用HANDLE的话, 最好自己将其类型改为void*,比如,你本来变量的类型为HANDLE, 你把它改为void*就可以了。   --------------------------------------------------------------------------------    ...  阅读全文
posted @ 2013-09-10 14:14 小高 阅读(524) | 评论 (0)编辑 收藏

1、工作空间默认
 
Windows -> Preferrences -> C/C++ -> Editor -> Documentation tool comments
 
默认为none,修改为Doxygen即可
 
2、工程特别属性
如果不想设置为整个工作空间的默认属性,可以在工作属性对话框的这里找到:
 
Project -> Properties -> C/C++ General -> Enable project specific settings
 
选择Doxygen即可
 
备忘

posted @ 2013-09-10 14:03 小高 阅读(262) | 评论 (0)编辑 收藏

发生在析够函数中,   vs2010 debug 模式 .

CriticalSection::~CriticalSection(void){
    DeleteCriticalSection(&m_CritSect); 
}

 

我开始推测,必须退出section才能delete ?

    InitializeCriticalSection(&m_CritSect);  
      EnterCriticalSection(&m_CritSect); 
    DeleteCriticalSection(&m_CritSect);   
  实际上这样退出是可以的.

 

问题在哪里? 

一个回调处理函数类注册到另外一个线程里面.另外一个线程一直有消息推送或者调用其内部函数.

 

~主类(){

       aa->release(); //之前没有这句话 ,内部aa 线程一直在运行 ,可能是排在析构 (DeleteCriticalSection)之后或者之前,损坏了这个变量 m_CritSect

}

这里开始调用  DeleteCriticalSection(&m_CritSect);   并且报错了.

posted @ 2013-09-10 13:28 小高 阅读(452) | 评论 (0)编辑 收藏

别的项目里面拿来的 .h .cpp 

因为本项目未使用预编译头.

但是预编译头这个头文件存在,里面东西很多.

导致很多宏  或者 常量重复定义.

posted @ 2013-09-09 23:34 小高 阅读(258) | 评论 (0)编辑 收藏
定义成标准头
int main(int argc, char *argv[])
argv[i]
非标准
int main() {
    PWSTR cmdLine = GetCommandLineW();

    int argc;
    PWSTR *argv = CommandLineToArgvW(cmdLine, &argc);
}

 

 

//参数使用

if (argc==3)
{
    if (strcmp(argv[0], "-e")==0)
    {
        iMode = 1;
    } 
    else if (strcmp(argv[0], "-d")==0)
    {
        iMode =2;
    }
    sInput=argv[1];
    sOutput=argv[2];
}

_tmain 
Unicode下就是wmain
否则就是main

 

[参考]

http://stackoverflow.com/questions/16706632/c-tchar-to-stdstring

posted @ 2013-09-04 16:07 小高 阅读(230) | 评论 (0)编辑 收藏

我老是搞错.

 

boy.h

class Boy

 

boy.cpp

Boy  g_boy;

 

使用全局变量

Collection.h

#include “boy.h”

extern Boy g_boy;

 

似乎更优雅的方式

#ifdef  _BOY__HH__
extern  Boy  g_boy ;
#endif

 

 

错误方式:    定义宏根本解决不了这个问题

boy.h
#pragma once
#ifndef _BOY__HH__
#define _BOY__HH__ 

class  boy

Boy  g_boy;

#endif

编译错误

1> .obj : error LNK2005: "class class 全局变量名 " (?g_CITSCache@@3VMarketCache@@A) 已经在 XXX.obj 中定义
1>  正在生成非 SAFESEH 映像。
1>D:\XXX.exe : fatal error LNK1169: 找到一个或多个多重定义的符号

 

等我看了编译原理再来解释.

 

如何防止循环引用?

A->b->c->A

posted @ 2013-09-04 09:35 小高 阅读(319) | 评论 (0)编辑 收藏

一直报错,说找不到引用.

2>Quote.obj : error LNK2019: 无法解析的外部符号 "public: __thiscall 某类::某类(char *)" (??0某类@@QAE@PAD@Z),该符号在函数 "public: __thiscall Quote::Quote(void)" (??0Quote@@QAE@XZ) 中被引用
2>Quote.obj : error LNK2001: 无法解析的外部符号 "public: virtual bool __thiscall 某类::Init(void)" (?Init@某类@@UAE_NXZ)
2>Quote.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall 某类::Kill(void)" (?Kill@某类@@UAEXXZ)
2>Quote.obj : error LNK2001: 无法解析的外部符号 "private: virtual int __thiscall 某类::Run(void)" (?Run@某类@@EAEHXZ)
2>Quote.obj : error LNK2001: 无法解析的外部符号 "private: virtual bool __thiscall 某类::Terminate(void)" (?Terminate@某类@@EAE_NXZ)
2>Quote.obj : error LNK2019: 无法解析的外部符号 "public: virtual __thiscall 某类::~某类(void)" (??1CW

1.使用编译---------> verbose  显示能找到库.

9C[Z)A4`[NZT4PM_%[[$2HB

2.可以看到那个方法连接到那个库文件里面的.

ZH1IBN68EZ@~YHRA@]$EQ61

3.通过depends  看这个dll暴露出来的方法.

C}$1@WQ~CKP%KDAQ9GYSLCK

 

 

 

#ifdef EXPORT_API
#define MY_API __declspec(dllexport)
#else
#define MY_API __declspec(dllimport)
#endif

class MY_API MyClass {
   ...
};

 

#include <e://testClass.h>

#pragma comment(lib, "//Debug//ServerDLL.lib")

 

 

参考

http://www.codeproject.com/Articles/28969/HowTo-Export-C-classes-from-a-DLL

 

http://www.cppblog.com/suiaiguo/archive/2009/07/21/90734.html

posted @ 2013-09-03 10:15 小高 阅读(514) | 评论 (0)编辑 收藏

 

****取资源

 

      业务代码?

     

***释放资源

posted @ 2013-09-02 20:47 小高 阅读(284) | 评论 (0)编辑 收藏

回头慢慢看.

 

 

 

http://stackoverflow.com/questions/1008019/c-singleton-design-pattern

 

http://blog.yangyubo.com/2009/06/04/best-cpp-singleton-pattern/#id15

 

http://yunli.blog.51cto.com/831344/758684

 

CMake - 优秀的 C/C++ 构建系统

http://blog.yangyubo.com/2008/05/07/cmake-excellent-buildsys/

 

揭示C++中全局类变量的构造与析构顺序

http://yunli.blog.51cto.com/831344/636281

 

http://www.cppblog.com/dyj057/archive/2005/09/20/346.html

posted @ 2013-08-28 13:29 小高 阅读(196) | 评论 (0)编辑 收藏

 

 

  SetBlockMode(false);  // NONBLOCK mode      
 e = connect(m_socket, (struct sockaddr*)&addr, sizeof (addr));  
 if (e<0)       {      
 e = GET_LAST_SOCK_ERROR();  printf(" socket error code = %d \n",e);       
 if ((e==EWOULDBLOCK||e==EINPROGRESS || e == WSAEWOULDBLOCK ) && CheckSendAvailable(waitms)>0)    
 {             e = 0; // 表示连接成功      
  }  
else   {  
           e = -1; // 表示连接失败,或者在等待的时间之内连接失败          }
 
我临时修改。
         if ((e==EWOULDBLOCK||e==EINPROGRESS || e == WSAEWOULDBLOCK ) && CheckSendAvailable(waitms)>0)
 
WSAEWOULDBLOCK  = 10037 
 
 
 
问题找到了。
切换到项目配置。平台工具集---->vs2008   连接win sdk 6的库
切换到项目配置。平台工具集---->vs2012 连接win  sdk  8 的库
有区别。
 
 

E6~A%]$`JD$GI9K]TY[MO~Q

 

正在生成代码...
1>  Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
1> 
1>  Copyright (C) Microsoft Corporation.  All rights reserved.
1> 
1> 
1> 
1>  正在搜索库
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\ws2_32.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\odbc32.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\odbccp32.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\kernel32.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\user32.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\gdi32.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\winspool.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\comdlg32.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\advapi32.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\shell32.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\ole32.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\oleaut32.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\uuid.lib:
1>      正在搜索 c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib\LIBCMTD.lib:
1>      正在搜索 c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib\OLDNAMES.lib:
1>      正在搜索 c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib\libcpmtd.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\ws2_32.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\odbc32.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\odbccp32.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\kernel32.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\user32.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\gdi32.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\winspool.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\comdlg32.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\advapi32.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\shell32.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\ole32.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\oleaut32.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\uuid.lib:
1>      正在搜索 c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib\LIBCMTD.lib:
1>      正在搜索 c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib\OLDNAMES.lib:
1>      正在搜索 c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib\libcpmtd.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\ws2_32.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\odbc32.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\odbccp32.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\kernel32.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\user32.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\gdi32.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\winspool.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\comdlg32.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\advapi32.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\shell32.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\ole32.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\oleaut32.lib:
1>      正在搜索 C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib\uuid.lib:
1> 
1>  已完成库搜索
1>  Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
1> 
1>  Copyright (C) Microsoft Corporation.  All rights reserved.
1> 
1> 
1>  MDUSJS.vcxproj -> D:\dev\cmd3\cmdsiimdsi\MDUSJS2012\.\Debug\MDUSJS.exe
========== 生成: 成功 1 个,失败 0 个,最新 0 个,跳过 0 个 ==========

 

平台工具 连接的库不一样。

 

Q__${K)0%R54TA9X8E8EUQJ

 


>  正在生成代码...
1>dbf.obj : warning LNK4075: 忽略“/EDITANDCONTINUE”(由于“/SAFESEH”规范)
1> 
1>  正在搜索库
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\ws2_32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\odbc32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\odbccp32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\kernel32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\user32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\gdi32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\winspool.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\comdlg32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\advapi32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\shell32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\ole32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\oleaut32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\uuid.lib:
1>      正在搜索 D:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib\LIBCMTD.lib:
1>      正在搜索 D:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib\OLDNAMES.lib:
1>      正在搜索 D:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib\libcpmtd.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\ws2_32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\odbc32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\odbccp32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\kernel32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\user32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\gdi32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\winspool.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\comdlg32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\advapi32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\shell32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\ole32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\oleaut32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\uuid.lib:
1>      正在搜索 D:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib\LIBCMTD.lib:
1>      正在搜索 D:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib\OLDNAMES.lib:
1>      正在搜索 D:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib\libcpmtd.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\ws2_32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\odbc32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\odbccp32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\kernel32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\user32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\gdi32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\winspool.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\comdlg32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\advapi32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\shell32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\ole32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\oleaut32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\uuid.lib:
1> 
1>  已完成库搜索
1> 
1>  正在搜索库
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\ws2_32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\odbc32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\odbccp32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\kernel32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\user32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\gdi32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\winspool.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\comdlg32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\advapi32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\shell32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\ole32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\oleaut32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\uuid.lib:
1>      正在搜索 D:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib\LIBCMTD.lib:
1>      正在搜索 D:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib\OLDNAMES.lib:
1>      正在搜索 D:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib\libcpmtd.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\ws2_32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\odbc32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\odbccp32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\kernel32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\user32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\gdi32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\winspool.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\comdlg32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\advapi32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\shell32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\ole32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\oleaut32.lib:
1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\uuid.lib:
1> 
1>  已完成库搜索
1>  MDUSJS.vcxproj -> D:\dev\cmd3\cmdsiimdsi\MDUSJS2012\.\Debug\MDUSJS.exe
========== 生成: 成功 1 个,失败 0 个,最新 0 个,跳过 0 个 ==========

 

 

 

 

 

 

 
 
 

参考:

ms connect

http://msdn.microsoft.com/en-us/library/windows/desktop/ms737625(v=vs.85).aspx

 

ioctlsocket function 控制柱塞非柱塞

http://msdn.microsoft.com/en-us/library/windows/desktop/ms738573(v=vs.85).aspx

 

TCP/IP编程基础——超时、多路复用、非阻塞

 

 

http://blog.csdn.net/s3olo/article/details/8014872

 

 

 

http://developerweb.net/viewtopic.php?id=7246

 

 

代码 windows  tcp 通过select方式实现 connect non block

http://bbs.csdn.net/topics/10426810

 

 

 

http://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx

Windows Sockets Error Codes

 

***************

测试模拟工具发送大数据量消息时,发现时而发送成功,时而失败。追踪代码发现,抛出的是一个错误码为10035的socket错误。上网查资料发现这个错误码描述是Service temporarily unavailable.也就是说有可能send的时候遇到socket缓冲区满,无法写入,引起发送失败。

  如果是这样的话,那么这就是一个常规的异常情况,需要对它进行处理,而不是异常退出。

  最后代码改成这个样子,send然后分析返回结果,如果错误,且错误码为10035,那么就重发,直到发成功时,break。

  目前尚不知道,这样改的副作用有没有,反正现在问题暂时解决鸟

***********************************

 

Winsock connect函数返回错误,使用WSAGetLastError得到10035,10037,是什么原因
MSDN注释:
WSAEWOULDBLOCK
10035
Resource temporarily unavailable.
This error is returned from operations on nonblocking sockets that cannot be completed immediately, for example recv when no data is queued to be read from the socket. It is a nonfatal error, and the operation should be retried later. It is normal for WSAEWOULDBLOCK to be reported as the result from calling connect on a nonblocking SOCK_STREAM socket, since some time must elapse for the connection to be established.
WSAEALREADY
10037
Operation already in progress.
An operation was attempted on a nonblocking socket with an operation already in progress—that is, calling connect a second time on a nonblocking socket that is already connecting, or canceling an asynchronous request (WSAAsyncGetXbyY) that has already been canceled or completed.
网络翻译:
10035—WSAEWOULDBLOCK
资源暂时不可用。对非锁定套接字来说,如果请求操作不能立即执行的话,通常会返回这个错误。比如说,在一个非暂停套接字上调用 connect,就会返回这个错误。因为连接请求不能立即执行。
10037—WSAEALREADY
操作已完成。一般来说,在非锁定套接字上尝试已处于进程中的操作时,会产生这个错误。比如,在一个已处于连接进程的非锁定套接字上,再一次调用 connect 或 WSAConnect。另外,服务提供者处于执行回调函数(针对支持回调例程的 Winsock函数)的进程中时,也会出现这个错误。
我描述下问题:使用socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);创建一个TCP/IP套接字,然后创建一个线程,不停地用connect函数进行链接,直到链接成功,才退出线程,问题来了,connect函数它有时候返回成功,有时候又返回错误,用WSAGetLastError得到享受10035, 10037这两种错误值,我将错误值打印出来,结果是:10035,10035,10037,10037,10037,10037,10037.......,10037。

****************************************************************

 

 

 

 

WSADATA wsd;
SOCKET cClient;
int ret;
struct sockaddr_in server;
hostent *host=NULL;
if(WSAStartup(MAKEWORD(2,0),&wsd)){return 0;}
cClient=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
if(cClient==INVALID_SOCKET){return 0;}
//set Recv and Send time out
int TimeOut=6000; //设置发送超时6秒
if(::setsockopt(cClient,SOL_SOCKET,SO_SNDTIMEO,(char *)&TimeOut,sizeof(TimeOut))==SOCKET_ERROR){
return 0;
}
TimeOut=6000;//设置接收超时6秒
if(::setsockopt(cClient,SOL_SOCKET,SO_RCVTIMEO,(char *)&TimeOut,sizeof(TimeOut))==SOCKET_ERROR){
return 0;
}
//设置非阻塞方式连接
unsigned long ul = 1;
ret = ioctlsocket(cClient, FIONBIO, (unsigned long*)&ul);
if(ret==SOCKET_ERROR)return 0;
//连接
server.sin_family = AF_INET;
server.sin_port = htons(25);
server.sin_addr .s_addr = inet_addr((LPCSTR)pSmtp);
if(server.sin_addr.s_addr == INADDR_NONE){return 0;}
connect(cClient,(const struct sockaddr *)&server,sizeof(server));
//select 模型,即设置超时
struct timeval timeout ;
fd_set r;
FD_ZERO(&r);
FD_SET(cClient, &r);
timeout.tv_sec = 15; //连接超时15秒
timeout.tv_usec =0;
ret = select(0, 0, &r, 0, &timeout);
if ( ret <= 0 )
{
::closesocket(cClient);
return 0;
}
//一般非锁定模式套接比较难控制,可以根据实际情况考虑 再设回阻塞模式
unsigned long ul1= 0 ;
ret = ioctlsocket(cClient, FIONBIO, (unsigned long*)&ul1);
if(ret==SOCKET_ERROR){
::closesocket (cClient);
return 0;
}

 

 

 

//设置非阻塞方式连接
unsigned long ul = 1;
ret = ioctlsocket(cClient, FIONBIO, (unsigned long*)&ul);
if(ret==SOCKET_ERROR)return 0;
//连接
server.sin_family = AF_INET;
server.sin_port = htons(25);
server.sin_addr .s_addr = inet_addr((LPCSTR)pSmtp);
if(server.sin_addr.s_addr == INADDR_NONE){return 0;}
connect(cClient,(const struct sockaddr *)&server,sizeof(server));
//select 模型,即设置超时
struct timeval timeout ;
fd_set r;
FD_ZERO(&r);
FD_SET(cClient, &r);
timeout.tv_sec = 15; //连接超时15秒
timeout.tv_usec =0;
ret = select(0, 0, &r, 0, &timeout);
if ( ret <= 0 )
{
::closesocket(cClient);
return 0;
}
//一般非锁定模式套接比较难控制,可以根据实际情况考虑 再设回阻塞模式
unsigned long ul1= 0 ;
ret = ioctlsocket(cClient, FIONBIO, (unsigned long*)&ul1);
if(ret==SOCKET_ERROR){
::closesocket (cClient);
return 0;
}

 

------------------------------------------

 

 

// Socket中如何设置连接超时
// AntGhazi/2001.12.14 主页:antghazi.yeah.net
/*
把CSDN与中文yahoo翻了底朝天, 也没找到如何设置socket的连接超时的满意方法, 问此问题的兄弟已有一大堆,
这里偶就讲一下win下如何设置socket的connect超时. 设置connect的超时很简单, CSDN上也有人提到过使用select,
但却没有一个令人满意与完整的答案. 偶所讲的也正是select函数, 此函数集成在winsock1.1中, 简单点讲,"作用使
那些想避免在套接字调用过程中被锁定的应用程序, 采取一种有序的方式, 同时对多个套接字进行管理"
(<<Windows网络编程技术>>原话). 使用方法与解释请见《Windows网络编程技术》.
在使用此函数前, 需先将socket设置为非锁定模式, 这样, 在connect时,才会立马跳过,
同时, 通常也会产生一个WSAEWOULDBLOCK错误,这个错误没关系. 再执行select则是真正的超时.
*/
WSADATA wsd;
SOCKET cClient;
int ret;
struct sockaddr_in server;
hostent *host=NULL;
if(WSAStartup(MAKEWORD(2,0),&wsd))
{
return 0;
}
cClient=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
if(cClient==INVALID_SOCKET)
{
return 0;
}
//set Recv and Send time out
int TimeOut=6000; //设置发送超时6秒
if(::setsockopt(cClient,SOL_SOCKET,SO_SNDTIMEO,(char *)&TimeOut,sizeof(TimeOut))==SOCKET_ERROR)
{
return 0;
}
TimeOut=6000;//设置接收超时6秒
if(::setsockopt(cClient,SOL_SOCKET,SO_RCVTIMEO,(char *)&TimeOut,sizeof(TimeOut))==SOCKET_ERROR)
{
return 0;
}
//设置非阻塞方式连接
unsigned long ul = 1;
ret = ioctlsocket(cClient, FIONBIO, (unsigned long*)&ul);
if(ret==SOCKET_ERROR)return 0;
//连接
server.sin_family = AF_INET;
server.sin_port = htons(25);
server.sin_addr.s_addr = inet_addr((LPCSTR)pSmtp);
if(server.sin_addr.s_addr == INADDR_NONE)
{
return 0;
}
connect(cClient,(const struct sockaddr *)&server,sizeof(server));
//select 模型,即设置超时
struct timeval timeout ;
fd_set r;
FD_ZERO(&r);
FD_SET(cClient, &r);
timeout.tv_sec = 15; //连接超时15秒
timeout.tv_usec = 0;
ret = select(0, 0, &r, 0, &timeout);
if ( ret <= 0 )
{
::closesocket(cClient);
return 0;
}
//一般非锁定模式套接比较难控制,可以根据实际情况考虑 再设回阻塞模式
unsigned long ul1= 0 ;
ret = ioctlsocket(cClient, FIONBIO, (unsigned long*)&ul1);
if(ret==SOCKET_ERROR)
{
::closesocket (cClient);
return 0;
}
/////////////////////////////////////////////////////////////////
以前我从csdn上找到的,注意如果调用connect返回SOCKET_ERROR,那么你要调用 WSAGetLastError(),看错误是不是WSAEWOULDBLOCK,如果是,则忽略,否则是真的出错了。

 

 

 

-------------------------------------------------------------

 

 

这个应该是可以用的,因为我用过,我的代码是这样的,供你参考
LPHOSTENT ScanIPAddr(DWORD dwIP)
{
SOCKET sock = INVALID_SOCKET;
LPHOSTENT lphost = NULL;
SOCKADDR_IN server;
u_long ul = 1;
struct timeval timeout ;
fd_set r;
memset(&server, 0, sizeof(server));
server.sin_family = AF_INET;
server.sin_port = _nPort;
server.sin_addr.s_addr = htonl((u_long)dwIP);
sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if(sock == INVALID_SOCKET)
return NULL;
//设置非阻塞方式连接
if(ioctlsocket(sock, FIONBIO, (u_long*)&ul)==SOCKET_ERROR)
return NULL;
if(0 != connect(sock, (SOCKADDR*)&server, sizeof(server)))
{
if(WSAGetLastError() != WSAEWOULDBLOCK)
{
closesocket(sock);
return NULL;
}
}
//select 模型,即设置超时
FD_ZERO(&r);
FD_SET(sock, &r);
timeout.tv_sec = 0; //连接超时0秒
timeout.tv_usec = 700;
if(select(0, 0, &r, 0, &timeout) <= 0)
{
closesocket(sock);
return NULL;
}
lphost = gethostbyaddr((const char *)&(server.sin_addr), 4, AF_INET);
closesocket(sock);
return lphost;
}

 

 

 

-----------------------------------------------------------------------------

 

 

 

下面是我的实现代码:
char sBuf[2048];
    int i;
int iSRTimeOut = 6000;
    u_long arg=1;
    rc4_key key;
    int r;
    struct sockaddr_in sockaddr; 
    sock=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
    if (sock==INVALID_SOCKET)
{
        r=WSAGetLastError();
    closesocket(sock);
    sprintf(sBuf,"Winsock Error:%d",r);
    return Error(_T(sBuf));
}
//设置接收超时6000毫秒
    if(setsockopt(sock,IPPROTO_TCP,SO_RCVTIMEO,(const char FAR*)&iSRTimeOut,sizeof(int))==SOCKET_ERROR)
{
r=WSAGetLastError();
closesocket(sock);
sprintf(sBuf,"Winsock Error:%d",r);
//return Error(_T(sBuf));
}
//设置发送超时6000毫秒
    if(setsockopt(sock,IPPROTO_TCP,SO_SNDTIMEO,(const char FAR*)&iSRTimeOut,sizeof(int))==SOCKET_ERROR)
    {
r=WSAGetLastError();
closesocket(sock);
sprintf(sBuf,"Winsock Error:%d",r);
//return Error(_T(sBuf));
}
//设置非阻塞连接方式
unsigned long ul = 1;
    r = ::ioctlsocket(sock, FIONBIO, (unsigned long*)&ul);
    if(r==SOCKET_ERROR)
{
r=WSAGetLastError();
closesocket(sock);
sprintf(sBuf,"Winsock Error:%d",r);
// return Error(_T(sBuf));
}
//进行连接操作
    switch (m_ProxyType)
    {
case 0:
       sockaddr.sin_addr.s_addr=inet_addr(m_SvrAddr);
   sockaddr.sin_port=htons((unsigned short)m_SvrPort);
   break;
    default:
       sockaddr.sin_addr.s_addr=inet_addr(m_ProxyAddr);
   sockaddr.sin_port=htons((unsigned short)m_ProxyPort);
   break;
    }
    sockaddr.sin_family=AF_INET;
    memset(sockaddr.sin_zero,0,8);
   int iReturn;
    connect(sock,(struct sockaddr*)&sockaddr,sizeof(struct sockaddr_in));
iReturn = ConnectedReady(sock);// 连接延时
if(iReturn == 0)
{
return Error(_T("Connect TimeOut!"));
}
if(iReturn >1)
{
sprintf(sBuf,"Winsock Error:%d",iReturn);
return Error(_T(sBuf));
}
//设置回阻塞模式
unsigned long ul1= 0 ;
    r = ioctlsocket(sock, FIONBIO, (unsigned long*)&ul1);
    if(r==SOCKET_ERROR)
{
r=WSAGetLastError();
closesocket (sock);
sprintf(sBuf,"Winsock Error:%d",r);
return Error(_T(sBuf));
}
说明:进行setsockopt、设置非阻塞模式、一直到最后设置回阻塞模式,都有错误码返回!
功能描述:本来我的程序就是要实现:自己定义一个timeout值,在网络不通或阻塞时,客户端调用connect,最长等待timeout秒。
msn:himming@hotmail.com

 

---------------------------------------------------------------------

http://www.cnblogs.com/BloodAndBone/archive/2012/05/22/2513338.html

 

 

windows下设置socket的connect超时

变相的实现connect的超时,我要讲的就是这个方法,原理上是这样的:
1.建立socket
2.将该socket设置为非阻塞模式
3.调用connect()
4.使用select()检查该socket描述符是否可写(注意,是可写)
5.根据select()返回的结果判断connect()结果
6.将socket设置为阻塞模式(如果你的程序不需要用阻塞模式的,这步就省了,不过一般情况下都是用阻塞模式的,这样也容易管理)

复制代码

// widonws: 默认设置socket TCP client connect为阻塞模式
void TcpConnect(char* strIP, UINT nPort)
{
    struct sockaddr_in serverAddress;
    SOCKET hSocket = NULL;

    hSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
    if( hSocket==INVALID_SOCKET)
    {
        return;
    }

    memset(&serverAddress, 0, sizeof(serverAddress));     
    serverAddress.sin_family      = AF_INET;
    serverAddress.sin_addr.s_addr = inet_addr(strIP);   
    serverAddress.sin_port        = htons((short)nPort);      
    int iTimeOut = 3000;
    setsockopt(hSocket,SOL_SOCKET,SO_RCVTIMEO,(char*)&iTimeOut,sizeof(iTimeOut));
    setsockopt(hSocket,SOL_SOCKET,SO_SNDTIMEO,(char*)&iTimeOut,sizeof(iTimeOut));    

    if( SOCKET_ERROR==connect(hSocket, (sockaddr*)&serverAddress, sizeof(serverAddress)) )
    {        
        closesocket(hSocket);
        DWORD gle = WSAGetLastError();

        return;
    }

    char buff[] = "hello";
    int sl=::send(hSocket,(char*)buff, sizeof(buff), 0);
    if( sl<0 )
    {
        closesocket(hSocket);
        return ;
    }
    closesocket(hSocket);
}

// widonws: 设置socket TCP client connect非阻塞模式
void SockSelect(char* strIP, UINT nPort)
{
    SOCKET/*int*/ sockfd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
    if(sockfd < 0) 
    {
        return;
    }
    struct sockaddr_in serv_addr;

    //以服务器地址填充结构serv_addr
    serv_addr.sin_family = AF_INET;
    serv_addr.sin_addr.s_addr = inet_addr(strIP);
    serv_addr.sin_port = htons(nPort);
    int error = -1;
    int len = sizeof(int);
    timeval tm;
    fd_set set;
    unsigned long ul = 1;
    ioctlsocket(sockfd, FIONBIO, &ul); //设置为非阻塞模式
    bool ret = false;
    if( connect(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) == -1)
    {
        tm.tv_sec  = 3;
        tm.tv_usec = 0;
        FD_ZERO(&set);
        FD_SET(sockfd, &set);
        if( select(sockfd+1, NULL, &set, NULL, &tm) > 0)
        {
            getsockopt(sockfd, SOL_SOCKET, SO_ERROR, (char *)&error, /*(socklen_t *)*/&len);
            if(error == 0) 
                ret = true;
            else 
                ret = false;
        } 
        else 
            ret = false;
    }
    else 
        ret = true;
    ul = 0;
    ioctlsocket(sockfd, FIONBIO, &ul); //设置为阻塞模式
    if(!ret) 
    {
        closesocket( sockfd );
        fprintf(stderr , "Cannot Connect the server!/n");
        return;
    }

    fprintf( stderr , "Connected!/n");

    char buff[] = "hello";
    int sl=::send(sockfd,(char*)buff, sizeof(buff), 0);

    closesocket( sockfd );
}

复制代码

分类: c/c++, VC++

posted @ 2013-08-22 18:14 小高 阅读(755) | 评论 (0)编辑 收藏

 

https://www.byvoid.com/blog/c-int64/

 

我要解决的几个问题

 

消费线程 c++

函数调用栈和栈帧 

 

预编译技术要研究一下

http://www.cnblogs.com/cofd/archive/2007/11/05/949962.html

 

编译器-VC6.0全解及调试技巧

http://blog.csdn.net/wscxr57/article/details/8020754

posted @ 2013-08-20 22:42 小高 阅读(233) | 评论 (0)编辑 收藏

1. 简单解决问题的方式是

找cpp  缺少  #include "stdafx.h" 添加。并且使用 《预编译选项》

B8C9~4S35CKEG12DA5W7_ZJ

 

2.被动解决方式

    又分为2种方式

    1.选择排除 lib 再附加lib   nafxcwd.lib    LIBCMTD.lib  附加的顺序不一样来操作。

    2.另外一种简单的做法 在附加lib处添加  nafxcwd.lib

 

使用  Client.lib 会出现问题,libc 和mfc的库冲突问题。

这边可以在编译时加lib参数 nafxcwd.lib。但是我项目本身不使用mfc。

1>nafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) 已经在 LIBCMTD.lib(new.obj) 中定义

1>nafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) 已经在 LIBCMTD.lib(dbgdel.obj) 中定义

1>nafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new[](unsigned int)" (??_U@YAPAXI@Z) 已经在 libcpmtd.lib(newaop.obj) 中定义

1>nafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete[](void *)" (??_V@YAXPAX@Z) 已经在 LIBCMTD.lib(delete2.obj) 中定义

1>     正在创建库 ..\bin\Service.lib 和对象 ..\bin\Service.exp

1>..\bin\Service.exe : fatal error LNK1169: 找到一个或多个多重定义的符号

1>  正在搜索库

1>      正在搜索 ../lib/CMDClient.lib:

1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\kernel32.lib:

1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\user32.lib:

1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\gdi32.lib:

1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\winspool.lib:

1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\comdlg32.lib:

1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\advapi32.lib:

1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\shell32.lib:

1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\ole32.lib:

1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\oleaut32.lib:

1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\uuid.lib:

1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\odbc32.lib:

1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\odbccp32.lib:

1>      正在搜索 D:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib\LIBCMTD.lib:

1>      正在搜索 D:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib\OLDNAMES.lib:

1>      正在搜索 D:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\lib\uafxcwd.lib:

1>uafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) 已经在 LIBCMTD.lib(new.obj) 中定义

1>uafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) 已经在 LIBCMTD.lib(dbgdel.obj) 中定义

1>      正在搜索 C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86\msimg32.lib:

MSDN 解决问题链接

http://support.microsoft.com/kb/148652/zh-cn

CRT 库对 newdeleteDllMain 函数使用弱外部链接。MFC 库也包含 newdeleteDllMain 函数。这些函数要求先链接 MFC 库,然后再链接 CRT 库。

回到顶端 | 提供反馈

解决方案

该问题有两种解决方法。第一种方法是强制链接器按照正确的顺序链接库。第二种方法是由您亲自查找导致问题的模块并纠正它。
注意 以下步骤基于 Visual C++ 6.0。

解决方案一:强制链接器按照正确的顺序链接库
  1. 在“项目”菜单上,单击“设置”。
  2. 在“项目设置”对话框的“以下项目的设置”视图中,单击以选中出现链接错误的项目配置。
  3. 在“链接”选项卡上,单击以选中“类别”组合框中的“输入”。
  4. 在“忽略库”框中,插入库名(例如,Nafxcwd.lib;Libcmtd.lib)。
    注意:等效的链接器命令行是:/NOD:<library name>
  5. 在“对象/库模块”框中,插入库名。必须确保这些库按顺序列出,而且是行中的前两个库(例如,Nafxcwd.lib 和 Libcmtd.lib)。
要在 Visual C++ .NET 中设置该选项,请阅读“设置 Visual C++ 项目属性”联机帮助主题。
解决方案二:查找导致问题的模块并纠正它
若要查看当前的库链接顺序,请按照下列步骤操作:
  1. 在“项目”菜单上,单击“设置”。
  2. 在“项目设置”对话框的“以下项目的设置”视图中,单击以选中出现链接错误的项目配置。
  3. 在“链接”选项卡上的“项目选项”框中键入 /verbose:lib。
  4. 重新生成项目。在链接过程中,这些库将在输出窗口中列出。

回到顶端 | 提供反馈

状态

这种现象是设计导致的。

回到顶端 | 提供反馈

更多信息

使用 MFC 库时,务必先链接它们,然后再链接 CRT 库。这可以通过确保项目中的每个文件都首先包含 Msdev\Mfc\Include\Afx.h 来完成。

直接包含 (  #include <Afx.h>  ) 或间接包含 (#include <Stdafx.h>) 都可以。Afx.h 包含文件会通过使用 #pragma comment (lib,"<libname>") 指令来强制采用库的正确顺序。
如果源文件的扩展名为 .c,或者该文件的扩展名为 .cpp 但不使用 MFC,则可以创建一个较小的头文件 (Forcelib.h) 并将其放在模块的顶端。这个新的头文件可确保按照正确的顺序搜索库。
Visual C++ 不包含该头文件。要创建此文件,请按照下列步骤操作:

  1. 打开 Msdev\Mfc\Include\Afx.h。
  2. 选定 #ifndef _AFX_NOFORCE_LIBS 和 #endif //!_AFX_NOFORCE_LIBS 之间的行。
  3. 将选定部分复制到 Windows 剪贴板。
  4. 创建一个新文本文件。
  5. 将剪贴板的内容粘贴到这个新文件中。
  6. 将该文件另存为 Msdev\Mfc\Include\Forcelib.h。
在 Visual C++ .NET 中重现问题的步骤
  1. 启动 Microsoft Visual Studio .NET。
  2. 在“文件”菜单上,指向“新建”,然后单击“项目”。
  3. 单击“项目类型”下的“Visual C++ 项目”,然后单击“模板”下的“MFC 应用程序”。
  4. 在“名称”文本框中,键入 Q148652。
  5. 在“位置”文本框中,键入 C:\Test,然后单击“确定”。
  6. 在“MFC 应用程序向导”对话框中,单击“应用程序类型”。
  7. 单击“应用程序类型”下的“基于对话框”,然后单击“MFC 的使用”下的“在静态库中使用 MFC”。
  8. 单击“完成”。
  9. 在“解决方案资源管理器”中,选择“源文件”下的全部三个 .cpp 文件。
  10. 右键单击三个选定的文件,然后单击“删除”。
  11. 右键单击“源文件”,指向“添加”,然后单击“添加新项”。
  12. 单击“模板”下的“C++ 文件”。在“名称”文本框中,键入 Aa。单击“打开”。
  13. 将以下代码粘贴到 Aa.cpp 中:

    int test(){new int; return 1;}
  14. 右键单击“源文件”,指向“添加”,然后单击“添加现有项”。
  15. 选择以下文件:
    • Q148652.cpp
    • Q148652Dlg.cpp
    • stdafx.cpp
  16. 单击“打开”。
  17. 您在第 15 步中选择的文件将出现在“源文件”下。
  18. 选择“源文件”下的全部四个 .cpp 文件。
  19. 右键单击选定的四个 .cpp 文件,然后单击“属性”。
  20. 展开“配置属性”,然后展开“C/C++”。
  21. 单击“预编译头”。
  22. 将“创建/使用预编译头”属性设置为“不使用预编译头”。单击“确定”。
  23. 在“生成”菜单上,单击“重新生成解决方案”。

回到顶端 | 提供反馈

注意:本篇“快速发布”文章是从 Microsoft 支持组织直接创建的。 文中包含的信息按原样提供,用于响应紧急问题。 由于发布仓促,材料可能包含印刷错误,并且可能随时修订,恕不另行通知。 有关其他注意事项,请参阅使用条款

posted @ 2013-08-20 22:26 小高 阅读(2685) | 评论 (0)编辑 收藏

静态库才会发生。

solution

1. static lib

2.exe windows console client .

 

2XQ8F6KK65H}K6PY]%9`$@U

 

3 .setting MDLIB to lib directionary.

DJR$@4(]98BKPJ(RGD~{3UD

OV5$NCN09P6Q68LLSQ_[HM9

设置它本身依赖的dll

image

QGNPL]5IES1D}_{H~Z`3UG8

 

4. lib 目录情况

O6G0]K9{PT5)1AISI9AD~ZJ

 

5. main project  setting  include dir

(_XB)VQFD79(((_@I0A(N1E

6. mian link

XK@A2Z3[YA7[(OD](H_{Z]V

 

UTRNUW}_GU29UPJ[ZG_[9HY

ok 就可以了。 static lib pdb 就可以编译进 main project 文件里了。

重建了项目!找这个问题花了我2个小时。

 

[K%%]ZL{(F)JC5}QH983T[T

 

 

或者在编译自己手工改

/Fd(程序数据库文件名)(C++)

编译要使用pdb写入。连接需要使用pdb。 静态库最终将合并入exe文件所以pdb文件也需要一起用。

/VERBOSE 会把

Z}Z65[})I)T}V4U~0FEQ}}8

 

MSDN 相关内容

链接

http://msdn.microsoft.com/zh-cn/library/t2fck18t(v=vs.80).aspx

LINK 还使用 PDB 保存 .exe 文件或 .dll 文件的调试信息。程序的 PDB 既是输出文件也是输入文件,因为 LINK 在重新生成程序时更新 PDB。

http://msdn.microsoft.com/zh-cn/library/6y6t9esh(v=vs.80).aspx

link 配置目录。

CL 使用 CL 和 INCLUDE

 

生成 C/C++ 程序

在命令行上生成

为命令行生成设置路径和环境变量

NMAKE 参考

运行 NMAKE

生成文件的内容

描述块

生成文件中的命令

宏和 NMAKE

推理规则

点指令

生成文件预处理

VCBUILD 参考

VCBUILD 系统要求

VCBUILD 命令行

VCBUILD 选项

 


Quote of the Day:
Alcohol, if taken in sufficient quantities, produces all the effects of intoxication.
--Oscar Wilde

参考

pdb多 进程征用

http://www.cnblogs.com/joeylee/archive/2012/12/12/2815210.html

http://hi.baidu.com/vc_net/item/ffd829c4132d0862f6c95d48

http://www.cppblog.com/sunicdavy/archive/2011/08/09/152850.html

他的方法需要xcopy复制。解决4099方法。

http://www.cppblog.com/huyutian/archive/2012/10/06/192930.html

 

vc 编译选项

http://hi.baidu.com/odzienkvkodvxze/item/88e75cd8f9a06edf251f408e

posted @ 2013-03-31 11:40 小高 阅读(2830) | 评论 (0)编辑 收藏

混合显卡intel + gpu 卡 .
买一个 displaylink 转换卡。

铭鑫 taobao usb3


posted @ 2013-01-05 14:12 小高 阅读(319) | 评论 (0)编辑 收藏
     摘要: class Father
{
public virtual void do1(){
Console.WriteLine("father do1");
}


public virtual void do2()
{
Console.WriteLine("father do2");
}
}

class Son :Father
{

public void do1()
{
Console.WriteLine("Son do1");
}
public override void do2()
{
Console.WriteLi  阅读全文
posted @ 2010-12-17 22:17 小高 阅读(402) | 评论 (0)编辑 收藏
     摘要:



  阅读全文
posted @ 2010-12-08 00:11 小高 阅读(2866) | 评论 (1)编辑 收藏
     摘要:   阅读全文
posted @ 2010-10-19 17:39 小高 阅读(422) | 评论 (0)编辑 收藏
     摘要:


  阅读全文
posted @ 2010-09-06 10:02 小高| 编辑 收藏
     摘要: select * from tables() ;

function 返回成游标
select function(a) from dual ;   阅读全文
posted @ 2010-09-02 13:56 小高 阅读(246) | 评论 (0)编辑 收藏
     摘要: cmd.CommandText = @"INSERT INTO (
VALUES
(:date_ ) ; ";  阅读全文
posted @ 2010-09-02 13:34 小高 阅读(597) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2010-01-13 09:42 小高 阅读(341) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2009-12-29 13:42 小高 阅读(761) | 评论 (0)编辑 收藏
SQL*Plus系统环境变量有哪些?如何修改?
软件环境:
1、Windows NT4.0+ORACLE 8.0.4
2、ORACLE安装路径为:C:\ORANT

实现方法:
show和set命令是两条用于维护SQL*Plus系统变量的命令

SQL> show all --查看所有68个系统变量值

SQL> show user --显示当前连接用户

SQL> show error                --显示错误

SQL> set heading off --禁止输出列标题,默认值为ON

SQL> set feedback off --禁止显示最后一行的计数反馈信息,默认值为"对6个或更多的记录,回送ON"

SQL> set timing on --默认为OFF,设置查询耗时,可用来估计SQL语句的执行时间,测试性能

SQL> set sqlprompt "SQL> " --设置默认提示符,默认值就是"SQL> "

SQL> set linesize 1000 --设置屏幕显示行宽,默认100

SQL> set autocommit ON --设置是否自动提交,默认为OFF

SQL> set pause on --默认为OFF,设置暂停,会使屏幕显示停止,等待按下ENTER键,再显示下一页

SQL> set arraysize 1 --默认为15

SQL> set long 1000 --默认为80

说明:
long值默认为80,设置1000是为了显示更多的内容,因为很多数据字典视图中用到了long数据类型,如:

SQL> desc user_views
列名 可空值否 类型
------------------------------- -------- ----
VIEW_NAME NOT NULL VARCHAR2(30)
TEXT_LENGTH NUMBER
TEXT LONG

SQL> define a = '''20000101 12:01:01''' --定义局部变量,如果想用一个类似在各种显示中所包括的回车那样的常量,
--可以用define命令来设置
SQL> select &a from dual;
原值 1: select &a from dual
新值 1: select '20000101 12:01:01' from dual

'2000010112:01:01
-----------------
20000101 12:01:01


问题提出:
1、用户需要对数据库用户下的每一张表都执行一个相同的SQL操作,这时,一遍、一遍的键入SQL语句是很麻烦的

实现方法:
SQL> set heading off --禁止输出列标题
SQL> set feedback off --禁止显示最后一行的计数反馈信息

列出当前用户下所有同义词的定义,可用来测试同义词的真实存在性
select 'desc '||tname from tab where tabtype='SYNONYM';

查询当前用户下所有表的记录数
select 'select '''||tname||''',count(*) from '||tname||';' from tab where tabtype='TABLE';

把所有符合条件的表的select权限授予为public
select 'grant select on '||table_name||' to public;' from user_tables where 《条件》;

删除用户下各种对象
select 'drop '||tabtype||' '||tname from tab;

删除符合条件用户
select 'drop user '||username||' cascade;' from all_users where user_id>25;

快速编译所有视图
----当在把数据库倒入到新的服务器上后(数据库重建),需要将视图重新编译一遍,
----因为该表空间视图到其它表空间的表的连接会出现问题,可以利用PL/SQL的语言特性,快速编译。

SQL> SPOOL ON.SQL
SQL> SELECT'ALTER VIEW '||TNAME||' COMPILE;' FROM TAB;
SQL> SPOOL OFF
然后执行ON.SQL即可。
SQL> @ON.SQL
当然,授权和创建同义词也可以快速进行,如:
SQL> SELECT 'GRANT SELECT ON '||TNAME||' TO 用户名;' FROM TAB;
SQL> SELECT 'CREATE SYNONYM '||TNAME||' FOR 用户名.'||TNAME||';' FROM TAB;

SQL*PLUS常用命令列表

[ 天堂之水 2002年9月18日,阅读人数36人 ]



软件环境:
1、Windows 98 第二版
2、Oracle数据库版本为:Personal Oracle7 Release 7.3.4.0.0
3、Oracle安装路径为:C:\ORAWIN95

命令列表:
假设当前执行命令为:select * from tab;

(a)ppend     添加文本到缓冲区当前行尾    a order by tname 结果:select * from tab order by tname;
                                      (注:a后面跟2个空格)
(c)hange/old/new 在当前行用新的文本替换旧的文本 c/*/tname     结果:select tname from tab;
(c)hange/text  从当前行删除文本        c/tab       结果:select tname from ;
del       删除当前行
del n      删除第n行
(i)nput 文本   在当前行之后添加一行
(l)ist      显示缓冲区中所有行
(l)ist n     显示缓冲区中第 n 行
(l)ist m n    显示缓冲区中 m 到 n 行
run       执行当前缓冲区的命令
/        执行当前缓冲区的命令
r        执行当前缓冲区的命令
@文件名     运行调入内存的sql文件,如:

SQL> edit s<回车>
如果当前目录下不存在s.sql文件,则系统自动生成s.sql文件,
在其中输入“select * from tab;”,存盘退出。

SQL> @s<回车>
系统会自动查询当前用户下的所有表、视图、同义词。

@@文件名     在.sql文件中调用令一个.sql文件时使用

save 文件名   将缓冲区的命令以文件方式存盘,缺省文件扩展名为.sql
get 文件名    调入存盘的sql文件
start 文件名   运行调入内存的sql文件

spool 文件名   把这之后的各种操作及执行结果“假脱机”即存盘到磁盘文件上,默认文件扩展名为.lst
spool      显示当前的“假脱机”状态
spool off    停止输出

例:
SQL> spool a
SQL> spool
正假脱机到 A.LST
SQL> spool off
SQL> spool
当前无假脱机


exit       退出SQL*PLUS
desc 表名    显示表的结构
show user    显示当前连接用户
show error    显示错误
show all     显示所有68个系统变量值
edit       打开默认编辑器,Windows系统中默认是notepad.exe,把缓冲区中最后一条SQL语句调入afiedt.buf文件中进行编辑
edit 文件名   把当前目录中指定的.sql文件调入编辑器进行编辑

clear screen   清空当前屏幕显示










SQL> show all
appinfo 为 OFF 并且已设置为 "SQL*Plus"
arraysize 15
autocommit OFF
autoprint OFF
autorecovery OFF
autotrace ON EXPLAIN STATISTICS
blockterminator "." (hex 2e)
btitle OFF 为下一条 SELECT 语句的前几个字符
cmdsep OFF
colsep " "
compatibility version NATIVE
concat "." (hex 2e)
copycommit 0
COPYTYPECHECK 为 ON
define "&" (hex 26)
describe DEPTH 1 LINENUM OFF INDENT ON
echo OFF
editfile "afiedt.buf"
embedded OFF
escape OFF
用于 6 或更多行的 FEEDBACK ON
flagger OFF
flush ON
heading ON
headsep "|" (hex 7c)
instance "local"
linesize 80
lno 14
loboffset 1
logsource ""
long 80
longchunksize 80
markup HTML OFF HEAD "<style type='text/css'> body {font:10pt Arial,Helvetica,sa
ns-serif; color:black; background:White;} p {font:10pt Arial,Helvetica,sans-seri
f; color:black; background:White;} table,tr,td {font:10pt Arial,Helvetica,sans-s
erif; color:Black; background:#f7f7e7; padding:0px 0px 0px 0px; margin:0px 0px 0
px 0px;} th {font:bold 10pt Arial,Helvetica,sans-serif; color:#336699; backgroun
d:#cccc99; padding:0px 0px 0px 0px;} h1 {font:16pt Arial,Helvetica,Geneva,sans-s
erif; color:#336699; background-color:White; border-bottom:1px solid #cccc99; ma
rgin-top:0pt; margin-bottom:0pt; padding:0px 0px 0px 0px;} h2 {font:bold 10pt Ar
ial,Helvetica,Geneva,sans-serif; color:#336699; background-color:White; margin-t
op:4pt; margin-bottom:0pt;} a {font:9pt Arial,Helvetica,sans-serif; color:#66330
0; background:#ffffff; margin-top:0pt; margin-bottom:0pt; vertical-align:top;}</
style><title>SQL*Plus Report</title>" BODY "" TABLE "border='1' width='90%' alig
n='center' summary='Script output'" SPOOL OFF ENTMAP ON PREFORMAT OFF
newpage 1
null ""
numformat ""
numwidth 10
pagesize 14
PAUSE 为 OFF
pno 0
recsep WRAP
recsepchar " " (hex 20)
release 1002000100
repfooter OFF  为 NULL
repheader OFF  为 NULL
serveroutput OFF
shiftinout INVISIBLE
showmode OFF
spool OFF
sqlblanklines OFF
sqlcase MIXED
sqlcode 0
sqlcontinue "> "
sqlnumber ON
sqlpluscompatibility 10.2.0
sqlprefix "#" (hex 23)
sqlprompt "SQL> "
sqlterminator ";" (hex 3b)
suffix "sql"
tab ON
termout ON
timing ON
trimout ON
trimspool OFF
ttitle OFF 为下一条 SELECT 语句的前几个字符
underline "-" (hex 2d)
USER 为 "ITMP"
verify ON
wrap : 将换至下一行
SQL>




posted @ 2009-12-01 20:56 小高 阅读(344) | 评论 (0)编辑 收藏
1.port 被占用了
360看看 kill掉
ps -ax
netstat -an


2. host 主机解析出了问题  linux 上


[oracle@oracle bin]$ more /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1         localhost.localdomain    localhost
192.168.2.50    oracle         oracle 
[oracle@oracle bin]$

3. 安装oracle  创库的时候 往往会自动的 创立一个监听器..
比如一台机器上有2个库 ....那么很可能有2个监听器.... listener  1521




NL-00853: undefined command "ls".  Try "help"
LSNRCTL> start
Starting /opt/app/oracle/product/10.2.0/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /opt/app/oracle/product/10.2.0/network/admin/listener.ora
Log messages written to /opt/app/oracle/product/10.2.0/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                01-DEC-2009 20:11:55
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /opt/app/oracle/product/10.2.0/network/admin/listener.ora
Listener Log File         /opt/app/oracle/product/10.2.0/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
LSNRCTL>
LSNRCTL>
LSNRCTL> status 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                01-DEC-2009 20:11:55
Uptime                    0 days 0 hr. 2 min. 38 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /opt/app/oracle/product/10.2.0/network/admin/listener.ora
Listener Log File         /opt/app/oracle/product/10.2.0/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "idmp" has 1 instance(s).
  Instance "idmp", status READY, has 1 handler(s) for this service...
Service "idmpXDB" has 1 instance(s).
  Instance "idmp", status READY, has 1 handler(s) for this service...
Service "idmp_XPT" has 1 instance(s).
  Instance "idmp", status READY, has 1 handler(s) for this service...
The command completed successfully
LSNRCTL>




posted @ 2009-12-01 20:17 小高 阅读(1365) | 评论 (0)编辑 收藏


CREATE OR REPLACE FUNCTION get_hash_val (p_in VARCHAR2)
    RETURN VARCHAR2
  IS
    l_hash   VARCHAR2 (6000);
 BEGIN
    l_hash :=RAWTOHEX(UTL_RAW.cast_to_raw(DBMS_OBFUSCATION_TOOLKIT.md5 (input_string=> p_in)));
     RETURN l_hash;
  END;

posted @ 2009-10-30 23:42 小高 阅读(199) | 评论 (0)编辑 收藏


   在 System.Collections.ArrayList.ToArray(Type type)
   在 log4net.Appender.MemoryAppender.GetEvents()
     在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   在 System.Threading.ThreadHelper.ThreadStart() 

 lock (MemoryAppender){
    MemoryAppender.GetEvents()
   MemoryAppender.clear()
 }
posted @ 2009-10-14 16:21 小高 阅读(663) | 评论 (0)编辑 收藏


TMD 到底什么是异常


程序按照预期的流程运行..正常态
出现未预计到的情况..比如网线断了gddg...文件打开失败...
这个时候 程序是继续执行 还是 其他的选择 或者 退出app ....

实际的情况是 有可能可以恢复,从业务角度出发..我可以重新试图连接...可以重新打开文件或者换一个文件 或者重新创建一个新的文件....
只要不是致命的问题..通常是可以恢复的...没必要退出app...

如果你不捕获 网络断开或者文件无法打开的 异常 ...那么为什么程序退出了呢...因为你没有告诉你的程序 如果出错了应该怎么办...sun 规避风险,你出错了,可能下一步要错误的扣除你工资,为了解除这种不确定执行的巨大风险...那么就把你app shutdown了....

如果你有catch 对于程序来说 你有防备 出现异常的准备...那么真到了异常 那么就看你异常的处理流程 是否奏效....

异常体系....瞎扯淡...就是几个异常类的继承关系(虚拟机内部异常,用户定义异常 ...).....还能有什么 .
无非是 根据不同的出错类型来 包装异常...给这个这种类型的异常 或者 这类问题取一个名字....
当你没看堆栈信息的时候大概可以 判断一下 问题再那里而已.....


异常来跳转 程序是因为 无法预期异常后下步该如何执行 所以跳转...
异常是比较消耗系统资源的.


.net 为什么没有主动要求你 抛出异常....
因为.net的主要架构师 再设计.net时候看到了 很多程序员 一层一层的抛出异常只在最底层  main中截获异常....
那么大量的函数都是 throws 其实根本无意义....所以他再设计的时候就没有采取和java 相同的方式 .



 




posted @ 2009-10-10 01:07 小高 阅读(330) | 评论 (2)编辑 收藏

片段 "


 public LocationInfo(Type callerStackBoundaryDeclaringType)
  {
   // Initialize all fields
   m_className = NA;
   m_fileName = NA;
   m_lineNumber = NA;
   m_methodName = NA;
   m_fullInfo = NA;

#if !NETCF
   if (callerStackBoundaryDeclaringType != null)
   {
    try
    {
     StackTrace st = new StackTrace(true);
     int frameIndex = 0;

     // skip frames not from fqnOfCallingClass
     while (frameIndex < st.FrameCount)
     {
      StackFrame frame = st.GetFrame(frameIndex);
      if (frame != null && frame.GetMethod().DeclaringType == callerStackBoundaryDeclaringType)
      {
       break;
      }
      frameIndex++;
     }

     // skip frames from fqnOfCallingClass
     while (frameIndex < st.FrameCount)
     {
      StackFrame frame = st.GetFrame(frameIndex);
      if (frame != null && frame.GetMethod().DeclaringType != callerStackBoundaryDeclaringType)
      {
       break;
      }
      frameIndex++;
     }

     if (frameIndex < st.FrameCount)
     {
      // now frameIndex is the first 'user' caller frame
      StackFrame locationFrame = st.GetFrame(frameIndex);

      if (locationFrame != null)
      {
       System.Reflection.MethodBase method = locationFrame.GetMethod();

       if (method != null)
       {
        m_methodName =  method.Name;
        if (method.DeclaringType != null)
        {
         m_className = method.DeclaringType.FullName;
        }
       }
       m_fileName = locationFrame.GetFileName();
       m_lineNumber = locationFrame.GetFileLineNumber().ToString(System.Globalization.NumberFormatInfo.InvariantInfo);

       // Combine all location info
       m_fullInfo =  m_className + '.' + m_methodName + '(' + m_fileName + ':' + m_lineNumber + ')';

      }
     }
    }
    catch(System.Security.SecurityException)
    {
     // This security exception will occur if the caller does not have
     // some undefined set of SecurityPermission flags.
     LogLog.Debug("LocationInfo: Security exception while trying to get caller stack frame. Error Ignored. Location Information Not Available.");
    }
   }
#endif
  }





posted @ 2009-10-01 00:02 小高 阅读(311) | 评论 (0)编辑 收藏
C# Preprocessor Directives
http://msdn.microsoft.com/en-us/library/ed8yd1ha.aspx

#if

#else

#elif

#endif

#define

#undef

#warning

#error

#line

#region

#endregion

#pragma

#pragma warning

#pragma checksum



#if NETCF

Console.WriteLine(message);

//System.Diagnostics.Debug.WriteLine(message);

#else

Console.Error.WriteLine(message);

Trace.WriteLine(message);

                System.Diagnostics.Debug.

#endif


posted @ 2009-09-30 13:05 小高 阅读(151) | 评论 (0)编辑 收藏


时间

select
trunc(86400*
  (to_date('2009-1-1 23:15:01','yyyy-mm-dd hh24:mi:ss') -
 to_date('2009-1-1 23:10:00','yyyy-mm-dd hh24:mi:ss'))
 )
from dual ;

posted @ 2009-09-12 09:19 小高 阅读(359) | 评论 (0)编辑 收藏
在启动时关闭sendmail 服务 [其它服务也一样]
posted by JianNeng in Opensource 在启动时关闭sendmail- -

对其他的服务可以采取同样的措施。 

  而对于那些不是从inetd启动的服务,则通过命令来关闭,例如需要关闭sendmail服务,则:

/etc/rc.d/init.d/sendmail stop

  然后再设置其不在系统启动时启动:

chkconfig -levels 12345 sendmail off

[root@oracle xinetd.d]# chkconfig --level 123456  sendmail off
[root@oracle xinetd.d]# 
linux 关机 

[root@oracle ~]# shutdown -h now

posted @ 2009-09-07 08:22 小高 阅读(860) | 评论 (0)编辑 收藏
     摘要: plsql developer plsql 调试无法 ..包没加入所有的函数的定义到 包头文件定义.   阅读全文
posted @ 2009-08-25 20:18 小高| 编辑 收藏
     摘要: 为什么log4j 显示行号
(2) 建立一个Throwable的对象来取得当前运行堆栈的快照...Throwable.fillInStackTrace();
(3) 从抛出的Throwable对象中,来分析出当前log信息的行号...  阅读全文
posted @ 2009-08-18 20:21 小高 阅读(646) | 评论 (0)编辑 收藏
     摘要: 其实,很简单,并不是因为系统打了补丁的问题,而是因为VS 2008打了补丁,导致没法删除,可以在“添加/删除程序”面板中,选中上方的“显示更新”,然后找到VS 2008,下面多多少少会挂了几个更新或者补丁,全部先删掉,然后再删VS 2008,熟悉的维护界面又回来了,输入序列号,OK,正常使用~~~  阅读全文
posted @ 2009-07-17 14:31 小高 阅读(2036) | 评论 (2)编辑 收藏
     摘要: lsnrctl services  阅读全文
posted @ 2009-02-26 20:47 小高 阅读(3796) | 评论 (1)编辑 收藏
     摘要: sqlplus Xdmp/Xdmp@127.0.0.1:1521/Xdmp
SQL> conn sys/oracle @itmp_rac as sysdba  阅读全文
posted @ 2009-02-24 16:04 小高 阅读(1638) | 评论 (3)编辑 收藏
     摘要: 左连接 .如果一边的没有记录, nvl (右边,0) 否则会造成整列无法,无数据.

select d.crunit_ - nvl( a.stkamt_ ,0)
from dl_fundetf d ,
(select c.stkcode_, c.exchgcode_,c.stkamt_ ,c.stkcost_
from acc_proflstk c
where 1=1
and c.fundid_ = '55'
and c.cellid_ = '50001'
and c.proflid_ = '080724113732'
) a
where 1=1
and d.exchgcode_ = 'SH'
and d.fundid_ = '510051'
and a.exchgcode_ (+)= d.exchgcode_
and a.stkcode_ (+)= d.fundid_   阅读全文
posted @ 2009-02-10 15:07 小高 阅读(772) | 评论 (0)编辑 收藏
     摘要: 1.作用: 屏蔽方法名 ,灵活性动态性函数指针

2 .使用:

定义一个委托: 和一个类一样的

delegatevoid Del (int x);

或者

delegatevoid Del (T x);

定一个委托变量和赋值

Main(){

Del d = obj.DoWork; 实例方法或者静态方法都可以

}
  阅读全文
posted @ 2009-02-01 11:06 小高 阅读(217) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2008-12-04 16:31 小高 阅读(223) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2008-11-04 21:52 小高 阅读(168) | 评论 (0)编辑 收藏
     摘要: 检查客户机器上的输入法区域设置。如果默认输入法不是中文,则先调用一下方法,切换到中文。
Top

  阅读全文
posted @ 2008-10-22 20:02 小高 阅读(425) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2008-10-18 12:33 小高 阅读(1475) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2008-10-11 21:21 小高 阅读(1242) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2008-10-07 08:15 小高 阅读(321) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2008-10-07 08:09 小高 阅读(1658) | 评论 (2)编辑 收藏
     摘要:   阅读全文
posted @ 2008-10-07 07:37 小高 阅读(204) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2008-10-06 17:58 小高 阅读(278) | 评论 (0)编辑 收藏



SQL> exec dbms_stats.gather_table_stats('IDMP','TEST_GDDG');

PL/SQL 过程已成功完成。

SQL>
select  num_rows from dba_tables
   where owner='IDMP' and table_name ='TEST_GDDG';


  NUM_ROWS
----------
       182

SQL> truncate table test_gddg
  2  ;

表被截断。

SQL> select  num_rows from dba_tables
  where owner='IDMP' and table_name ='TEST_GDDG';


  NUM_ROWS
----------
       182

SQL> exec dbms_stats.gather_table_stats('IDMP','TEST_GDDG');

PL/SQL 过程已成功完成。

SQL>

select  num_rows from dba_tables
    where owner='IDMP' and table_name ='TEST_GDDG';


  NUM_ROWS
----------
         0

SQL>


另外 补充
http://www.dbanotes.net/database/oracle_dbms_stats.html
导出和回复统计信息

用 DBMS_STATS 构造 STATS 环境

dbms_stats VS analyze



http://yumianfeilong.com/2007/05/26/dbms_stats-vs-analyze/



众所周知,Table是分区的时候,analyze根据所有partition上的已有的统计信息“计算”出整个表级别上的统计信息;而dbms_stats是实际去计算整个表范围的统计信息,因此表级别的统计信息比analyze更精确,反映表上真实的情况.




posted @ 2008-10-05 10:36 小高 阅读(2045) | 评论 (0)编辑 收藏
     摘要: iSQL*Plus URL: -----一般重装 都没问题
http://localhost:5560/isqlplus
系统服务:

iSQL*Plus Application Server
F:\oracle\product\10.2.0\db_1\bin\isqlplussvc.exe

从装会有 问题 ,特别是 主机名修改了.......比较麻烦的
Enteprise Manager 10g Database Control URL:
http://localhost:5500/em
看我修理 .......的文章 ............

OracleDBConsoleidmp
F:\oracle\product\10.2.0\db_1\bin\nmesrvc.exe  阅读全文
posted @ 2008-10-04 22:05 小高 阅读(665) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2008-09-29 17:26 小高 阅读(3923) | 评论 (2)编辑 收藏
     摘要:   阅读全文
posted @ 2008-09-29 11:54 小高 阅读(2166) | 评论 (0)编辑 收藏
性能上, 没什么太大的区别...
但是 pro *C  需要外部的编译和调试好.扩展性更强....

如果大家都执行了一次,那么性能一改是一样的....
posted @ 2008-09-28 10:44 小高 阅读(178) | 评论 (0)编辑 收藏
     摘要: 1. Upgrade to the newest version legally and without paying money
1。合法升级到最新版本却不花一分钱
2. Have the latest version of the operating system run faster than the previous version on the same hardware
2。同一个硬件平台上最新的操作系统却比老的更快。  阅读全文
posted @ 2008-09-19 07:18 小高 阅读(303) | 评论 (0)编辑 收藏
     摘要:   阅读全文
posted @ 2008-09-18 22:30 小高 阅读(628) | 评论 (0)编辑 收藏
     摘要: 3个方式配合解决这个问题  阅读全文
posted @ 2008-09-18 21:48 小高 阅读(1418) | 评论 (0)编辑 收藏
     摘要: import .
anthoer name
资源 释放.关闭啊网络,文件 ,.... IDisposable 接口  阅读全文
posted @ 2008-09-18 13:53 小高 阅读(175) | 评论 (0)编辑 收藏

导航

<2008年9月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

统计

常用链接

留言簿(3)

随笔分类(352)

收藏夹(19)

关注的blog

手册

搜索

积分与排名

最新评论

阅读排行榜

评论排行榜