1. 交换两个数值
x, y = y, x;   //等价于 x = y, y =x;
2. 变量初始化问题 
a, b, c = 0;
print(a,b,c);   --> 0  nil  nil
仅对第一个值复制,所以要初始化一组变量,应该提供多个初始值
a, b, c = 0, 0, 0;
print(a, b, c);  --> 0   0   0
3. "尽可能...
                            
                            
                                分类:
其他好文   时间:
2014-05-10 10:17:39   
                                阅读次数:
272
                             
                    
                        
                            
                            
                                public class LinkedList {
Node head = null;
Node tail = null;
int length = 0;
public void add(Object object) {
Node node  = new Node(object, null);
if (head == null) {
head = tail = nod...
                            
                            
                                分类:
其他好文   时间:
2014-05-07 08:24:17   
                                阅读次数:
306
                             
                    
                        
                            
                            
                                如果placeholderImage 为空的话,会出现显示不出下载的图片,应该给他一个展位图   
 [cell.imageView
setImageWithURL:imageUrl placeholderImage:nil options:SDWebImageLowPriority |
SDWebImageRetryFailed];
应该:    [cell.imageView setI...
                            
                            
                                分类:
Web程序   时间:
2014-05-07 05:24:58   
                                阅读次数:
685
                             
                    
                        
                            
                            
                                原文:
Write code to reverse a C-Style String. (C-String means that “abcd” is represented as five characters, including the null character.)
译文:
写代码翻转一个C风格的字符串。(C风格的意思是"abcd"需要用5个字符来表示,包含末尾的 结束字符)...
                            
                            
                                分类:
其他好文   时间:
2014-05-07 05:12:34   
                                阅读次数:
265
                             
                    
                        
                            
                            
                                第一步:  首先添加权限:
  第二步:代码实现如下:
   public class ScreenActivity extends Activity
   {
        PowerManager powerManager = null;
        WakeLock wakeLock = null;
        @Override
        protecte...
                            
                            
                                分类:
移动开发   时间:
2014-05-07 05:00:06   
                                阅读次数:
377
                             
                    
                        
                            
                            
                                实验目标:熟悉实体完整性,参照完整性,事务的处理;
/*1.在数据库school表中建立表Stu_uion,进行主键约束,在没有违反实体完整性的前提下插入并更新一条记录*/
Use school 
create table stu_uion
(
	sno char(5) not null unique,
	sname char(8),
	ssex char(1),
	sage in...
                            
                            
                                分类:
数据库   时间:
2014-05-07 03:51:11   
                                阅读次数:
381
                             
                    
                        
                            
                            
                                从SVN下载项目后,我把项目名称改了一下然后启动tomcat后就一直报java.lang.IllegalArgumentException: Can't convert argument: null这个错。
解决办法是:第一步、将web.xml文件的头文件以javaee:开始的命名空间删除。如图:
第二步:将web.xml文件中所有javaee:替换成空白。如图:
重启tomcat,...
                            
                            
                                分类:
编程语言   时间:
2014-05-07 03:42:31   
                                阅读次数:
421
                             
                    
                        
                            
                            
                                五一中间断了几天,开始继续。。。
1、
??
Copy List with Random Pointer
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.
Return a...
                            
                            
                                分类:
其他好文   时间:
2014-05-06 18:54:59   
                                阅读次数:
386
                             
                    
                        
                            
                            
                                下图是一个创建好的链表
下面我们需要删除一个结点,例如删除第3个结点
首先定义一个指针p,并且将p指向第二个结点
然后定义一个指针q,将q指向需要删除的结点
将p指向的结点和q指向的结点相连
p->pNext = q->pNext
清空q指向的结点
free(q);
q = NULL;
删除后的链表
程序代码:
...
                            
                            
                                分类:
其他好文   时间:
2014-05-06 15:32:46   
                                阅读次数:
325
                             
                    
                        
                            
                            
                                --oracle实现自增id
--创建一张T_StudentInfo表
create table T_StudentInfo
(
       "id" integer not null primary key,
       xsName nvarchar2(120) not null,
       xsAge integer not null,
       Mobile varchar(...
                            
                            
                                分类:
数据库   时间:
2014-05-06 15:04:22   
                                阅读次数:
525