摘要: EEEEEEFFCCFFFF66FFFF00FFDDDDDDFFCCCCFF66CCFF00CCCCCCCCFFCC99FF6699FF0099BBBBBBFFCC66FF6666FF0066AAAAAAFFCC33FF6633FF0033999999FFCC00FF6600FF0000888888CCCCFFCC66FFCC00FF777777CCCCCCCC66CCCC00CC666666CCCC99CC6699CC0099555555CCCC66CC6666CC0066444444CCCC33CC6633CC0033333333CCCC00CC6600CC000022222299CCFF 阅读全文
posted @ 2012-12-06 22:28 CodingMonkey 阅读(648) 评论(0) 推荐(0) 编辑
摘要: 最近进行wxpython编程,不晓得什么原因,我的win32系统打不开Ulipad,重装无数次都无济于事,IDLE用得又不爽,pythonwin也用了,后来感觉Wing IDE相对来说比较好。虽然是商业软件, 不过, 嘿嘿,在中国神马都是浮云。。 破解方法如下:1.官网下载Wing IDE 4.12.系统时间设置下, 向前调一个月或者更多。3.安装Wing IDE 4.1 ,获得trial license(试用版, 最多可使用30天)4.关闭Wing IDE 4.1,下载破解补丁。5.把破解补丁abstract.pyo移动到X:\Wing IDE 4.1\bin\2.5\src\proces. 阅读全文
posted @ 2012-12-01 12:42 CodingMonkey 阅读(462) 评论(0) 推荐(0) 编辑
摘要: 摘要:在平时的编程工作中,大多数程序员很少会关心细节问题,本文作者跨越多个语言,为大家总结了20条常规陷阱,并提供了很好的解决方案,供大家参考学习。不管你现在的编程技能有多么的高超,曾经你也是个亦步亦趋,不断的学习的初学者。在编程这条曲折的道路上,我想你肯定犯过一些低级的错误、遇见过一些普通的编码陷阱。本文作者跨越多个语言,为大家总结了20条常规陷阱,并提供了解决方案。JavaScript篇1.不必要的DOM操作例如下面这段代码://anti-pattern for(vari=0;i<100;i++){ varli=$("<li>").html(" 阅读全文
posted @ 2012-11-25 19:13 CodingMonkey 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 计数排序, 比较适合数值跨度比较小的,也就是数组中最大值减去最小值得到的值尽量小, 同时数组元素又比较多的情况下用计数排序效率比较高,同时,计数排序算法基友稳定性。计数排序的时间复杂度为O(n),计数排序是用来排序0到100之间的数字的最好的算法。算法的步骤如下: 1.找出待排序的数组中最大和最小的元素 2.统计数组中每个值为i的元素出现的次数,存入数组C的第i项 3.对所有的计数累加(从C中的第一个元素开始,每一项和前一项相加) 4.反向填充目标数组:将每个元素i放在新数组的第C(i)项,每放一个元素就将C(i)减去1下面直接贴个C语言实现的代码:#include <stdio.h&g 阅读全文
posted @ 2012-11-17 16:36 CodingMonkey 阅读(1890) 评论(0) 推荐(0) 编辑
摘要: MySQL会出现中文乱码的原因不外乎下列几点:1.server本身设定问题,例如还停留在latin12.table的语系设定问题(包含character与collation)3.客户端程式(例如php)的连线语系设定问题强烈建议使用utf8!!!!utf8可以兼容世界上所有字符!!!!一、避免创建数据库及表出现中文乱码和查看编码方法1、创建数据库的时候:CREATE DATABASE `test`CHARACTER SET 'utf8'COLLATE 'utf8_general_ci';2、建表的时候 CREATE TABLE `database_user` ( 阅读全文
posted @ 2012-11-03 20:43 CodingMonkey 阅读(402) 评论(0) 推荐(0) 编辑
摘要: 由于项目数据库要转到mysql,所以今天花了个把小时对python-mysql用法基本上了解了下,总结如下: 先来看一个代码:# -*- coding: utf-8 -*-import MySQLdb as mdbimport sys#将con设定为全局连接con = mdb.connect ('localhost', 'root', '', 'test');with con: #获取链接的cursor,只有获取了cursor, 我们才能进行各种操作 cur = con.cursor() #创建一个数据表 writers(id , 阅读全文
posted @ 2012-11-02 23:11 CodingMonkey 阅读(276) 评论(0) 推荐(0) 编辑
摘要: /* * Killing other processes */ #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <sys/wait.h> #include <sys/types.h> int main() { pid_t child; int status, retval; if((child = fork()) < 0) { perror ("fork"); exit (EXIT_FAILURE); } if(child 阅读全文
posted @ 2012-10-30 21:34 CodingMonkey 阅读(246) 评论(0) 推荐(0) 编辑
摘要: 通过execve简单的调用,下面我们要调用 “ls”来显示我当前目录下的文件 :/* * execve */ #include <unistd.h> #include <stdio.h> #include <stdlib.h> int main() { char *args[] = {"/bin/ls", NULL}; if(execve ("/bin/ls", args, NULL) == -1) { perror ("execve"); exit(EXIT_FAILURE); } puts(&q 阅读全文
posted @ 2012-10-27 21:36 CodingMonkey 阅读(1487) 评论(0) 推荐(0) 编辑
摘要: /* * simple fork usage */ #include <unistd.h> #include <stdio.h> #include <stdlib.h> int main() { pid_t child; if ((child = fork()) == -1) { perror("fork"); exit(EXIT_FAILURE); } else if(child == 0) { puts("in child"); printf ("\tchild pid = %d\n", get 阅读全文
posted @ 2012-10-26 18:42 CodingMonkey 阅读(182) 评论(0) 推荐(0) 编辑
摘要: system函数声明为: int system(const char *string); string为你要输入的命令。 实例如下: /* * Demonstrate the system() call */ #include <stdio.h> #include <stdlib.h> int main() { int retval;//retval is the return value of the system call retval = system("ls -l"); if(retval == 127) { fprintf(stderr, 阅读全文
posted @ 2012-10-26 17:38 CodingMonkey 阅读(179) 评论(0) 推荐(0) 编辑