上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 25 下一页
摘要: 在上看到Sublime Text 2 ,恰好被Vim折腾得不行了。于是换下口味。该软件还在发展当中,是共享软件,但是作者很厚道,更TC一样并没有功能上的删减。该软件暂时不支持中文,但有强大的Package扩展功能。安装 Package管理插件http://wbond.net/sublime_packages/package_control/installationClick the Preferences > Browse Packages… menu entryBrowse up a folder and then into the Installed Packages folderD 阅读全文
posted @ 2012-03-06 20:11 westfly 阅读(592) 评论(0) 推荐(0) 编辑
摘要: 打开codeblocks出现错误,但是不影响使用。不知道是哪里出了问题。 阅读全文
posted @ 2012-03-05 10:37 westfly 阅读(958) 评论(0) 推荐(0) 编辑
摘要: 又在http://www.codecademy.com/泡了一下午,编写了一大堆白痴的代码。看看成绩突然想到自己做的Javascript,又突然想到自己居然知道它该怎么用,与C/C++有什么区别?或许以前做的初衷是想弄清楚一门语言背后设计的思想吧。最近《Javascript 面向对象编程》和《再谈javascript面向对象编程》或许可以一窥其中的特色。 阅读全文
posted @ 2012-03-03 20:03 westfly 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 由于最近新重新安装了Win7,恰逢Win8消费者预览版发布,但是被其无法卸载吓到了,于是尝试在虚拟机中安装。主要的内容可以参考《VirtualBox虚拟机安装Win8消费者预览版》(图文并茂已经很详细了)准备工作VirtualBox 最新版4.1.8已经支持Win8的安装.Win8 点击下载Windows 8 消费者预览版 简体中文版(32位/64位)产品密钥: DNJXJ-7XBW8-2378T-X22TX-BKG7J依照Sina给的教程,可能出现0xc0000260错误,解决的方法参考《虚拟机安装Windows 8出现0xc0000260错误的解决方法》,主要是两个设置。还可能出现0x00 阅读全文
posted @ 2012-03-03 19:54 westfly 阅读(460) 评论(0) 推荐(0) 编辑
摘要: 有如下的代码 while(1) { printf("Command :"); gets(buf); send(sockfd,buf,MAX_BUF,0); n = recv(sockfd,buf,MAX_BUF,0); buf[n]='\0'; printf("data receive:%s\n",buf); if(0==strncmp(buf,"quit",4)); break; }结果总是只执行一次,搞得人很崩溃。后来发现if后面有个";"break... 阅读全文
posted @ 2012-03-01 20:33 westfly 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 在《Fibonacci数计算中的两个思维盲点及其扩展数列的通用高效解法》提到了一维的求解m^n.算是比较快的,作个备份。最基本的求解,没有考虑为负数的情况,下同int pow0(int m,unsigned int n){ int result = 1; while(n >0) { result *= m; --n; } return result;}改进版求解迭代int pow1(int m, unsigned int n){ int result = 1; int factor = m; while (n) { ... 阅读全文
posted @ 2012-02-29 20:45 westfly 阅读(624) 评论(0) 推荐(0) 编辑
摘要: 编译一份源码,提示有错误error: invalid conversion from ‘__pthread_t*’ to ‘pid_t’initializing argument 1 of ‘int kill(pid_t, int);定位到源码kill((p->_pNodeBuf[p->_cur_num-1])._th_id,SIGKILL);即kill的参数类型为pid_t,而实际上传递的为pthread_t,这种情况下gcc报错提示无法转换。在网上搜索到有个函数pthread_kill(pthread_t pid,int sig);替换下即可。但是有个问题,pthread_t 阅读全文
posted @ 2012-02-25 14:38 westfly 阅读(878) 评论(0) 推荐(0) 编辑
摘要: 从项目webalizer抓取到一个有用的关于儒略日(Julian Day)的函数。关于"儒略日数"介绍参考http://blog.sina.com.cn/s/blog_53027c620100mtii.html/*****************************************************************//**//* JDATE - Julian date calculator *//**//* Calculates the number of days since Jan 1, 0000. ... 阅读全文
posted @ 2012-02-25 09:58 westfly 阅读(668) 评论(0) 推荐(0) 编辑
摘要: 看到一篇中文文章《C/C++, Java: Java的new[]与C++的new[]》很有意思。public class Test extends JPanel { private static final long serialVersionUID = 4767050156491994899L; public static void main(String[] args) { AnimApp[] array = new AnimApp[3]; // 没有执行构造函数, 在这里只是申请了空间. array[0] = new AnimApp(3); // ... 阅读全文
posted @ 2012-02-20 20:54 westfly 阅读(698) 评论(0) 推荐(0) 编辑
摘要: 看到一篇文章《Extra, Extra - Read All About It: Nearly All Binary Searches and Mergesorts are Broken》说的是很多二分查找都有bug,包括《编程珠玑》上给出的实现。这个bug也曾经出现在java.util中。典型的Java版实现是int binarySearch(int a[], int key, int length) { int low = 0; int high = length - 1; while (low <= high) { int mid = (low + high) / 2; int m 阅读全文
posted @ 2012-02-19 09:19 westfly 阅读(493) 评论(0) 推荐(0) 编辑
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 25 下一页