单例设计模式:public class Singliton { //no new private Singliton (){ } static Singliton ins = null; public static Singliton get(){ if(ins == null){ ...
分类:
编程语言 时间:
2014-06-18 22:52:01
阅读次数:
238
android findViewById 值为 null
分类:
移动开发 时间:
2014-06-18 22:40:33
阅读次数:
380
#include#include#includeint k,h[110],mark;struct M{ int data; struct M *next;}*head[110];void init(){ int i; for(i = 0; i next = NULL; ...
分类:
其他好文 时间:
2014-06-17 00:58:16
阅读次数:
315
1.判断单链表是否有环 使用两个slow, fast指针从头开始扫描链表。指针slow 每次走1步,指针fast每次走2步。如果存在环,则指针slow、fast会相遇;如果不存在环,指针fast遇到NULL退出。 就是所谓的追击相遇问题: 2.求有环单链表的环长 在环上相遇后,记录第一次...
分类:
其他好文 时间:
2014-06-17 00:42:49
阅读次数:
260
不知道怎么起标题,就这样了。目前主要讲两个方面内容:代码方式 设置RadioButton的 android:button 、 android:background 等属性为 @null;代码方式 通过布局模板动态创建固定参数的RadioButton等控件对象1、代码设置@null// 这里不能用nu...
分类:
其他好文 时间:
2014-06-16 13:35:24
阅读次数:
204
Given a linked list, return the node where the cycle begins. If there is no cycle, return null.
Follow up:
Can you solve it without using extra space?
思路:由【Leetcode】Linked
List Cycle可知,利用一快一慢...
分类:
其他好文 时间:
2014-06-15 14:23:38
阅读次数:
288
#include #include #include #include void cleanup(){ printf("cleanup\n");}void *test_cancel(void){ pthread_cleanup_push(cleanup,NULL); printf(...
分类:
编程语言 时间:
2014-06-15 13:13:00
阅读次数:
225
问题1:View层如何向Controller的Action传递Model数据?在View中,可以使用Form表单进行模型数据的提交,同样的,我们需要关联提交数据的类型,则需要在View中使用@model + 数据类型不同的是,此时Model属性为null,而且Model是一个只读属性,我们不能使用它...
分类:
其他好文 时间:
2014-06-15 13:10:18
阅读次数:
275
对于C和C++程序员来说,一定不会对NULL感到陌生。但是C和C++中的NULL却不等价。NULL表示指针不指向任何对象。
NULL是一个宏定义
在C中将NULL定义为void*指针值为0
#define NULL (void*)0
在C++中,NULL被定义为常数0
#ifndef NULL
#ifdef __cplusplus
#define NULL 0...
分类:
编程语言 时间:
2014-06-15 10:22:49
阅读次数:
359
Given a linked list, return the node where the cycle begins. If there is no cycle, return null.Follow up: Can you solve it without using extra space?比...
分类:
其他好文 时间:
2014-06-14 15:48:59
阅读次数:
217