现在位置: 首页 > chs988发表的所有文章
  • 03月
  • 20日
综合 ⁄ 共 281字 评论关闭
     最近在使用qingyun的ubuntu虚拟机做学习,碰到账号切换的问题,归纳一下:     创建好的ubuntu虚拟机默认有一个ubuntu的用户,也会自己设置密码;创建好后如何切到root呢,只可以sudo su切换完成         1. su与sudo 的区别:     su 切换到某个用户,并使用该用户的环境变量,输入的是目标用户的密码        sudo su切换到某个用户后工作环境也改变,输入的是当前用户的密码   2. su - root 切换后同sudo su一样,工作环境改变,su root则不变 参考:http://www.justwinit.cn/post/4461/
阅读全文
  • 09月
  • 18日
综合 ⁄ 共 1121字 评论关闭
1、关于自加自减的题目 int i = 1 ; int j = 10 ; while(i++ < --j){ System.out.println("yes"); } 从题目来看主要是考查自加和自减操作符,首先来复习下自加自减操作符。 i++ : 首先这是一个表达式,这个表达式的值是i,执行完该表达式之后,i的值加1 ++i:这个表达式的值为i+1,执行完这个表达式之后,i的值加+1 i--:这个表达式的值为i,执行完该表达式之后,i的值减1 --i:这个表达式的值为i-1,执行完该表达式之后,i的值减1 所以,while中判断条件应该是: 1<9符合,打印输出 2<8符合,打印输出 3<7符......
阅读全文
  • 08月
  • 04日
综合 ⁄ 共 1118字 评论关闭
Swift是一种适用于iOS和OS X应用的全新编程语言,它建立在最好的C和Objective-C 语言之上,并且没有 C 语言的兼容性限制。Swift 采用安全的编程模式,增加了现代功能使编程更容易、更灵活、更有趣。Swift以成熟且备受宠爱的Cocoa和Cocoa Touch框架为 支撑,这是一个重新构想软件开发的机会。 所有语言的通句:println("Hello, World!") 简单的常量,变量 使用let声明常量,使用var来声明变量 /*-------我是帅气的分割线--------*/ let maxNumberOfStudents = 47 //通过let关键字声明一个常量 var currentNumberOfStudents = 23 //通过var......
阅读全文
  • 05月
  • 13日
综合 ⁄ 共 699字 评论关闭
字符串翻转的例子 输入如 A fox has jumped into the river 输出为 river the into jumped has fox A #include <algorithm> #include <string> using std::string; #include <vector> using std::vector; #include <iostream> using namespace std; bool reverseSentence( const char *input, vector<string> &output) { int len = strlen(input); string word; for ( int i = 0; i < len ; i ++ ) { char currentChar = *(input+i); if ( '......
阅读全文
  • 04月
  • 20日
综合 ⁄ 共 3315字 评论关闭
   写hibernate程序必需的:   hibernate.cfg.xml文件 <!DOCTYPE hibernate-configuration PUBLIC     "-//Hibernate/Hibernate Configuration DTD 3.0//EN"     "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration>     <session-factory name="foo">         <property name="hibernate.connection.url">             jdbc:mysql://localhost/hibernate_fir         </property>         <property name="hibernate.connection.driver_class"&......
阅读全文
  • 02月
  • 08日
综合 ⁄ 共 2694字 评论关闭
关于术语的问题: 演绎,推导,演推,我也不知道哪个准确,反正就是这个意思 template<int i> class A { public: static const int a = 3 * A< i - 2>::a * A<i -1>::a; }; template<> class A<2> { public: static const int a = 2; }; template<> class A<1> { public: static const int a = 1; }; cout<<A<6>::a<<endl; //请问输出什么 这个稍微有些复杂. 先来看个简单的: 示例1: template<int i> class A { public: static const int a = 5 ; // ......
阅读全文
  • 01月
  • 13日
