re: 服务器开发语言比较[未登录] eric 2016-06-29 17:18
java和erlang不用吗
thanks for DXF merger tools
re: Btree算法实现代码[未登录] eric 2013-01-16 14:14
可以实现动态确定btree子树的算法吗?
re: 两个小问题[未登录] Eric 2012-10-01 17:49
如果是要求效率最佳,使用位运算最快:
问题一:if (x&(x-1)==0) 则是2的N次方
问题二:float f = (float)(v);
return 1 << ((*(unsigned int*)(&f) >> 23) - 126);
问题二的解法是网上看来的,因为浮点数前1+8位记录了符号和指数,求出指数再用移位得到最小的2的N次方
还看到另一种解法:fb 7的malloc.c里面的实现:
static inline size_t
pow2_ceil(size_t x)
{
x--;
x |= x >> 1;
x |= x >> 2;
x |= x >> 4;
x |= x >> 8;
x |= x >> 16;
#if (SIZEOF_PTR == 8)
x |= x >> 32;
#endif
x++;
return (x);
}
这个似乎效率也不差,而且没有bug,以上供楼主参考
Win和Mac上支持插件机制的编辑器或者IDE多了去了,只是不像某些人天天挂在嘴上装逼罢了。
另外,拿一个编辑器跟IDE比较,本身就是一种特傻逼的行为。
re: 我的编辑器 0.80[未登录] Eric 2011-11-01 10:12
@megax
可能vim用惯了, 觉得CTRL+N挺好用的, 自动完成和选择都用同一个组合键. 到了vs里也不自觉的按.
话说楼上的太打击人了. 不过貌似不知道textmate的作者已经赚得盆满钵满?
re: 我的编辑器 0.80[未登录] Eric 2011-10-29 22:29
就这种玩意也想着卖钱?!脑袋被门夹了。。。
re: 我的编辑器 0.80[未登录] Eric 2011-10-29 11:52
挺不错的
自动完成的j, k设定好像不太好, 因为按了ALT+ENTER后就没法输入j k继续匹配了,感觉蛮诡异的. 可以借鉴一下vim的CTRL+N.
原来是viksoe的作品,看介绍说是因为作者受不了unix下的vi、make等一坨一坨的远古神器,干脆自己捣鼓出个remote ide。 牛呀。
只有这个是对的
%s/\d\@<=\(\(\d\d\d\)\+\d\@!\)\@=/,/g
:)
DestroyWindow invalidates the window handle to the dialog box, so any subsequent calls to functions that use the handle return error values. To prevent errors, the dialog box procedure should notify the owner that the dialog box has been destroyed. Many applications maintain a global variable containing the handle to the dialog box. When the dialog box procedure destroys the dialog box, it also sets the global variable to NULL, indicating that the dialog box is no longer valid.
The dialog box procedure must not call the EndDialog function to destroy a modeless dialog box.
原因很简单,每次你检测完一个数都需要把sgnl标志重置,如果你吧sgnl换成bool型就会更清晰一些,其实你吧sgnl=-1换成sgnl=1也是可以的,而且这样更加符合你前面初始化sgnl=1的定义。
而且,其实连sgnl,a什么的都可以不需要的,我对你的程序做了些精简:
#include <iostream>
using namespace std;
int main()
{
int start=99; //给出的数据,求其不重复数
int T,cur,last;
for ( int i=start+1;i<100000;i++ ) {
T=i; cur=0; last=-1;
while ( T!=0 ) {
cur=T%10;
T/=10;
if ( cur==last ) {
break;
}
last=cur;
}
if ( T==0 ) {
cout<<i<<endl;
return 0;
}
}
}
re: FanType 0.1版本[未登录] Eric 2011-05-11 21:36
名字我起的,不过还是说句,慎重啊,哈哈。
p.s.脚本换回lua了?
re: 迅雷笔试题(C++)[未登录] Eric 2010-09-26 21:55
@马赛克007
你说“我的达到要求了。关键问题是如果题目是:有n个数,都是取自1--N(n<N)时候,该如何排序了? ”
关键是如果题目是这样,你的程序就错了,还是失败。
re: 迅雷笔试题(C++)[未登录] Eric 2010-09-25 23:51
其实题目都说了是‘有N个大小不等的自然数(1--N)’,还要‘小到大排序’,那只有一种情况就是从1递增到N,所以可以不管原来如何直接输出1-N就行了
check file "portlist.ini"
re: mapInfo文件格式详解[未登录] Eric 2009-11-13 16:00
怎么反汇编 MapInfo 的插件工具?
@Eric
我想了下,条件判断还是可以去掉的:
int mask[33]={0,0x1,0x2,0x4,0x8,0x10......};
void fun( int & a , int & b , int n )
{
int c=(a^b)&mask[n];
a^=c;
b^=c;
}
你可以试试这样
int mask[32]={0x1,0x2,0x4,0x8,0x10...........};
void fun( int & a , int & b , int n )
{
int c=mask[n-1];
if ( ( a&c )!=( b&c ) ) {
a=a^c;
b=b^c;
}
}
好东西,我收藏了,我正好在写一个google reader的dump工具
可以把google reader的东西download到psp上
好像还是不能下载哦.
请问能不能直接发一份给我呢?
5577999@gmail.com
万分感谢~
C++ "*"三种意思:
1.乘号
2.指针运算符
3.?
电话面试,呵呵,
这就是海选拉,不过,没有出学校吧,很少听说过电话面试的,
电话面试的公司正常情况下会是好公司吧
香港名店街那里de家,在地铁一号线几号出口啊?还有是那一站啊
re: VC6下使用STLPort[未登录] Eric 2008-01-10 20:31
@hh
请问您这个问题是怎么解决的?,我也有这个问题@@
谢谢:)
re: C++随笔分类列表(高级)[未登录] eric 2007-12-06 12:57
顶,大哥我转贴了
我也非常感谢!正为这个莫名其妙的提示烦恼中,及时啊
标准英文简历工作经验时按照倒序,也就是最近的工作经验在前面