finally语句为异常处理提供了一个统一的出口。(记得是出口不是入口!)使得在控制流程转到应用程序的其他部分以前,能够对程序的状态作统一处理工作。无论try所指定的程序块是否抛出例外,finally所指定的代码都要被执行。通常在finally语句中做资源的清除工作。如关闭打开的文..
分类:
其他 时间:
2015-05-17 18:51:51
收藏:
0 评论:
0 赞:
0 阅读:
187
套接子的阻塞与非阻塞阻塞:在未完成当前任务时,不会去处理其他任务。例如当一个函数在执行接收数据时,只要数据未接收完,它就会一直等待接收下去,不会执行其他的操作。非阻塞:在未完成一个任务时,可以停止该项任务,进行下一步的操作。例如socket服务端在等待客户端的连..
分类:
其他 时间:
2015-05-17 18:51:41
收藏:
0 评论:
0 赞:
0 阅读:
127
ReverseLinkedListIITotalAccepted:39279TotalSubmissions:150148MySubmissionsQuestionSolutionReversealinkedlistfrompositionmton.Doitin-placeandinone-pass.Forexample:Given1->2->3->4->5->NULL,m=2andn=4,return1->4->3->2->5->NULL.Note..
分类:
其他 时间:
2015-05-17 18:51:01
收藏:
0 评论:
0 赞:
0 阅读:
127
BestTimetoBuyandSellStockTotalAccepted:49995TotalSubmissions:153488MySubmissionsQuestionSolutionSayyouhaveanarrayforwhichtheithelementisthepriceofagivenstockondayi.Ifyouwereonlypermittedtocompleteatmostonetransaction(ie,buyoneandselloneshareofthestock),desi..
分类:
其他 时间:
2015-05-17 18:50:11
收藏:
0 评论:
0 赞:
0 阅读:
199
对编程初学者的建议PS:这篇文章我只在微信公众号和头条网发布了,忘了在博客里发。我是程序员,我为程序员代言。现在真的是编程的黄金年代,程序员从来不曾这样供不应求,特别是嵌入式领域。现在哪怕是银行,也需要几个程序员,负责网站的编写,App编写,数据库管理,服务器管..
分类:
其他 时间:
2015-05-17 18:49:41
收藏:
0 评论:
0 赞:
0 阅读:
234
一.rpm包的命令格式源程序:name-version.tar.{gz|bz2|xz}version:major.minor.releaserpm包:name-version-release.arch.rpmrelease:通常只包含发行号和os平台el6:redhatenterpriselinuxCentOS5arch:x86_64i386,i586ppc分包:把一个复制的程序打包制作成多个rpm格式二.来源合法性..
分类:
其他 时间:
2015-05-17 18:49:21
收藏:
0 评论:
0 赞:
0 阅读:
226
Activity之间的数据传输
activity之间的数据传输我们可以通过Intent对象的putExtra方法,通过这个可以传输很多不同类型的数据,比如说字符串、整数、实数、对象等。
首先以一个字符串举例来说一下:
通过putExtra传输字符串可以通过如下方法:
putExtra(String name, String value):intent
第一个参数为用来让接收数据的acti...
分类:
其他 时间:
2015-05-17 18:48:30
收藏:
0 评论:
0 赞:
0 阅读:
155
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.
For example, given the following triangle
[
[2],
[3,4],
[...
分类:
其他 时间:
2015-05-17 18:48:00
收藏:
0 评论:
0 赞:
0 阅读:
213
背景:
本来系统好好的,但今天一打开:180多个错。天呐~~~一下就晕了。整了不到半个小时,就坐不住了。赶快叫救兵前来助阵。怎么办,马上就验收了,真的有些心慌了~~~
问题
虽然看上去有小200个错,但错误类型就两个:(但没来得及截图,下次遇到问题,先截图留念,有图有真相)
问题一:找不到dll文件
这类问题后来我了解到,有这几个原...
分类:
其他 时间:
2015-05-17 18:47:50
收藏:
0 评论:
0 赞:
0 阅读:
272
框架下载地址:http://modernizr.com/
案例:
$(function(){
if( !Modernizr.input.required ){
var $msg = $( "Required Fields Missing" );
$msg.css( "backgr...
分类:
其他 时间:
2015-05-17 18:47:20
收藏:
0 评论:
0 赞:
0 阅读:
228
题目链接:http://poj.org/problem?id=2356
Description
The input contains N natural (i.e. positive integer) numbers ( N <= 10000 ). Each of that numbers is not greater than 15000. This numbers are not ...
分类:
其他 时间:
2015-05-17 18:47:00
收藏:
0 评论:
0 赞:
0 阅读:
195
一道很有意思的dp,说它有意思是因为他的原理其实很简单,而且扫描一次就可以得到最终的答案。
如果当前这个数之前的和小于0,...
分类:
其他 时间:
2015-05-17 18:46:30
收藏:
0 评论:
0 赞:
0 阅读:
75
编程初学者可以看看...
分类:
其他 时间:
2015-05-17 18:46:21
收藏:
0 评论:
0 赞:
0 阅读:
238
Symmetric Tree
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).
For example, this binary tree is symmetric:
1
/ 2 2
/ \ / 3 4 ...
分类:
其他 时间:
2015-05-17 18:45:50
收藏:
0 评论:
0 赞:
0 阅读:
180
最长公共子序列,其实就是最长上升子序列的变形。 dp[i][j]表示以第一个序列的i位置为结尾和以第二个序列的j位置为结尾的子序列的公共子序列的长度。
显然影响决策的因素就是这两个序列的位置,所以二重循环直接搞就行了,如果这两个位置的字符相同就+1
#include
#include
#include
#include
#include
using namespace std;
char s...
分类:
其他 时间:
2015-05-17 18:45:20
收藏:
0 评论:
0 赞:
0 阅读:
196
Same Tree
Given two binary trees, write a function to check if they are equal or not.
Two binary trees are considered equal if they are structurally identical and the nodes have the same value...
分类:
其他 时间:
2015-05-17 18:45:00
收藏:
0 评论:
0 赞:
0 阅读:
103
Merge Sorted Array
Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.
Note:
You may assume that nums1 has enough space (size that is greater or equal...
分类:
其他 时间:
2015-05-17 18:44:20
收藏:
0 评论:
0 赞:
0 阅读:
105
架构是什么?业界并没有权威的说法。架构作为名词与结构相关,将产品分解为一系列组件、模块和交互。作为动词,是关于交流愿景和引入技术领导力的,简而言之,架构就是结构和愿景。应用程序的架构着重软件和代码的组织,系统架构描述从组件和服务到子系统等更高层次的抽象含软硬件,从代码结构到生产环境,与软件系统重要元素相关的所有东西就是软件架构。企业架构时战略而非代码。敏捷与架构并不冲突,在独特环境下量化所需的预先...
分类:
其他 时间:
2015-05-17 18:44:01
收藏:
0 评论:
0 赞:
0 阅读:
85
之前写过几篇自己动手系列的文章,简要实现了栈,二叉堆,malloc等函数,对于垃圾收集器,一直也有所耳闻。像python中主要使用引用计数手段来管理内存,为了解决循环引用的问题,引入了分代收集和标记-清除方式。当然python中可能产生循环引用的只可能是容器类对象如list,dict,class等,而像int,string是不可能产生循环引用的。当然python中的垃圾收集器实现是比较复杂的,我也没...
分类:
其他 时间:
2015-05-17 18:43:40
收藏:
0 评论:
0 赞:
0 阅读:
140
请在下面程序的注释处填上适当内容,以使程序完整,并使程序的输出为:
Name: 春哥
Grade: 19代码#include
#include
using namespace std;
class Person
{
public:
Person(char* s)
{
strcpy(name,s);
}
vo...
分类:
其他 时间:
2015-05-17 18:43:30
收藏:
0 评论:
0 赞:
0 阅读:
141