1.变量a.需要给变量赋值时,可以这么写:b.要取用一个变量的值,只需在变量名前面加一个$ ( 注意: 给变量赋值的时候,不能在"="两边留空格 )c.然后执行 chmod +x first 使其可执行,最后输入 ./文件名 执行该脚本。#!/bin/bash# 对变量赋值:a="hello wor...
                            
                            
                                分类:
其他好文   时间:
2014-09-23 02:43:04   
                                阅读次数:
385
                             
                         
                    
                        
                            
                            
                                一、排序的两种方式(1)原地排序(In-place sorting):按指定的顺序排列数据,然后用排序后的数据替换原来的数据,原来的数据丢失。sort(),列表的标准方法,e.g. mylist.sort()(2)复制排序(Copied sorting):按指定的顺序排列数据,然后返回原数据一个有序...
                            
                            
                                分类:
编程语言   时间:
2014-09-23 00:04:13   
                                阅读次数:
310
                             
                         
                    
                        
                            
                            
                                界面设计是谋局当中第二个任务,也是很重要的,这个和概念设计排名不分先后。合理的界面布局会给用户带来非常舒心的体验,在项目之处就能把界面风格和布局确定下来,更是可以让后面的开发事半功倍。 First:基本布局。我们不是艺术家,不是激进派,四平八稳符合我们的风格,也符合快速开发的要求,布局就采...
                            
                            
                         
                    
                        
                            
                            
                                1.设计库源码pr1.c1 void print1()2 {3 printf("This is the first lib src \n");4 }View Codepr2.c1 void print2()2 {3 printf("This is the second lib src...
                            
                            
                                分类:
编程语言   时间:
2014-09-22 20:45:43   
                                阅读次数:
151
                             
                         
                    
                        
                            
                            
                                找出可能变化之处,把它们独立出来,不要和那些不需要变化的代码混在一起。
     为了分开变化的和不变化的部分,需要建立两组类,一个是与fly相关的,一个是quack相关的,每组类各自实现各自的动作。我们将这两个行为从Duck类中分开,建立一组新类。
     针对接口编程,而不是针对实现。...
                            
                            
                                分类:
其他好文   时间:
2014-09-22 19:27:23   
                                阅读次数:
119
                             
                         
                    
                        
                            
                            
                                pop_heap原型:
std::pop_heap
default (1)
template 
  void pop_heap (RandomAccessIterator first, RandomAccessIterator last);
custom (2)
template 
  void pop_heap (RandomAcc...
                            
                            
                                分类:
其他好文   时间:
2014-09-22 19:25:23   
                                阅读次数:
183
                             
                         
                    
                        
                            
                            
                                partition_point原型:
std::partition_point
template 
  ForwardIterator partition_point (ForwardIterator first, ForwardIterator last,
                                   UnaryPredicate pred);
该函...
                            
                            
                                分类:
其他好文   时间:
2014-09-22 18:41:03   
                                阅读次数:
118
                             
                         
                    
                        
                            
                            
                                题意:
输入一个文本,找出所有不同的单词,按字典序输出所有单词。
stringstream通常是用来做数据转换的
相比c库的转换,它更加安全,自动和直接
#include 
stringstream stream
stream 
stream >>value   读取
#include 
#include 
#include 
#include 
#in...
                            
                            
                                分类:
其他好文   时间:
2014-09-22 18:31:43   
                                阅读次数:
165
                             
                         
                    
                        
                            
                            
                                partial_sort原型:
std::partial_sort
default (1)
template 
  void partial_sort (RandomAccessIterator first, RandomAccessIterator middle,
                     RandomAccessIterator last)...
                            
                            
                                分类:
其他好文   时间:
2014-09-22 17:38:32   
                                阅读次数:
298
                             
                         
                    
                        
                            
                            
                                partition原型:
td::partition
C++98
C++11
template 
  ForwardIterator partition (ForwardIterator first,
                             ForwardIterator last, UnaryPredicate pred);
...
                            
                            
                                分类:
其他好文   时间:
2014-09-22 17:17:23   
                                阅读次数:
170