【题目】
Follow up for "Remove Duplicates":
What if duplicates are allowed at most twice?
For example,
Given sorted array A = [1,1,1,2,2,3],
Your function should return length = 5, and A is now [1,1,2,2,3].
【题意】
给定一个有序数组,给数组去重,和Remove Duplicates from...
分类:
其他好文 时间:
2014-06-03 05:36:24
阅读次数:
219
请问ArrayList、LinkedList、Vector的区别
①ArrayList底层实际上是采用数组实现的(并且该数组的类型的Object类型的)
②如果jdk6,采用Array.copyOf()方法来生成一个新的数组,如果是jdk5,采用的是System.arraycopy()方法(当添加的数据量大于数组的长度时候)
③List list = newArrayList()时,底层会生成一个长度为10的数组来存放对象
④ArrayList、Vector底层都是采用数组实现的
⑤对于ArrayLis...
分类:
编程语言 时间:
2014-06-03 04:20:31
阅读次数:
304
1、错误描述
Exception in thread "main" java.lang.IllegalArgumentException: Cannot format given Object as a Date
at java.text.DateFormat.format(Unknown Source)
at java.text.Format.format(Unknown Source)...
分类:
编程语言 时间:
2014-06-03 03:26:58
阅读次数:
309
最好的用户体验就是私人定制,今天说下推送铃声的私人定制。
分为3个步骤:
1.制作推送提醒铃声
一般的iphone手机铃声都可以,限时30s之内。
2.倒入项目
将制作好的铃声添加到xcode的工程项目中
3.修改推送json(修改后台)
$body['aps'] = array(
'alert' => $message,
//'soun...
分类:
其他好文 时间:
2014-06-03 03:19:20
阅读次数:
245
【题目】
Follow up for "Search in Rotated Sorted Array":
What if duplicates are allowed?
Would this affect the run-time complexity? How and why?
Write a function to determine if a given target is in the array.
【题意】
在“Search in Rotated Sorted Array”的基...
分类:
其他好文 时间:
2014-06-03 01:55:38
阅读次数:
173
spring-framework-3.2.4与hibernate-release-4.3.5下使用HibernateDaoSupport抛出异常java.lang.ClassCastException: org.springframework.orm.hibernate4.SessionHolder cannot be cast to org.springframework.orm.hibernate3.SessionHolder。...
分类:
编程语言 时间:
2014-06-03 01:26:30
阅读次数:
368
一直在使用Navicat,这是一个数据库客户端软件,能连接多种不同类型的数据库,给我们的日常的工作带来了不少的便捷。
最近,我在电脑上安装了orcale,然后,Navicat就莫名其妙的不能连接oracle数据库了。总是提示如下错误:
先说下OCI是什么,百科上这样说:ORACLE调用接口(Oracle CallInterface简称OCI)提供了一组可对ORACLE数据库进行存取的接口子...
分类:
其他好文 时间:
2014-06-03 00:14:44
阅读次数:
279
通常,我们要让某元素居中,会这样做:
#element{
margin:0 auto;
}
如果还想让此元素位置固定呢?一般我们会添加position:fixed,如下:
#element{
position:fixed;
margin:0 auto;
}
但是这样做的结果就是,元素不居中了。这说明fixed使对象脱离了正常文档流。
解决方案:
#ele...
分类:
Web程序 时间:
2014-06-02 23:00:57
阅读次数:
327
/*
**AVL平衡树插入例程
**2014-5-30 11:44:50
*/
avlTree insert(elementType X, avlTree T){
if(T == NULL){
T = malloc(sizeof(struct avlTree));
if(T == NULL) fatalError("Out of space!!!");
T->element = X...
分类:
其他好文 时间:
2014-06-01 09:50:16
阅读次数:
233
【题目】
Given two sorted integer arrays A and B, merge B into A as one sorted array.
Note:
You may assume that A has enough space (size that is greater or equal to m + n) to hold additional elements from B. The number of elements initialized in A and B are...
分类:
其他好文 时间:
2014-06-01 09:21:16
阅读次数:
292