用c语言实现
#include
#include
#include
using namespace std;
typedef struct node
{
char x;
struct node *next;
}chan;
chan *root = new chan;
char a[100010];
int main()
{
while(scanf("%...
分类:
编程语言 时间:
2014-04-29 13:47:20
阅读次数:
358
UITextView上如何加上类似于UITextField的placeholder呢,其实在UITextView上加上一个UILabel,然后再实现
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text这个代理方法就可以了。
...
分类:
移动开发 时间:
2014-04-29 13:42:21
阅读次数:
337
Vagrant进阶:搭建简易Python,PHP开发环境...
分类:
编程语言 时间:
2014-04-29 13:34:21
阅读次数:
332
本文出自:http://blog.csdn.net/svitter
原题地址:http://acm.hdu.edu.cn/showproblem.php?pid=3790
另外写文章之前偷懒一下,发现一个很好的入门python教程!:http://woodpecker.org.cn/abyteofpython_cn/chinese/
题意:在最短路径的前提下,添加了一个最短路径中权值最小的要...
分类:
其他好文 时间:
2014-04-29 13:32:22
阅读次数:
285
背景:
写了个程序,主要实现的功能为主线程创建两个子线程,之后主线程进入等待事件的循环。子线程1对临界资源cnt的值减2并输出cnt的值。子线程2对cnt的值加1并输出cnt的值,且当cnt为50的时候触发事件对象hend_even,子进程2退出。主线程收到hend_even后杀死子线程1,之后进入scanf阻塞。。。
代码示例:
#include
#include
DWORD WIN...
分类:
编程语言 时间:
2014-04-29 13:31:21
阅读次数:
377
jQuery 滑动改变价格演示 XML/HTML Codesection id="content" > div class="cube"> div class="a">div> div class="b">div> div class="c">div> div class="d">div> div id="slider-range-min">div> div> input type...
分类:
Web程序 时间:
2014-04-29 13:27:21
阅读次数:
595
floyd求最短路。
注意图是有向图。。。
#include
#include
#include
using namespace std;
struct node
{
int x,y,id;
}edge[205];
int dis[205][205];
int main()
{
int c,T,n,a,b,op;
while(scanf("%d",&T...
分类:
其他好文 时间:
2014-04-29 13:21:23
阅读次数:
313
来源于ISCC 2012 破解关第四题
目的是通过逆向police,实现一个thief,能够与police进行通信
实际上就是一个RSA加密通信的例子,我们通过自己编写客户端和服务端来实现上面的thief和police的功能..
要通信,这们这次先通过python写出可以进行网络连接的客户端与服务端..
服务端代码
#!/usr/bin/env python
impo...
分类:
其他好文 时间:
2014-04-29 13:21:19
阅读次数:
473
我们都知道在Web开发中,都需要服务器,比如Java Web开发的Tomcat,WebLogic,WebSphere,现在来看利
用Tornado Web Server框架如何写一个简易的Python服务器。
一般来说只需要实现get和post方法就可以了。以上次使用redis数据库的例子说明,数据库插入代码如下:
import redis
import datetime
clas...
分类:
其他好文 时间:
2014-04-29 13:17:20
阅读次数:
397
6.3 初识类
类引入一些新语法:三种新的对象类型和一些新的语义。
6.3.1 类定义语法
类定义的最简单形式如下:
class ClassName:
.
.
.
类定义和函数定义(def语句)一样,必须先执行然后才生效。(你当然可以把类定义放在if语句分支中或者嵌入在函数中)
在实际情况中,在类定义中的语句常常是方法的定义,但是其他语句也是允许的并且有时是很有用的...
分类:
编程语言 时间:
2014-04-29 13:14:23
阅读次数:
433