一。.和以往一样新建完一个Android项目之后,会报android.support.v4.。。。或者V7找不到的错误。
这是因为这两个包在另一个附带的项目(android-support-v7-appcompat)下。
解决办法:右键你刚才建 的项目〉Properties>Android 在下边 点Add 然后把android-support-v7-appcompat添加上就好...
分类:
移动开发 时间:
2014-05-18 18:30:05
阅读次数:
204
不难看出,在RelativeLayout被add/attach到父View之前mLayoutParams成员为空,调用measure方法将导致上图标注处代码抛出空指针异常。
解决方案有两种
a) 在measure之前显式设置LayoutParams(代表着对父View的Layout请求,必须是父View的内部LayoutParams类型)
b) 自动设置LayoutParams的inflate方式...
分类:
编程语言 时间:
2014-05-18 18:26:17
阅读次数:
576
【题目】
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.
If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is.
You may not alter the values in the nodes, only n...
分类:
其他好文 时间:
2014-05-18 10:22:34
阅读次数:
367
【题目】
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.
【题意】
合并K个有序链表
【思路】
归并
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
For ...
分类:
其他好文 时间:
2014-05-18 09:05:40
阅读次数:
255
【题目】
Given a linked list, swap every two adjacent nodes and return its head.
For example,
Given 1->2->3->4, you should return the list as 2->1->4->3.
Your algorithm should use only constant space. You may not modify the values in the list, only nodes it...
分类:
其他好文 时间:
2014-05-18 08:37:57
阅读次数:
370
【题目】
You are given a string, S, and a list of words, L, that are all of the same length. Find all starting indices of substring(s) in S that is a concatenation of each word in L exactly once and without any intervening characters.
For example, given:
S:...
分类:
其他好文 时间:
2014-05-18 08:31:48
阅读次数:
228
由于工作上的需要,把数据库中备份的联系人添加到通讯录,一般都有几百条记录,插入一条数据系统默认commit一次,这样效率就降低了,如果把所有的数据都添加进去后再commit效率就不一样,这就需要事务
没有添加事务的方法,每次添加一条记录
/**
* 单条添加数据
*
* @param contacts
* @return
*/
public boolean add(T...
分类:
移动开发 时间:
2014-05-18 07:03:31
阅读次数:
629
现在我们来分析一下CAN总线的接收数据流程,对于网络设备,数据接收大体上采用中断+NAPI机制进行数据的接收。同样,我们现在的CAN模块也是采用同样的方式进行数据的接收。由于我们只针对CAN总线接收数据这条主线进行分析。因些,会忽略一些针对CAN协议的设置及初始化等相关代码。
在初始化CAN设备时,我们需要给CAN设备分配NAPI功能。我们通过netif_napi_add()函数将CAN设备添加到NAPI机制列表中。...
分类:
其他好文 时间:
2014-05-18 06:13:15
阅读次数:
317
异常类型为:android.view.WindowManager$BadTokenException:
Unable to add window
我在fragment中public
View onCreateView(LayoutInflater
inflater, ViewGroup
container,Bundle
savedInstanceState) {中试图调用对话框静态工...
分类:
其他好文 时间:
2014-05-18 04:27:35
阅读次数:
240
1、
??
Path Sum
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.
For example:
Given the below...
分类:
其他好文 时间:
2014-05-18 03:25:06
阅读次数:
301