//UIAlertView的代理方法(创建UIAlertView之后,copy此代理方法即可)-
(BOOL)alertViewShouldEnableFirstOtherButton:(UIAlertView *)alertView{
//1.取出输入框中的文字 NSString *text .....
分类:
其他好文 时间:
2014-07-22 23:00:34
阅读次数:
330
普通排序:直接分配一个同等大小的数组,反向copy即可.char* Reverse(char*
s){ //将q指向字符串最后一个字符 char* q = s ; while( *q++ ) ; q -= 2 ; //分配空间,存储逆序后的字符串。
char* p = newchar[sizeof(...
分类:
其他好文 时间:
2014-05-12 16:30:14
阅读次数:
338
Lease 的机制:hdfs支持write-once-read-many,也就是说不支持并行写,那么对读写的互斥同步就是靠Lease实现的。Lease说白了就是一个有时间约束的锁。客户端写文件时需要先申请一个Lease,对应到namenode中的LeaseManager,客户端的client name就作为一个lease的holder,即租约持有者。LeaseManager起什么作用呢?
读写过程的容错是怎么做的?数据块是如何复制的?数据块的恢复机制?本文都有涉及。...
分类:
其他好文 时间:
2014-05-02 23:22:14
阅读次数:
450
package ioTest.io1;
import java.io.FileReader;
import java.io.FileWriter;
/*将d盘的文件复制到e盘
* Copy的原理:
* 读取d盘的文件内容,然后写入到e盘的同名文件中。(同名文件需要创建)
*
*/
public class CopyText {
public static void main(St...
分类:
编程语言 时间:
2014-05-02 19:34:41
阅读次数:
432
胡乱写了一些代码/*
============================================================================
Name : sqlist.c Author :codecup Version : Copy...
分类:
其他好文 时间:
2014-05-02 17:22:31
阅读次数:
356
UIView的常见属性 1 @property(nonatomic,readonly)
UIView *superview; 2 获得自己的父控件对象 3 4 @property(nonatomic,readonly,copy) NSArray
*subviews; 5 获得自己的所有子控件对象.....
分类:
其他好文 时间:
2014-05-02 14:53:07
阅读次数:
249
本文以康哥的博客为基础进行修改和补充,详见:http://kangfoo.github.io/article/2014/01/hadoop1.x-wordcount-fen-xi/hadoop
mapreduce 过程粗略的分为两个阶段: 1.map; 2.redurce(copy, sor...
分类:
其他好文 时间:
2014-05-02 00:06:57
阅读次数:
553
org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.NEVER) - turn your Session into FlushMode.AUTO or remove 'readOnly' marker from transaction definition...
分类:
数据库 时间:
2014-05-01 18:16:35
阅读次数:
377
通过 HTML DOM,可访问 JavaScript HTML 文档的所有元素
1 修改HTML元素内容
document.write(Date()); //在输入流中直接写
document.getElementById(id).innerHTML=new HTML //改变已经有的元素内容
document.getElementById("image").src="landscap...
分类:
编程语言 时间:
2014-04-30 22:42:38
阅读次数:
353
Steps:
1. backup database DBmirror on SQL1
2. backup database log
3. copy db and log backup files to SQL2
4. restore db with norecovery
5. restore log with norecovery
6. create endpoints on both...
分类:
数据库 时间:
2014-04-30 22:15:38
阅读次数:
414