【题目】
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.
Here, we will use the integers 0, 1, and 2 to represent the color red, white, and...
分类:
其他好文 时间:
2014-06-07 01:17:49
阅读次数:
269
60款开源云应用【Part 1】(60 Open Source Apps You Can Use in the Cloud)
本篇翻译自http://www.datamation.com/open-source/60-open-source-apps-you-can-use-in-the-cloud-1.html,原作者Cynthia
Harvey。
本人对云服务也是没有了解太多,希...
分类:
移动开发 时间:
2014-06-05 09:57:12
阅读次数:
609
1、网络中进程之间如何通信?
本地的进程间通信(IPC)有很多种方式,但可以总结为下面4类:
消息传递(管道、FIFO、消息队列)
同步(互斥量、条件变量、读写锁、文件和写记录锁、信号量)
共享内存(匿名的和具名的)
远程过程调用(Solaris门和Sun RPC)
但这些都不是本文的主题!我们要讨论的是网络中进程之间如何通信?首要解决的问题是如何唯一标识一个进程,否则...
分类:
系统相关 时间:
2014-06-05 07:39:53
阅读次数:
376
预备知识:
关于http协议的基础请参考这里。
关于socket基础函数请参考这里。
关于python网络编程基础请参考这里。
废话不多说,前面实现过使用linux c 或者python 充当客户端来获取http 响应,也利用muduo库实现过一个简易http服务器,现在来实现一个python版的简易http服务器,代码改编自http://www.cnblogs.com/v...
分类:
编程语言 时间:
2014-06-05 04:17:57
阅读次数:
463
系统centOS-6.3
方法操作很简单,如下:
# /etc/init.d/mysql stop
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root mysql
# mysql>use mysql ;
mysql> UPDATE user SET Password=PAS...
分类:
数据库 时间:
2014-06-05 02:54:40
阅读次数:
331
第一次使用session,需要:
$this->load->library('session');
的同时,还需要修改配置文件:config.php 找到 $config['encryption_key'] = ‘’
将$config['encryption_key'] 的内容随便设置,就可以用了。
附录:
1.添加session内容:
$this->session->set_us...
分类:
其他好文 时间:
2014-06-05 01:18:12
阅读次数:
201
大家都知道php 的核心函数 sendmail 可以发送邮件,我在ubuntu 下测试可以实现,但在window 2003 无法发送邮件,非常郁闷,只好换了一种方法,借用php 的socket 功能可以发送邮件。
首先我们需要导入以下几个类:
phpmailer.class.php
<?php
/**
* 课程预约课程报名
*/
header ( "Conten...
分类:
Web程序 时间:
2014-06-05 00:39:23
阅读次数:
2073
The Blocks Problem
Background
Many areas of Computer Science use simple, abstract domains for both analytical and empirical studies. For example, an early AI study of planning and robo...
分类:
其他好文 时间:
2014-06-04 21:55:37
阅读次数:
313
接着前面博客文章socket.io+angular.js+express.js做个聊天应用(二)
首先开发之前先介绍下bower,它是用来管理前端类库的(具体介绍,安装可看http://blog.csdn.net/edagarli/article/details/26359535)
justhacker@justhacker-ThinkPad-Edge-E440:~/proje...
分类:
Web程序 时间:
2014-06-03 04:06:16
阅读次数:
299
异常python的socket模块实际上定义了4种可能出现的异常:1)与一般I/O
和通信问题有关的socket.error;2)与查询地址信息有关的socket.gaierror;3)与其他地址错误有关的socket.herror;4)与在一个socket上调用settimeout()后,处理超时...
分类:
编程语言 时间:
2014-05-31 18:42:49
阅读次数:
220