09 2012 档案
虚拟机the virtual machine is in use by an application on your host computer解决
摘要:运行着vm的时候如果host忽然关机或者重启的话,再打开虚拟机会提示the virtual machine is in use by an application on your host computer解决方法:进入虚拟机目录删除.lck文件和目录. 阅读全文
posted @ 2012-09-18 09:37 hcu5555 阅读(390) 评论(0) 推荐(0)
VIM中常用的替换模式总结
摘要:1,简单替换表达式替换命令可以在全文中用一个单词替换另一个单词::%s/four/4/g“%” 范围前缀表示在所有行中执行替换。最后的 “g” 标记表示替换行中的所有匹配点。如果仅仅对当前行进行操作,那么只要去掉%即可如果你有一个象 “thirtyfour” 这样的单词,上面的命令会出错。这种情况下,这个单词会被替换成”thirty4″。要解决这个问题,用 “\<” 来指定匹配单词开头::%s/\<four/4/g显然,这样在处理 “fourty” 的时候还是会出错。用 “\>” 来解决这个问题::%s/\<four\>/4/g如果你在编码,你可能只想替换注释中的 阅读全文
posted @ 2012-09-06 17:54 hcu5555 阅读(294) 评论(0) 推荐(0)
char(串口)输出转换为double、float型
摘要:avr gcc中的printf函数不支持%f输出注意在gcc中float double型数据一律处理为单精度(4 bytes)有两种做法:1、将浮点数分解为4个字节,分别送出,接收端再这4个字节合并转化为将浮点数示例如下:#include<stdio.h>typedefunion{floatf;unsignedcharu[4];}Float4Byte;intmain(void){Float4Bytem1,m2;m1.f=-1.2356;m2.u[0]=m1.u[0];//假设这里经过了一个传输过程.m2.u[1]=m1.u[1];m2.u[2]=m1.u[2];m2.u[3]=m1 阅读全文
posted @ 2012-09-05 11:56 hcu5555 阅读(2012) 评论(0) 推荐(0)
二进制的打印
摘要:下面是摘抄网友的的代码void fun(int i, char *res){ int j = 0; while(i){ *(res + j) = i % 2 + '0'; i /= 2; ++j; } *(res + j) = '\0'; strrev(res);}这个感觉太冗长了。而后是这个:#include <iostream>#include <bitset>#include <string>void printBinary(int n) { std::bitset<32> bits(n); for (i.. 阅读全文
posted @ 2012-09-03 13:35 hcu5555 阅读(332) 评论(0) 推荐(0)
c各种打印集合
摘要:包括printf ,scanf等常用的和不常用的打印集合 阅读全文
posted @ 2012-09-03 11:41 hcu5555 阅读(246) 评论(0) 推荐(0)