目的,测试在不同的部署方式下的性能。硬件环境IntelCorei5-3230MCPU@2.60GHz×4内存:7.4GiB操作系统:Ubuntu14.0464位测试代码(hello.py)frombottleimportBottle,runapp=Bottle()@app.route(‘/hello‘)defhello():return"HelloWorld!"if__name__=="__main__":run(app,host=‘loca..
分类:
其他好文 时间:
2015-07-31 06:42:27
阅读次数:
219
Given a list, rotate the list to the right by k places, where k is non-negative.
For example:
Given 1->2->3->4->5->NULL and k = 2,
return 4->5->1->2->3->NULL.
分析:注意k有可能会大于list的长度,所以先求出list...
分类:
其他好文 时间:
2015-07-31 06:41:05
阅读次数:
119
今天来说说线性表的实现
这里以List作为例子
package com.ray.testobject;
public class List {
private int length;
private Man[] array;
public int getLength() {
return length;
}
public void setLengt...
分类:
编程语言 时间:
2015-07-31 01:32:32
阅读次数:
170
什么是闭包闭包是指有权访问另一个函数作用域中的变量的函数(有点拗口吧),简单点就是在一个函数的内部创建另外一个函数,并返回这个函数的引用。(这也是创建闭包的常用方式)function outerFunc (outerNum) { return function innerFunc(in...
分类:
编程语言 时间:
2015-07-31 01:15:50
阅读次数:
137
function Range(from,to,x){ //实例(对象)字段 this.x=x;}//类字段Range.Y="类字段";//类方法Range.s=function(){ return '类方法';};Range.prototype={ construct...
分类:
编程语言 时间:
2015-07-31 01:10:04
阅读次数:
113
#include<stdio.h>#include<string.h>charfound(charstr[]){inti=0; intj=0; intcount; intlen=strlen(str); for(i=0;i<len;i++) { count=0;//每次执行外层循环时count都要置0 for(j=len-1;j>=0;j--) { if(str[i]==str[j]) { count++; } if(co..
分类:
其他好文 时间:
2015-07-30 23:35:38
阅读次数:
121
#include<stdio.h>
intmain()
{
intnum1,num2;
printf("请输入两个整数:");
scanf("%d%d",&num1,&num2);
while(num1%num2)
{
intr=num1%num2;//运用辗转相除法
num1=num2;
num2=r;
}
printf("%d\n",num2);
return0;
}
分类:
其他好文 时间:
2015-07-30 23:34:56
阅读次数:
157
验证怎么向线程中传递参数:
#include
#include
#include
#include
#include
#include
#define PAI 3.14159
void* thread_area (void* arg) {
double r = *(double*)arg;
*(double*)arg = PAI * r * r;
return NU...
分类:
编程语言 时间:
2015-07-30 23:24:39
阅读次数:
208
原型引入我们依然定义一个Person类1 function person(age,name){2 this.age = age;3 this.name = name;4 this.information = function(){5 return "...
分类:
其他好文 时间:
2015-07-30 22:49:40
阅读次数:
113
php: 1 class JoDES { 2 3 private static $_instance = NULL; 4 /** 5 * @return JoDES 6 */ 7 public static function share() { 8 ...
分类:
编程语言 时间:
2015-07-30 20:59:38
阅读次数:
219