Fragment要点Fragment作为Activity界面的一部分组成出现可以在一个Activity中同时出现多个Fragment,并且,一个Fragment亦可在多个Activity中使用。在Activity运行过程中,可以添加、移除或者替换Fragment(add()、remove()、rep...
分类:
移动开发 时间:
2014-10-06 02:20:39
阅读次数:
267
class Solution {
public:
int removeDuplicates(int A[], int n) {
int duplicate = 0;
int i = 0;
for(i = 0; i < n - 1; i++){
if(A[i] == A[i + 1]){
dupli...
分类:
其他好文 时间:
2014-10-05 22:23:09
阅读次数:
183
给定一个排好序的链表,删除所有重复的节点,使每一个节点都只出现一次...
分类:
其他好文 时间:
2014-10-05 21:17:09
阅读次数:
212
Remove Duplicates from Sorted List
Given a sorted linked list, delete all duplicates such that each element appear only once.
For example,
Given 1->1->2, return 1->2.
Given 1->1->2->3->3, return 1->2->3.
很简单,先判断第一个位置否为空,不为空的话再判断下 个位置是否为空,如果都为空那么就不用操作了。
如果两...
分类:
其他好文 时间:
2014-10-05 20:16:08
阅读次数:
202
介绍这篇文章的目的是为了介绍std::vector,怎样恰当地使用它们的成员函数等操作。本文中还讨论了条件函数和函数指针在迭代算法中使用,如在remove_if()和for_each()中的使用。通过阅读这篇文章读者应该可以有效地使用vector容器,并且应该不会再去使用C类型的动态数组了。Vect...
分类:
其他好文 时间:
2014-10-04 12:21:46
阅读次数:
238
在平时的开发过程中,我们知道可以将一个Array的对象转化为List。这样的操作,我们只要采用Arrays.asList这个方法就行了。笔者前段时间一直用这个方法,有一天,我发现通过Arrays.asList得到的List无法进行add和remove等操作。
下面是一段很简单的测试代码:
public class MainFacade {
public st...
分类:
编程语言 时间:
2014-10-03 11:43:14
阅读次数:
239
package Observer;
public class Test {
/**
* 客户端测试类
* 观察者模式一般由四部分组成:
* 1抽象的被观察者(一般教材上都叫做“Subject(抽象的主题类)”),
* 里面一般定义了抽象的add(),remove(),notifyAll()等方法,
* 分别用于增加观察者,删除观察者,通知观察者自己的变化。
* 2具体...
分类:
编程语言 时间:
2014-10-02 19:29:03
阅读次数:
247
yum remove mysql mysql-server mysql-libs compat-mysql51rm -rf /var/lib/mysql (删除数据库)rm /etc/my.cnf查看是否还有mysql软件:rpm -qa|grep mysql有的话继续删除
分类:
数据库 时间:
2014-10-02 02:32:02
阅读次数:
207
Ubuntu中文输入法安装(12.04)本文地址:http://blog.csdn.net/caroline_wendyUbuntu作为Linux常见的操作系统,是需要熟练使用的。在安装过程中,输入法有时会出现问题,需要手动安装。点击System Settings:找到Language Support。Install/Remove Language,找到Chinese(simplified),并点...
分类:
系统相关 时间:
2014-10-01 22:22:51
阅读次数:
268
Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra space for a...
分类:
其他好文 时间:
2014-10-01 19:08:51
阅读次数:
163