综合 ⁄ 共 1502字 评论关闭
Description Farmer John goes to Dollar Days at The Cow Store and discovers an unlimited number of tools on sale. During his first visit, the tools are selling variously for $1, $2, and $3. Farmer John has exactly $5 to spend. He can buy 5 tools at $1 each or 1 tool at $3 and an additional 1 tool at $2. Of course, there are other combinations for a total of 5 different ways FJ can spend all his money on tools. Here they are: 1 @ US$3 + 1 @ US$2 1 @ US$3 + 2 @ US$1 1 @ US$2 + 3 @ US$1 2 ......
阅读全文
  • 12月
  • 06日
综合 ⁄ 共 1355字 评论关闭
关联容器 set, multiset, map, multimap 是一种非线性的树结构,具体的说采用的是一种比较高效的特殊的平衡检索二叉树—— 红黑树结构。(至于什么是红黑树,我也不太理解,只能理解到它是一种二叉树结构) 因为关联容器的这四种容器类都使用同一原理,所以他们核心的算法是一致的,但是它们在应用上又有一些差别,先描述一下它们之间的差别。 set ,又称集合,实际上就是一组元素的集合,但其中所包含的元素的值是唯一的,且是按一定顺序排列的,集合中的每个元素被称作集合中的实例。因为其内部是通过链表的方式来组织,所以在......
阅读全文
  • 12月
  • 05日
综合 ⁄ 共 3778字 评论关闭
经黎活明ppt整理: OGNL是Object Graphic Navigation Language(对象图导航语言)的缩写,它是一个开源项目。 Struts 2框架使用OGNL作为默认的表达式语言。 相对EL表达式,它提供了平时我们需要的一些功能,如: l支持对象方法调用,如xxx.sayHello(); l支持类静态方法调用和值访问,表达式的格式为@[类全名(包括包路径)]@[方法名|  值名],例如:@java.lang.String@format('foo %s', 'bar')或@cn.itcast.Constant@APP_NAME; l操作集合对象。 Ognl 有一个上下文(Context)概念,说白了上下文就是一个MAP结构,它实现了java.ut......
阅读全文
  • 12月
  • 03日
综合 ⁄ 共 308字 评论关闭
看到控制台报Error filterStart,结果tomcat无法将应用部署。 打开webapps 到项目的WEB-INF文件加下,classes文件内为空,显然是没有部署项目。 思前想后,估计是因为自己替换了lib文件夹下的jaxen-1.1.1.jar.zip文件替换为了jaxen-1.1.1.jar文件。结果在clean项目后,项目文件夹上显示红色"X"。 于是 右键点击 项目名称-->biud path --->configure build path 弹出对话框,选中jaxen-1.1.1.jar.zip包,点击“edit”按钮,选择已更新的jaxen-1.1.1.jar,将其引入到classes 重启成功!可以登录系统!
阅读全文
  • 12月
  • 02日
综合 ⁄ 共 5221字 评论关闭
DBGridEh导出功能详解(SaveDBGridEhToExportFile说明) ---   经常有用户要求数据导出,对此,我们一直用最原始的办法,打开查询,读取每个字段的数据,逐条的的写入文件。如下: procedure TForm10.prExpData(pMode:Byte); Var   pFPath:String;   pFName:String;   //Exp Name of prefix   pFObject:string;   pMyFile:TextFile;   pStr:string;   i:integer; begin         pFObject:='c:\Exp_Sample.csv';         AssignFile(pMyFile,pFObject);         ReWrite(pMyFile);         with DM.QR_ENJBTR_250 do begin   ......
阅读全文
  • 11月
  • 23日
综合 ⁄ 共 2554字 评论关闭
贪心,能凑成一组就算一组 Unrhymable Rhymes Time Limit: 10 Seconds      Memory Limit: 32768 KB      Special Judge An amateur poet Willy is going to write his first abstract poem. Since abstract art does not give much care to the meaning of the poem, Willy is planning to impress listeners with unusual combinations of words. He prepared n lines of the future poem, but suddenly noticed that not all of them rhyme well. Though abstractionist, Willy strongly respects canons of classic poetr......
阅读全文