To add up all the numbers in a list, you can use a loop like this: Total is initialized to 0. Each time through the loop, x gets one element...
分类:
其他好文 时间:
2014-07-16 19:29:14
阅读次数:
234
原地址:http://blog.csdn.net/armoonwei/article/details/7032537Unity as a LibraryOnce you have eclipse installed and up to date you have to follow a few st...
分类:
移动开发 时间:
2014-07-16 19:26:21
阅读次数:
246
Two SumGiven an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the...
分类:
其他好文 时间:
2014-07-15 08:45:17
阅读次数:
236
package com.example.dailphone;import android.support.v7.app.ActionBarActivity;import android.support.v7.app.ActionBar;import android.support.v4.app.Fr...
分类:
移动开发 时间:
2014-07-14 15:20:09
阅读次数:
195
一、选项卡如今很多应用都会使用碎片以便在同一个活动中能够显示多个不同的视图。在Android 3.0 以上的版本中,我们已经可以使用ActionBar提供的Tab来实现这种效果,而不需要我们自己去实现碎片的切换。ActionBar默认是不具备选项卡功能的,所以我们需要给一个属性赋上对应的枚举,比如下...
分类:
移动开发 时间:
2014-07-13 21:01:01
阅读次数:
650
OSPF排错报告故障点一:PPP链路故障故障现象:R2和R4之间的PPP链路一会down一会UP故障分析:1) ppp 认证类型是否一致2) ppp chap认证用户是否配置正确3) pppp chap认证密码是否配置正确4) 进行chap认证的用户是否包含ppp的服务类型故障解决:1) 在RT2 ...
分类:
其他好文 时间:
2014-07-13 19:33:28
阅读次数:
284
点击打开链接
题意:有n层楼层,现在在每一层有两个按钮,分别为up和down,按动按钮时,可以向上或向下跳动num[ i ]层;问能否以最少的次数从A到B层,不能输出-1;
解析:构图,将从i层到按动按钮后跳转的楼层,看作连通状态,赋值为1,这样就转换成单源最短路问题;
#include
#include
#include
using namespace std;
const int m...
分类:
其他好文 时间:
2014-07-13 18:37:00
阅读次数:
231
DOWN操作:linux内核中,对信号量的DOWN操作有如下几种:
void down(struct semaphore *sem); //不可中断
int down_interruptible(struct semaphore *sem);//可中断
int down_killable(struct semaphore *sem);//睡眠的进程可以因为受到致命信号而被唤醒,中断获取信号量...
分类:
其他好文 时间:
2014-07-13 16:21:36
阅读次数:
501
1. 固定一个MAC地址,特别是在使用多个虚拟机的时候
linux环境下:
用root身份登录,在/etc/rc.d/rc.local里加上这三句
ifconfig eth0 down
ifconfig eth0 hw ether 00:0C:18:EF:FF:ED
ifconfig eth0 up
这样重新reboot后就不怕MAC复原了。
2. ifconfig命令(转...
分类:
系统相关 时间:
2014-07-13 16:14:11
阅读次数:
322
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 binary tree and sum
...
分类:
其他好文 时间:
2014-07-13 13:58:01
阅读次数:
184