摘要: 最近在学习openstack,以下是一些基础知识:1、Cloud computing提供了以下几个模型:SaaS(software as a service), paas(platform as a service),iaas(infrastructure as a service),其中openstack属于第三种。 2、openstack包括以下几个模块:1)、object Store(Swift):提供了对象的存储,它可以让你存储和检索文件,提供了强大的扩展性、冗余和持久性,一些大公司提供了基于Swift的商业存储服务。2)、Image(Glance):主要用来管理镜像文件,这些文件都在 阅读全文
posted @ 2012-11-30 10:03 SA高处不胜寒 阅读(3468) 评论(0) 推荐(2) 编辑
摘要: 该项目的基本架构如下:其中UserDAO.java中的代码是:package com.chl.dao;import java.sql.SQLException;import java.util.List;import com.chl.test.Emp;public interface UserDAO { public boolean insert(Emp u); public boolean update(Emp u); public boolean query(Emp u) throws SQLException; public boolean delete(Emp u) throws SQ 阅读全文
posted @ 2012-11-30 09:59 SA高处不胜寒 阅读(725) 评论(0) 推荐(0) 编辑
摘要: BeanFactory applicationContext = new ClassPathXmlApplicationContext("bean.xml"); dataSource = (DataSource)applicationContext.getBean("dataSource"); try{ Connection conn = dataSource.getConnection(); conn.createStatement().executeUpdate("insert into user1(name,passwd)values(& 阅读全文
posted @ 2012-11-08 16:11 SA高处不胜寒 阅读(158) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>using namespace std;#define Maxsize 10template <typename T>class queue{ private: int front,rear; T elem[Maxsize]; public: bool init(); bool QueueEmpty(); bool EnQueue(T e); T GetFront(); T DeQueue();};template <typename T>bool queue<T>::init(){ front = rear 阅读全文
posted @ 2012-10-26 13:44 SA高处不胜寒 阅读(128) 评论(0) 推荐(0) 编辑
摘要: A='ab'echo$Aecho"$A"两个分别输出什么? 答案是:a bab如果a和b之间有n多换行符来说echo $A输出是不变得,说明其在输出把第一换行符置换为空格 对其他换行符予以忽略,而对于echo "$A"其把$A当字符串处理,不会对其进行二次处理 阅读全文
posted @ 2012-10-25 21:30 SA高处不胜寒 阅读(255) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>using namespace std;void print(int a[], int n){ for(int j= 0; j<n; j++){ cout<<a[j] <<" "; } cout<<endl; }int partition(int a[], int low, int high){ int privotval = a[low]; while (low < high) { while (low < high & privotval < a[hig 阅读全文
posted @ 2012-10-23 22:20 SA高处不胜寒 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 我有一个程序是这样的:int main(){ int *p; int i; int*fun(void); p=fun(); for(i=0;i<3;i++) { printf("%d\n",*p); p++; } return 0;};int* fun(void){ static int str[]={1,2,3,4,5}; int*q=str; return q;}我想问一下,除了将str定义为静态区以及用malloc这样的方法外,还有什么好的方法,同时也想问一下如果我改成int main(){ char *p; char*fun(void); p=fun(); p 阅读全文
posted @ 2012-10-22 09:19 SA高处不胜寒 阅读(713) 评论(0) 推荐(1) 编辑
摘要: 请问以下两段代码输出为什么会不同?代码1:void main(){ char a[10]; cin.getline(a,10); //输入"123456789" cout << a << endl; //输出"123456789" cout << cin.gcount(); //输出10}代码2:void main(){ char a[10]; cin.getline(a,10); //输入"1234567890" cout << a << endl; //输出"1 阅读全文
posted @ 2012-10-22 08:54 SA高处不胜寒 阅读(857) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <vector>#include <fstream>using namespace std;int main(void){ ifstream fp("I:\\temp.txt"); vector< vector<double> > tmp; // string str; char str[100]; double i; char *ch,*ch1; int num; while(!fp.eof()) { vector<double> m1; // 阅读全文
posted @ 2012-10-22 08:52 SA高处不胜寒 阅读(746) 评论(0) 推荐(0) 编辑
摘要: 在类中如果需要其他对象作为成员函数时,需要注意以下几点:1、 类中如果需要其他对象作为私有变量或者protected时,只能调用没有参数的构造函数例如:#include <iostream>using namespace std;class A{public: A(char *p) { des = new char[10]; strcpy(des, p); cout<<"OK2"<<endl; } A(){cout<<"BOK"<<endl;} void show() { cout<< 阅读全文
posted @ 2012-10-20 20:52 SA高处不胜寒 阅读(844) 评论(0) 推荐(0) 编辑