finally语句为异常处理提供了一个统一的出口。(记得是出口不是入口!)使得在控制流程转到应用程序的其他部分以前,能够对程序的状态作统一处理工作。无论try所指定的程序块是否抛出例外,finally所指定的代码都要被执行。通常在finally语句中做资源的清除工作。如关闭打开的文..
分类:
其他好文 时间:
2015-05-17 18:52:50
阅读次数:
95
套接子的阻塞与非阻塞阻塞:在未完成当前任务时,不会去处理其他任务。例如当一个函数在执行接收数据时,只要数据未接收完,它就会一直等待接收下去,不会执行其他的操作。非阻塞:在未完成一个任务时,可以停止该项任务,进行下一步的操作。例如socket服务端在等待客户端的连..
分类:
其他好文 时间:
2015-05-17 18:53:29
阅读次数:
98
1.安装mysql//在练习lamp时已经安装过
2.php安装
[root@localhostphp-5.4.37]#wgethttp://cn2.php.net/distributions/php-5.4.37.tar.bz2
[root@localhostphp-5.4.37]#tarjxfphp-5.4.37.tar.bz2
[root@localhostphp-5.4.37]#useradd-s/sbin/nologinphp-fpm
[root@localhostphp-..
分类:
其他好文 时间:
2015-05-17 18:52:33
阅读次数:
138
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:53:58
阅读次数:
96
BestTimetoBuyandSellStockTotalAccepted:49995TotalSubmissions:153488MySubmissionsQuestionSolutionSayyouhaveanarrayforwhichtheithelementisthepriceofagivenstockondayi.Ifyouwereonlypermittedtocompleteatmostonetransaction(ie,buyoneandselloneshareofthestock),desi..
分类:
其他好文 时间:
2015-05-17 18:52:08
阅读次数:
106
对编程初学者的建议PS:这篇文章我只在微信公众号和头条网发布了,忘了在博客里发。我是程序员,我为程序员代言。现在真的是编程的黄金年代,程序员从来不曾这样供不应求,特别是嵌入式领域。现在哪怕是银行,也需要几个程序员,负责网站的编写,App编写,数据库管理,服务器管..
分类:
其他好文 时间:
2015-05-17 18:50:14
阅读次数:
173
一.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:51:53
阅读次数:
412
Activity之间的数据传输
activity之间的数据传输我们可以通过Intent对象的putExtra方法,通过这个可以传输很多不同类型的数据,比如说字符串、整数、实数、对象等。
首先以一个字符串举例来说一下:
通过putExtra传输字符串可以通过如下方法:
putExtra(String name, String value):intent
第一个参数为用来让接收数据的acti...
分类:
其他好文 时间:
2015-05-17 18:49:07
阅读次数:
122
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:51:14
阅读次数:
100
背景:
本来系统好好的,但今天一打开:180多个错。天呐~~~一下就晕了。整了不到半个小时,就坐不住了。赶快叫救兵前来助阵。怎么办,马上就验收了,真的有些心慌了~~~
问题
虽然看上去有小200个错,但错误类型就两个:(但没来得及截图,下次遇到问题,先截图留念,有图有真相)
问题一:找不到dll文件
这类问题后来我了解到,有这几个原...
分类:
其他好文 时间:
2015-05-17 18:49:25
阅读次数:
128
框架下载地址:http://modernizr.com/
案例:
$(function(){
if( !Modernizr.input.required ){
var $msg = $( "Required Fields Missing" );
$msg.css( "backgr...
分类:
其他好文 时间:
2015-05-17 18:48:20
阅读次数:
104
题目链接: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:49:32
阅读次数:
126
一道很有意思的dp,说它有意思是因为他的原理其实很简单,而且扫描一次就可以得到最终的答案。
如果当前这个数之前的和小于0,...
分类:
其他好文 时间:
2015-05-17 18:49:28
阅读次数:
99
编程初学者可以看看...
分类:
其他好文 时间:
2015-05-17 18:46:31
阅读次数:
217
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:48:13
阅读次数:
118
最长公共子序列,其实就是最长上升子序列的变形。 dp[i][j]表示以第一个序列的i位置为结尾和以第二个序列的j位置为结尾的子序列的公共子序列的长度。
显然影响决策的因素就是这两个序列的位置,所以二重循环直接搞就行了,如果这两个位置的字符相同就+1
#include
#include
#include
#include
#include
using namespace std;
char s...
分类:
其他好文 时间:
2015-05-17 18:46:02
阅读次数:
125
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:46:13
阅读次数:
93