上一页 1 ··· 4 5 6 7 8 9 10 11 12 下一页
  2013年9月18日
摘要: 写出float x 与“零值”比较的if语句 请写出 float x 与“零值”比较的 if 语句: const float EPSINON = 0.00001; if ((x >= - EPSINON) && (x <= EPSINON) 不可将浮点变量用“==”或“!=”与数字比较,应该设法转化 阅读全文
posted @ 2013-09-18 10:39 any91 阅读(1462) 评论(0) 推荐(0) 编辑
摘要: 分别给出BOOL,int,float,指针变量 与“零值”比较的 if 语句(假设变量名为var) 解答: BOOL型变量:if(!var) int型变量: if(var==0) float型变量: const float EPSINON = 0.00001; if ((x >= - EPSINON) && (x =”或“<=”形式。如果写成if (x == 0.0),则判为错,得0分。 阅读全文
posted @ 2013-09-18 10:32 any91 阅读(323) 评论(0) 推荐(0) 编辑
摘要: 于一个字节(8bit)的变量,求其二进制表示中“1”的个数,要求算法的执行效率尽可能地高。请点击“我要发言”,提交您的解法或者问题。我要看答案大多数的读者都会有这样的反应:这个题目也太简单了吧,解法似乎也相当地单一,不会有太多的曲折分析或者峰回路转之处。那么面试者到底能用这个题目考察我们什么呢?事实上,在编写程序的过程中,根据实际应用的不同,对存储空间或效率的要求也不一样。比如在PC上的程序编写与在嵌入式设备上的程序编写就有很大的差别。我们可以仔细思索一下如何才能使效率尽可能地“高”。【解法一】可以举一个八位的二进制例子来进行分析。对于二进制操作,我们知道,除以一个2,原来的数字将会减少一个0 阅读全文
posted @ 2013-09-18 10:28 any91 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 题目:已知strcpy函数的原型是:char*strcpy(char*strDest,constchar*strSrc);1.不调用库函数,实现strcpy函数。2.解释为什么要返回char*。解说:1.strcpy的实现代码char*strcpy(char*strDest,constchar*strSrc){if((strDest==NULL)||(strSrc==NULL))//[1]throw"Invalidargument(s)";//[2]char*strDestCopy=strDest;//[3]while((*strDest++=*strSrc++)!= 阅读全文
posted @ 2013-09-18 10:22 any91 阅读(1349) 评论(0) 推荐(0) 编辑
摘要: 试题4:void GetMemory( char *p ){ p = (char *) malloc( 100 );}void Test( void ) { char *str = NULL; GetMemory( str ); strcpy( str, "hello world" ); printf( str );} 试题5:char *GetMemory( void ){ char p[] = "hello world"; return p; }void Test( void ){ char *str = NULL; str = GetMemory( 阅读全文
posted @ 2013-09-18 10:08 any91 阅读(790) 评论(0) 推荐(0) 编辑
  2013年9月17日
摘要: function cmpLoginIP($a, $b){ return bindec(decbin(ip2long($a['loginIp']))) > bindec(decbin(ip2long($b['loginIp'])));}function cmpLoginIPDesc($a, $b){ return bindec(decbin(ip2long($b['loginIp']))) > bindec(decbin(ip2long($a['loginIp'])));} 阅读全文
posted @ 2013-09-17 10:29 any91 阅读(698) 评论(0) 推荐(0) 编辑
  2013年9月5日
摘要: 起因:今天在调试Ucenter的同步登陆和同步登出的过程中,浏览器突然出现以下错误提示:Your browser sent a request that this server could not understand.Size of a request header field exceeds server limit.开始是以为P3P协议设置cookie的问题,查阅了P3P的文档,没有相关的条目。经过不懈的搜索,终于发现原来是Apache中资源使用限制的设置问题。技术背景:Apache中“资源使用限制”就是要限制用户对网站特定资源(如目录、服务器硬件等)的访问。相关指令包括:LimitRe 阅读全文
posted @ 2013-09-05 17:17 any91 阅读(1534) 评论(0) 推荐(0) 编辑
摘要: var jsonProps = { "dispMode":dispMode, "autoRun":autoRun, "clientPath":encodeURI(clientPath), "remark":encodeURI(remark) }; $.ajax({ url:"./process/writeTask.php", data:"proType=setTask&taskId=" + taskId + "&props=" + JSON 阅读全文
posted @ 2013-09-05 10:19 any91 阅读(504) 评论(0) 推荐(0) 编辑
  2013年8月29日
摘要: $fileNames = array(); // 是数组,不是字符串$filesJSON = json_encode($fileNames);// 转成json格式var oldFiles = new Array();//oldFiles = '';// 这样oldFiles成字符串了,而不是json数据oldFiles = JSON.parse('');// JSON格式即为数组格式------------------------------------------------------------------------------------------ 阅读全文
posted @ 2013-08-29 16:42 any91 阅读(1163) 评论(0) 推荐(0) 编辑
摘要: 在php.ini中修改如下变量,如要限制为100Mupload_max_filesize = 100Mpost_max_size = 100M重启Apache 阅读全文
posted @ 2013-08-29 14:22 any91 阅读(181) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 下一页